|
@@ -32,6 +32,7 @@ use Illuminate\Support\Str;
|
|
|
use Illuminate\Contracts\Validation\Validator;
|
|
|
use Laravel\Socialite\Facades\Socialite;
|
|
|
use App\Wen\Utils\BaiduUtils;
|
|
|
+use App\Models\User\WxUserTemp;
|
|
|
|
|
|
class ConditionsController extends BaseController
|
|
|
{
|
|
@@ -1162,7 +1163,7 @@ class ConditionsController extends BaseController
|
|
|
$UserTempModel->buchong = $request_content;
|
|
|
return $UserTempModel->save();
|
|
|
}
|
|
|
- UserUtils::assistant_notice('admin', '有用户修改资料待审核');
|
|
|
+ UserUtils::assistant_notice('admin', '有用户修改补充内容待审核');
|
|
|
}else{
|
|
|
UserUtils::assistant_notice($uid, '您提交的补充内容审核通过,已经为您更新。');
|
|
|
$data['content'] = $request_content ?? '';
|
|
@@ -1335,26 +1336,57 @@ class ConditionsController extends BaseController
|
|
|
if (empty($request->registration)) {
|
|
|
return $this->fail(200000, [], '户籍地不能为空');
|
|
|
}
|
|
|
- if (empty($request->content)) {
|
|
|
+
|
|
|
+ $request_content = $request->content;
|
|
|
+ $request_content = str_replace([' 🤖', '🤖',' 💙🤖', ' 💗🤖', '💙🤖', '💗🤖'], '', $request_content);
|
|
|
+ if (empty($request_content)) {
|
|
|
return $this->fail(200000, [], '补充内容不能为空');
|
|
|
}
|
|
|
- // 百度审核
|
|
|
- $wheresa = ['is_xiangqin_audit_posts'];
|
|
|
- $info = WxSetting::whereIn('key',$wheresa)->get();
|
|
|
- $is_xiangqin_audit_posts = $info[0]['value'];
|
|
|
+
|
|
|
+ // 补充内容审核
|
|
|
+ $is_xiangqin_audit_posts = Settings::get('is_xiangqin_audit_posts', 0);
|
|
|
+
|
|
|
+ //白名单
|
|
|
if(UserUtils::user_permissions_check_by_config($uid, 'xiangqin_audit_posts_white_list')){
|
|
|
$need_manual_review = false;
|
|
|
}else{
|
|
|
$need_manual_review = true;
|
|
|
}
|
|
|
- if($is_xiangqin_audit_posts == 2 && $need_manual_review){
|
|
|
- $filter_result = BaiduUtils::text_filter($request->content);
|
|
|
- if($filter_result){
|
|
|
- if($filter_result['hit_level'] == 2){
|
|
|
- return $this->fail(200016, ['tip'=>$filter_result['tip_list'], 'hit_word'=>$filter_result['hit_word']]);
|
|
|
+
|
|
|
+ if($need_manual_review){
|
|
|
+ if($is_xiangqin_audit_posts == 2){
|
|
|
+ $filter_result = BaiduUtils::text_filter($request->content);
|
|
|
+ if($filter_result){
|
|
|
+ if($filter_result['hit_level'] == 2){
|
|
|
+ // 不合规
|
|
|
+ return $this->fail(200016, ['tip'=>$filter_result['tip_list'], 'hit_word'=>$filter_result['hit_word']]);
|
|
|
+ }else if($filter_result['hit_level'] == 0){
|
|
|
+ // 审核通过
|
|
|
+ $need_manual_review = false;
|
|
|
+ }
|
|
|
}
|
|
|
+ }else if($is_xiangqin_audit_posts == 0){
|
|
|
+ $need_manual_review = true;
|
|
|
+ }else{
|
|
|
+ $need_manual_review = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if($need_manual_review){
|
|
|
+ if(WxUserTemp::where([['user_id','=', $uid], ['user_state', '=', 0]])->exists()){
|
|
|
+ WxUserTemp::where('user_id', $uid)->update(['buchong'=>$request_content]);
|
|
|
+ }else{
|
|
|
+ $UserTempModel = new WxUserTemp();
|
|
|
+ $UserTempModel->user_id = $uid;
|
|
|
+ $UserTempModel->buchong = $request_content;
|
|
|
+ return $UserTempModel->save();
|
|
|
}
|
|
|
+ UserUtils::assistant_notice('admin', '有用户修改补充内容待审核');
|
|
|
+ }else{
|
|
|
+ UserUtils::assistant_notice($uid, '您提交的补充内容审核通过,已经为您更新。');
|
|
|
+ //$data['content'] = $request_content ?? '';
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
if ($step == 2) {
|
|
|
// 验证 家庭背景、独生子女、何时结婚、买车情况、买房情况、我的特点
|
|
@@ -1501,7 +1533,7 @@ class ConditionsController extends BaseController
|
|
|
$data['matrimony'] = $request->matrimony;
|
|
|
$data['addresss'] = $request->addresss;
|
|
|
$data['registration'] = $request->registration;
|
|
|
- $data['content'] = $request->content;
|
|
|
+ $data['content'] = !$need_manual_review ? $request_content : '';
|
|
|
$data['create_time'] = time();
|
|
|
}
|
|
|
if ($step == 2) {
|