shish 5 лет назад
Родитель
Сommit
a0e5ae16a5

+ 1 - 1
app-ghs/controllers/ApplyController.php

@@ -53,7 +53,7 @@ class ApplyController extends BaseController
         if (empty($name)) {
             util::fail('名称不能为空');
         }
-        $has = SjClass::getByCondition(['name' => $name]);
+        $has = SjClass::getByCondition(['name' => $name, 'style' => ApplyClass::FROM_GHS]);
         if (!empty($has)) {
             util::fail('名称已经存在');
         }

+ 1 - 1
app-hd/controllers/ApplyController.php

@@ -55,7 +55,7 @@ class ApplyController extends BaseController
         if (empty($name)) {
             util::fail('名称不能为空');
         }
-        $has = SjClass::getByCondition(['name' => $name]);
+        $has = SjClass::getByCondition(['name' => $name, 'style' => ApplyClass::FROM_RETAIL]);
         if (!empty($has)) {
             util::fail('名称已经存在');
         }

+ 9 - 17
biz-hd/saas/services/ApplyService.php

@@ -110,18 +110,10 @@ class ApplyService extends BaseService
             }
         }
         $mobile = $data['mobile'] ?? '';
+        //暂时不需要提供证件
         $data['hasLicense'] = 2;
         $data['licenseNo'] = $mobile;
-//        $licenseNo = $data['licenseNo'] ?? '';
-//        if (empty($licenseNo)) {
-//            util::fail('请填写营业执照编号');
-//        }
-//        //查询客户提交的证件
-//        $has = ApplyClass::getByCondition(['licenseNo' => $licenseNo]);
-//        if (!empty($has)) {
-//            util::fail('营业执照已用过');
-//        }
-        $has = ApplyClass::getByCondition(['mobile' => $mobile]);
+        $has = ApplyClass::getByCondition(['mobile' => $mobile, 'style' => ApplyClass::FROM_RETAIL]);
         if (!empty($has)) {
             util::fail('手机号已经使用过了');
         }
@@ -129,7 +121,7 @@ class ApplyService extends BaseService
         if (empty($adminId)) {
             util::fail('帐号有问题');
         }
-        $has = ApplyClass::getByCondition(['adminId' => $adminId]);
+        $has = ApplyClass::getByCondition(['adminId' => $adminId, 'style' => ApplyClass::FROM_RETAIL]);
         if (!empty($has)) {
             util::fail('您已经申请过');
         }
@@ -158,18 +150,18 @@ class ApplyService extends BaseService
         if (in_array($from, [ApplyClass::FROM_GHS, ApplyClass::FROM_RETAIL]) == false) {
             util::fail('请填写来源');
         }
+        //暂时不需要提供证件
         $data['hasLicense'] = 2;
         $data['licenseNo'] = $mobile;
-//        $licenseNo = $data['licenseNo'] ?? '';
-//        $has = ApplyClass::getByCondition(['licenseNo' => $licenseNo]);
-//        if (!empty($has)) {
-//            util::fail('营业执照已用过');
-//        }
         $adminId = $data['adminId'];
-        $has = ApplyClass::getByCondition(['adminId' => $adminId]);
+        $has = ApplyClass::getByCondition(['adminId' => $adminId, 'style' => ApplyClass::FROM_GHS]);
         if (!empty($has)) {
             util::fail('您已经申请过');
         }
+        $has = ApplyClass::getByCondition(['mobile' => $mobile, 'style' => ApplyClass::FROM_GHS]);
+        if (!empty($has)) {
+            util::fail('手机号已经使用过了');
+        }
 
         //引荐的员工
         $currentShopAdminId = 0;