shish пре 3 година
родитељ
комит
92350c923e
1 измењених фајлова са 44 додато и 40 уклоњено
  1. 44 40
      biz-hd/merchant/services/SjService.php

+ 44 - 40
biz-hd/merchant/services/SjService.php

@@ -52,9 +52,10 @@ class SjService extends BaseService
         $jsData = $applyData;
         $sjData['style'] = $ptStyle;
 
-        if (isset($applyData['sjId'])) {
+        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;
@@ -68,46 +69,49 @@ class SjService extends BaseService
         }
 
         //生成资产
-        $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);
+        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]);
 
-        SjInitClass::add(['sjId' => $sjId]);
+        }
 
         //创建门店
         $shopData = [