liumiao
2021-01-29 a49002e2049d995d09aa9ab795a31880dc07309d
Merge remote-tracking branch 'origin/master'
1 files modified
23 ■■■■ changed files
app/Http/Controllers/Api/v1/FaceController.php 23 ●●●● patch | view | raw | blame | history
app/Http/Controllers/Api/v1/FaceController.php
@@ -61,12 +61,13 @@
            {
                return $this->_response([], ResponseCode::PARAM_ERROR, '未检测到用户人脸');
            }
            $score = $res['data']['Data']['MatchList'][0]['FaceItems'][0]['Score'];
            if($score > 0.6)
            {
                return $this->_response([], ResponseCode::PARAM_ERROR, '人脸已存在,请更改');
            if(isset($res['data']['Data']['MatchList'][0]['FaceItems'][0]['Score'])) {
                $score = $res['data']['Data']['MatchList'][0]['FaceItems'][0]['Score'];
                if($score > 0.6)
                {
                    return $this->_response([], ResponseCode::PARAM_ERROR, '人脸已存在,请更改');
                }
            }
            // 人脸列表
            $faceList = $faceObj->GetFaceEntity($entityId);
            if(!isset($faceList['data']['Data']))
@@ -177,7 +178,7 @@
        $entityId = $res['data']['Data']['MatchList'][0]['FaceItems'][0]['EntityId'];
        $score = $res['data']['Data']['MatchList'][0]['FaceItems'][0]['Score'];
        if($score < 0.5)
        if($score < 0.6)
        {
            return $this->_response([], ResponseCode::PARAM_ERROR, '人脸识别率太低或更换注册人脸后请重新拍摄');
        }
@@ -223,7 +224,7 @@
        }
        else
        {
            if(!isset($res['data']['Data']['FaceCount']) || $res['data']['Data']['FaceCount'] != 0)
            if(!isset($res['data']['Data']['FaceCount']) || $res['data']['Data']['FaceCount'] == 0)
            {
                return $this->_response([], ResponseCode::PARAM_ERROR, '未找到人脸,请重新录入');
            }
@@ -420,7 +421,7 @@
            }
            $entityId = $res['data']['Data']['MatchList'][0]['FaceItems'][0]['EntityId'];
            $score = $res['data']['Data']['MatchList'][0]['FaceItems'][0]['Score'];
            if($score < 0.5)
            if($score < 0.8)
            {
                return $this->_response([], ResponseCode::PARAM_ERROR, '人脸识别率太低或更换注册人脸后请重新拍摄');
            }
@@ -646,8 +647,8 @@
        else
        {
            $signInSet = [
                'lastMinute' => 0,
                'nextMinute' => 0
                'lastMinute' => 15,
                'nextMinute' => 60
            ];
        }
        return $signInSet;
@@ -683,7 +684,7 @@
            ->select('s.id', 's.username', 's.phoneNumber', 's.name', 's.orgId', 's.englishName', 's.faceImg')
            ->leftJoin('anni_students as s', 's.username', '=', 'cs.username')
            ->where($where)
            ->get()->toArray();
            ->groupBy('s.username')->get()->toArray();
        foreach($arr as $k => $v)
        {
            if($v["englishName"] && $v["name"])