wesmiler il y a 2 mois
Parent
commit
ecc4f0dae1
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      app/Services/Common/SupervisorsService.php

+ 8 - 0
app/Services/Common/SupervisorsService.php

@@ -210,6 +210,14 @@ class SupervisorsService extends BaseService
             }
         }
 
+        $userId = isset($data['user_id']) ? intval($data['user_id']) : 0;
+        if ($userId) {
+            $checkId = $this->model->where(['user_id' => $userId, 'mark' => 1])->value('id');
+            if ($checkId && ($id != $checkId)) {
+                return message('该会员账号已绑定其他导师', false);
+            }
+        }
+
 
         // 处理数值类型字段
         if (isset($data['status'])) {