user_id = $user_id; } /** * Execute the job. * * @return void */ public function handle() { try { $user_id = $this->user_id; $log = ApproveHistory::where("user_id", $user_id)->whereNotNull('eid_token')->where('type', 'body')->orderBy('id', 'desc')->first(); if (empty($log)) return ; $res = CommonUtilsService::tencentFaceidRes($log->eid_token); if (isset($res->Text) && isset($res->Text->ErrCode) && $res->Text->ErrCode == 0) { //认证成功 修改认证状态 DB::beginTransaction(); User::where("id", $user_id)->update(['is_approved'=>1,'is_real_approved'=>1]); ApproveHistory::where('user_id', $user_id)->whereIn('type', ['name', 'body'])->update(['status'=>1]); DB::commit(); //更新出生年月日 $user = User::find($user_id); $user->cardBirthdayToProfile(); //缓存用户认证 $user->updateCacheUser('is_approved'); $user->updateCacheUser('is_real_approved'); } return ; } catch (\Exception $e) { DB::rollBack(); $this->getError($e); return ; } } }