|
@@ -1071,6 +1071,7 @@ class ConditionsController extends BaseController
|
|
|
return $this->success(['list' => $list, 'total' => $total]);
|
|
|
}
|
|
|
|
|
|
+ //修改相亲信息,交友信息
|
|
|
public function editConditions(Request $request)
|
|
|
{
|
|
|
$uid = $request->uid;
|
|
@@ -1105,27 +1106,68 @@ 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'];
|
|
|
+
|
|
|
+ //之前的数据
|
|
|
+ $info = Conditions::where('user_id', $uid)->first();
|
|
|
+
|
|
|
+ // 补充内容审核
|
|
|
+ $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;
|
|
|
+ $need_manual_review = false; //是否需要审核
|
|
|
}else{
|
|
|
- $need_manual_review = true;
|
|
|
+ $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']]);
|
|
|
+
|
|
|
+ //AI审核
|
|
|
+ if($need_manual_review){
|
|
|
+ if($is_xiangqin_audit_posts == 2){
|
|
|
+ if($info && $info->content == $request_content){
|
|
|
+ $need_manual_review = false;
|
|
|
+ }else{
|
|
|
+ $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;
|
|
|
+ if($info && $info->content == $request_content){
|
|
|
+ $need_manual_review = false;
|
|
|
}
|
|
|
+ }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 ?? '';
|
|
|
+ }
|
|
|
+
|
|
|
$data['img_urls'] = $request->img_urls ?? '';
|
|
|
$data['video_url'] = $request->video_url ?? '';
|
|
|
$data['age'] = $request->age ?? '';
|
|
@@ -1137,7 +1179,6 @@ class ConditionsController extends BaseController
|
|
|
$data['matrimony'] = $request->matrimony ?? '';
|
|
|
$data['addresss'] = $request->addresss ?? '';
|
|
|
$data['registration'] = $request->registration ?? '';
|
|
|
- $data['content'] = $request->content ?? '';
|
|
|
|
|
|
$data['family'] = $request->family ?? '';
|
|
|
$data['is_only'] = $request->is_only ?? 0;
|
|
@@ -1164,7 +1205,7 @@ class ConditionsController extends BaseController
|
|
|
}
|
|
|
$user = WxUser::where('id', $uid)->first();
|
|
|
// 判断是否创建了数据
|
|
|
- $info = Conditions::where('user_id', $uid)->first();
|
|
|
+
|
|
|
if ($info) {
|
|
|
// 判断步骤是否大于 当前步骤 如果大于当前步骤 则不更新步骤
|
|
|
if ($info->step < $step) {
|