liumiao
2021-01-27 c8c4384bd3a2593f9005435a0f46db693d79c28b
Merge remote-tracking branch 'origin/master'
1 files modified
19 ■■■■ changed files
app/Http/Controllers/Api/v1/FaceController.php 19 ●●●● patch | view | raw | blame | history
app/Http/Controllers/Api/v1/FaceController.php
@@ -301,8 +301,7 @@
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public
    function punchTheClock(Request $request)
    public function punchTheClock(Request $request)
    {
        $rule = [
            'httpUrl' => 'required|string',
@@ -379,6 +378,16 @@
            $username = $request->username;
            $describe = '手机号补录';
        }
        $where = [
            'status' => 1,
            'username' => $username,
            'classCode' => $request->classCode,
        ];
        $res = DB::table('anni_classstudent')->where($where)->first();
        if(empty($info->faceImg))
        {
            return $this->_response([], ResponseCode::SUCCESS, $username . '不在此班级');
        }
        $where = [
            'id' => $studentId
@@ -386,7 +395,7 @@
        $info = StudentsModel::where($where)->select('id', 'faceImg')->first();
        if(empty($info->faceImg))
        {
            return $this->_response([], ResponseCode::SUCCESS, '未录入人脸');
            return $this->_response([], ResponseCode::SUCCESS, $username . '未录入人脸');
        }
        $where = [
@@ -400,7 +409,7 @@
        $res = FaceAttendanceModel::where($where)->first();
        if(!empty($res))
        {
            return $this->_response([], ResponseCode::PARAM_ERROR, '已签到,请勿重复签到');
            return $this->_response([], ResponseCode::PARAM_ERROR, $username . '已签到,请勿重复签到');
        }
        DB::beginTransaction(); //开启事务
@@ -448,7 +457,7 @@
        }
        return $this->_response([], ResponseCode::SUCCESS, '签到成功');
        return $this->_response([], ResponseCode::SUCCESS, $username . '签到成功');
    }
    /**