=','1')->delete(); foreach ($momentList as $m_i){ $res = \CommonUtilsService::verifyTextV2([$m_i->content],$illegality_keyword,1); if($res['code'] != 1){ $violation_moment_list[] = $this->verifyStatisticsArray('moment',$m_i->id,$res['detail_context'],$res['code'],$res['type'],$res['context'],'content'); } } $userCount = User::where('type','signle')->count(); for($uc=0;$uc<=$userCount;$uc+=10000){ $thisUserCount = $uc; $userList = User::with('profileCourtship') ->whereHas('profileCourtship', function ($sql){ $sql->where('introduction','<>',''); $sql->where('ideal_mate','<>',''); }) ->where('type','single') ->limit(10000) ->offset($thisUserCount) ->get(); foreach ($userList as $u){ $introduction = $u->profileCourtship->introduction; $ideal_mate = $u->profileCourtship->ideal_mate; $res = \CommonUtilsService::verifyTextV2([$introduction],$illegality_keyword,1); if($res['code'] != 1){ $violation_userinfo_list[] = $this->verifyStatisticsArray('user',$u->id,$res['detail_context'],$res['code'],$res['type'],$res['context'],'introduction'); } $res = \CommonUtilsService::verifyTextV2([$ideal_mate],$illegality_keyword,1); if($res['code'] != 1){ $violation_userinfo_list[] = $this->verifyStatisticsArray('user',$u->id,$res['detail_context'],$res['code'],$res['type'],$res['context'],'ideal_mate'); } } } $data['violation_moment_list'] = $violation_moment_list; $data['violation_userinfo_list'] = $violation_userinfo_list; $HandleLogsData['elapsed_time']='耗时:'.(microtime(true)-$t1); HandleLogs::add(1,'检验敏感词完成',$HandleLogsData,'log_sensitive_word'); } catch (\Exception $e) { HandleLogs::add(2,'检验敏感词失败 ',$e->getMessage(),'log_sensitive_word'); } } /***/ protected function verifyStatisticsArray($sourceType,$sourceId,$context,$errorCode,$errorType,$errorContext,$source_context_field){ VerifyLog::create([ 'source_type'=>$sourceType, 'source_id'=>$sourceId, 'source_context'=>$context, 'source_context_field'=>$source_context_field, 'error_code'=>$errorCode, 'error_type'=>$errorType, 'error_context'=>$errorContext ]); } }