소스 검색

uniSj 取消

shish 3 년 전
부모
커밋
af4d4860b2
3개의 변경된 파일46개의 추가작업 그리고 60개의 파일을 삭제
  1. 0 3
      biz-ghs/apply/services/ApplyService.php
  2. 42 53
      biz-hd/merchant/services/SjService.php
  3. 4 4
      biz-hd/shop/classes/ShopClass.php

+ 0 - 3
biz-ghs/apply/services/ApplyService.php

@@ -27,9 +27,6 @@ class ApplyService extends BaseService
 
         $respond = MerchantService::initGhsBaseInfo($apply, $main, true);
         $shop = $respond['shop'] ?? [];
-        $sj = $respond['sj'] ?? [];
-        $apply['sjId'] = $sj->id ?? 0;
-        $apply['sjName'] = $sj->name ?? '';
 
         $ret = SjService::initHdBaseInfo($apply, $main);
         $shop2 = $ret['shop'] ?? [];

+ 42 - 53
biz-hd/merchant/services/SjService.php

@@ -51,17 +51,9 @@ class SjService extends BaseService
 
         $jsData = $applyData;
         $sjData['style'] = $ptStyle;
-
-        if (isset($applyData['sjId']) && !empty($applyData['sjId'])) {
-            $sjId = $applyData['sjId'] ?? 0;
-            $sjName = $applyData['sjName'] ?? 0;
-            $sj = SjClass::getById($sjId, true);
-        } else {
-            $sj = self::add($jsData, true);
-            $sjId = $sj->id;
-            $sjName = $sj->name ?? 0;
-        }
-
+        $sj = self::add($jsData, true);
+        $sjId = $sj->id;
+        $sjName = $sj->name ?? 0;
         $mobile = $applyData['mobile'] ?? '';
 
         if (!empty($applyId) && $applyOpen == true) {
@@ -69,49 +61,46 @@ class SjService extends BaseService
         }
 
         //生成资产
-        if (isset($applyData['sjId']) == false || empty($applyData['sjId'])) {
-            $assetData = [
-                'balance' => 0,
-                'totalVisit' => 0,
-                'totalUser' => 0,
-                'totalMember' => 0,
-                'totalFans' => 0,
-                'totalIntegral' => 0,
-                'totalPoint' => 0,
-                'totalGoods' => 0,
-                'totalRecharge' => 0,
-                'totalOrder' => 0,
-                'totalDeal' => 0,
-                'sjId' => $sjId,
-                'totalIncome' => 0,
-                'totalExpend' => 0,
-            ];
-            SjAssetClass::add($assetData);
-
-            //生成商家拓展信息
-            $extendData = [
-                'sjId' => $sjId,
-                'wxAppId' => isset($applyData['wxAppId']) ? $applyData['wxAppId'] : '',
-                'webTitle' => isset($applyData['name']) ? $applyData['name'] : '',
-                'webKeyword' => isset($applyData['name']) ? $applyData['name'] : '',
-                'webDescription' => isset($applyData['name']) ? $applyData['name'] : '',
-                'wxMenuInit' => 0,
-                'wxTMessageInit' => 0,
-                'payment' => 0,//支付功能关闭
-                'recharge' => 0,//充值功能关闭
-                'giveCoupon' => 1,//默认赠送代金劵
-                'giveCouponPrice' => 5,//代金劵金额5元
-                'couponMeetPrice' => 180,//满足金额
-                'couponValidity' => 30,//代金劵有效期30天
-                'alipayAccount' => isset($applyData['alipayAccount']) ? $applyData['alipayAccount'] : '',//提现的支付宝帐号
-                'alipayAccountName' => isset($applyData['alipayAccountName']) ? $applyData['alipayAccountName'] : '',//提现支付宝帐号姓名
-                'gradeList' => '1_2000_0.9I2_5000_0.88I3_10000_0.85I4_20000_0.8',//1 级会员需要满 2000 积分 购物享9折;2 级会员需要满 5000 积分 购物享88折
-            ];
-            SjExtendClass::add($extendData);
-
-            SjInitClass::add(['sjId' => $sjId]);
+        $assetData = [
+            'balance' => 0,
+            'totalVisit' => 0,
+            'totalUser' => 0,
+            'totalMember' => 0,
+            'totalFans' => 0,
+            'totalIntegral' => 0,
+            'totalPoint' => 0,
+            'totalGoods' => 0,
+            'totalRecharge' => 0,
+            'totalOrder' => 0,
+            'totalDeal' => 0,
+            'sjId' => $sjId,
+            'totalIncome' => 0,
+            'totalExpend' => 0,
+        ];
+        SjAssetClass::add($assetData);
 
-        }
+        //生成商家拓展信息
+        $extendData = [
+            'sjId' => $sjId,
+            'wxAppId' => isset($applyData['wxAppId']) ? $applyData['wxAppId'] : '',
+            'webTitle' => isset($applyData['name']) ? $applyData['name'] : '',
+            'webKeyword' => isset($applyData['name']) ? $applyData['name'] : '',
+            'webDescription' => isset($applyData['name']) ? $applyData['name'] : '',
+            'wxMenuInit' => 0,
+            'wxTMessageInit' => 0,
+            'payment' => 0,//支付功能关闭
+            'recharge' => 0,//充值功能关闭
+            'giveCoupon' => 1,//默认赠送代金劵
+            'giveCouponPrice' => 5,//代金劵金额5元
+            'couponMeetPrice' => 180,//满足金额
+            'couponValidity' => 30,//代金劵有效期30天
+            'alipayAccount' => isset($applyData['alipayAccount']) ? $applyData['alipayAccount'] : '',//提现的支付宝帐号
+            'alipayAccountName' => isset($applyData['alipayAccountName']) ? $applyData['alipayAccountName'] : '',//提现支付宝帐号姓名
+            'gradeList' => '1_2000_0.9I2_5000_0.88I3_10000_0.85I4_20000_0.8',//1 级会员需要满 2000 积分 购物享9折;2 级会员需要满 5000 积分 购物享88折
+        ];
+        SjExtendClass::add($extendData);
+
+        SjInitClass::add(['sjId' => $sjId]);
 
         //创建门店
         $shopData = [

+ 4 - 4
biz-hd/shop/classes/ShopClass.php

@@ -117,10 +117,10 @@ class ShopClass extends BaseClass
         if (stringUtil::getWordNum($shopName) > 8) {
             util::fail('门店名称不能超过8个汉字,2个字母顶一个汉字');
         }
-        //$exists = self::getByCondition(['sjId' => $data['sjId'], 'shopName' => $shopName]);
-        //if (!empty($exists)) {
-            //util::fail('门店名称已经存在');
-        //}
+        $exists = self::getByCondition(['sjId' => $data['sjId'], 'shopName' => $shopName]);
+        if (!empty($exists)) {
+            util::fail('门店名称已经存在');
+        }
         //补充fullAddress lqh 2021.4.18
         $data['fullAddress'] = $data['city'] . $data['address'] . $data['floor'];
         $data['img'] = isset($data['img']) && !empty($data['img']) ? json_encode($data['img']) : '';