ソースを参照

已经存在客户添加成功

shish 4 年 前
コミット
243f04cacb
1 ファイル変更9 行追加2 行削除
  1. 9 2
      app-ghs/controllers/CustomController.php

+ 9 - 2
app-ghs/controllers/CustomController.php

@@ -198,11 +198,18 @@ class CustomController extends BaseController
             }
             $hasShop = ShopClass::getByCondition(['mobile' => $mobile], true);
             if (!empty($hasShop)) {
-                util::fail("手机号已经添加过了");
+                $shop = ShopClass::getByCondition(['mobile' => $mobile, 'ptStyle' => 1], true);
+                if (!empty($shop)) {
+                    $ghsShopId = $this->shopId;
+                    $hdShopId = $shop->id;
+                    CustomClass::build($ghsShopId, $hdShopId);
+                    util::complete($shop->merchantName . ' 添加成功');
+                }
+                util::fail($mobile . "手机号已经添加过了");
             }
             $has = ApplyClass::getByCondition(['mobile' => $mobile]);
             if (!empty($has)) {
-                util::fail("手机号已经申请添加过了");
+                util::fail($mobile . "手机号已经申请添加过了");
             }
             $arr[] = ['name' => $name, 'mobile' => $mobile];
         }