瀏覽代碼

merchant name 变更

shish 5 年之前
父節點
當前提交
6113d8568f
共有 49 個文件被更改,包括 437 次插入335 次删除
  1. 3 3
      app-ghs/controllers/CustomController.php
  2. 1 1
      app-ghs/controllers/MainController.php
  3. 99 99
      app-ghs/controllers/MerchantController.php
  4. 1 1
      app-ghs/controllers/RechargeController.php
  5. 1 1
      app-ghs/controllers/TestController.php
  6. 2 2
      app-hd/controllers/ApplyController.php
  7. 2 2
      app-hd/controllers/RechargeController.php
  8. 1 1
      app-hd/controllers/ShopController.php
  9. 1 1
      app-hd/controllers/TestController.php
  10. 35 38
      app-pt/controllers/BaseController.php
  11. 1 1
      app-pt/controllers/MerchantController.php
  12. 35 0
      app-pt/controllers/SjController.php
  13. 2 2
      app-pt/controllers/WxOpenController.php
  14. 5 4
      biz-ghs/custom/classes/CustomClass.php
  15. 5 5
      biz-ghs/merchant/classes/MerchantClass.php
  16. 1 1
      biz-ghs/order/services/OrderService.php
  17. 1 1
      biz-hd/goods/classes/GoodsClass.php
  18. 1 1
      biz-hd/order/services/OrderService.php
  19. 2 2
      biz-hd/purchase/classes/PurchaseClass.php
  20. 3 2
      biz-hd/saas/classes/ApplyClass.php
  21. 1 1
      biz-hd/saas/classes/RenewClass.php
  22. 7 6
      biz-hd/saas/services/ApplyService.php
  23. 1 1
      biz-hd/user/classes/UserClass.php
  24. 1 1
      biz-hd/wx/services/MiniUpgradeService.php
  25. 1 1
      biz-mall/goods/classes/GoodsClass.php
  26. 5 7
      biz-mall/merchant/classes/MerchantClass.php
  27. 6 6
      biz-mall/merchant/services/MerchantService.php
  28. 1 1
      biz-mall/order/services/OrderService.php
  29. 1 1
      biz-mall/saas/classes/RenewClass.php
  30. 2 2
      biz-mall/saas/services/ApplyService.php
  31. 1 1
      biz-mall/user/classes/UserClass.php
  32. 1 1
      biz-mall/wx/services/MiniUpgradeService.php
  33. 98 102
      biz/sj/classes/MerchantClass.php
  34. 20 0
      biz/sj/classes/SjClass.php
  35. 13 0
      biz/sj/models/Sj.php
  36. 12 10
      biz/sj/services/MerchantService.php
  37. 34 0
      biz/sj/services/SjService.php
  38. 2 2
      common/components/miniUtil.php
  39. 2 2
      common/components/rabbitmq/consumer/openShopInitConsumer.php
  40. 3 3
      common/components/sms.php
  41. 2 2
      common/components/wxUtil.php
  42. 1 1
      common/services/xhCommonService.php
  43. 2 2
      common/services/xhMerchantService.php
  44. 2 2
      common/services/xhShopService.php
  45. 2 2
      console/controllers/OpenShopInitController.php
  46. 2 2
      console/controllers/ShellController.php
  47. 2 1
      console/controllers/SjInitController.php
  48. 6 6
      console/controllers/UpgradeController.php
  49. 4 1
      sql.sql

+ 3 - 3
app-ghs/controllers/CustomController.php

@@ -2,7 +2,7 @@
 
 namespace ghs\controllers;
 
-use biz\sj\classes\MerchantClass;
+use biz\sj\classes\SjClass;
 use bizHd\saas\classes\ApplyClass;
 use bizHd\saas\services\ApplyService;
 use bizGhs\custom\classes\CustomClass;
@@ -65,10 +65,10 @@ class CustomController extends BaseController
 	public function actionAdd()
 	{
 		$post = Yii::$app->request->post();
-		$post['style'] = MerchantClass::STYLE_RETAIL;
+		$post['style'] = SjClass::STYLE_RETAIL;
 		$post['from'] = ApplyClass::FROM_GHS;
 		$post['introSjId'] = $this->sjId;
-		$post['introStyle'] = MerchantClass::STYLE_SUPPLIER;
+		$post['introStyle'] = SjClass::STYLE_SUPPLIER;
 		$post['certType'] = ApplyClass::CERT_TYPE_MOBILE;
 		$mobile = $post['mobile'] ?? '';
 		$confirmMobile = $post['confirmMobile'];

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

@@ -123,7 +123,7 @@ class MainController extends BaseController
         $adminName = $relation['adminName'];
         $shopAdminId = $relation['id'];
         $mobile = $relation['mobile'] ?? '';
-        $sjName = $sj['merchantName'] ?? '';
+        $sjName = $sj['name'] ?? '';
         $shopName = $shop['shopName'] ?? '';
         $cashAccount = $shop['cashAccount'] ?? '';
         $data = [

+ 99 - 99
app-ghs/controllers/MerchantController.php

@@ -12,105 +12,105 @@ use common\components\util;
 
 class MerchantController extends BaseController
 {
-	
-	//运费设置 ssh 2019.12.8
-	public function actionFreightSetting()
-	{
-		$get = Yii::$app->request->get();
-		$first = isset($get['first']) && is_numeric($get['first']) ? $get['first'] : 5;
-		$add = isset($get['add']) && is_numeric($get['add']) ? $get['add'] : 5;
-		MerchantExtendService::updateByCondition(['merchantId' => $this->sjId], ['freeDistance' => $first, 'freight' => $add]);
-		util::complete();
-	}
-	
-	//商家信息 ssh 2019.12.8
-	public function actionDetail()
-	{
-		$merchant = $this->sj;
-		if (empty($merchant)) {
-			util::success([]);
-		}
-		$merchant = MerchantService::getInfo($this->sj, $this->sjExtend);
-		util::success($merchant);
-	}
-	
-	//商家现有的会员等级 ssh 2019.12.12
-	public function actionMemberLevel()
-	{
-		$list = MerchantExtendService::getGradeList($this->sjExtend, false, false);
-		$extend = $this->sjExtend;
-		$gradeSwitch = isset($extend['gradeSwitch']) ? $extend['gradeSwitch'] : 1;
-		util::success(['list' => $list, 'gradeSwitch' => $gradeSwitch]);
-	}
-	
-	//会员等级更新 ssh 2019.12.18
-	public function actionMemberLevelUpdate()
-	{
-		$extend = $this->sjExtend;
-		if ($extend['gradeSwitch'] == 0) {
-			util::fail('会员等级已设置不能修改');
-		}
-		$list = Yii::$app->request->post('list');
-		if (empty($list) || is_array($list) == false) {
-			util::fail('请填写会员等级');
-		}
-		if (count($list) > 9) {
-			util::fail('最多可以设置9个等级');
-		}
-		$data = [];
-		foreach ($list as $key => $val) {
-			if ($key > 0) {
-				$currentGrowth = $val[1];
-				$previousGrowth = $list[$key - 1][1];
-				if ($currentGrowth <= $previousGrowth) {
-					util::fail('等级越高成长值也要越高');
-				}
-				$currentDiscount = $val[2];
-				$previousDiscount = $list[$key - 1][2];
-				if ($currentDiscount >= $previousDiscount) {
-					util::fail('等级越高折扣要越低');
-				}
-			}
-			$data[] = $val[0] . '_' . $val[1] . '_' . $val[2];
-		}
-		if (empty($data)) {
-			util::fail('请填写会员等级!');
-		}
-		$string = implode('I', $data);
-		MerchantExtendService::updateByCondition(['merchantId' => $this->sjId], ['gradeList' => $string, 'gradeSwitch' => 0]);
-		util::complete('提交成功');
-	}
-	
-	//常用链接
-	public function actionCommonUrl()
-	{
-		$list = MerchantService::getCommonUrlList();
-		util::success($list);
-	}
-	
-	//商家当前的权限id列表 ssh 2020.1.23
-	public function actionAuth()
-	{
-		$merchant = $this->sj;
-		$setId = $merchant['setId'];
-		$endId = 1;
-		$ids = SetAuthService::getAuthIdList($setId, $endId);
-		util::success(['ids' => $ids]);
-	}
 
-	//商家信息 ssh 2020.1.11
-	public function actionIntroduceShop()
-	{
-		$id = Yii::$app->request->get('id');
-		$merchant = MerchantService::getMerchantById($id);
-		if (empty($merchant)) {
-			util::fail('没有找到介绍人');
-		}
-		$merchantName = isset($merchant['merchantName']) ? $merchant['merchantName'] : '';
-		$logoUrl = isset($merchant['smallLogoUrl']) && !empty($merchant['smallLogoUrl']) ? $merchant['smallLogoUrl'] : imgUtil::getPrefix() . '/hhb_small.png';
-		$address = $merchant['address'] ?? '';
-		$data = ['merchantName' => $merchantName, 'smallLogoUrl' => $logoUrl, 'id' => $id, 'fullAddress' => $address];
-		util::success($data);
-	}
+    //运费设置 ssh 2019.12.8
+    public function actionFreightSetting()
+    {
+        $get = Yii::$app->request->get();
+        $first = isset($get['first']) && is_numeric($get['first']) ? $get['first'] : 5;
+        $add = isset($get['add']) && is_numeric($get['add']) ? $get['add'] : 5;
+        MerchantExtendService::updateByCondition(['merchantId' => $this->sjId], ['freeDistance' => $first, 'freight' => $add]);
+        util::complete();
+    }
+
+    //商家信息 ssh 2019.12.8
+    public function actionDetail()
+    {
+        $merchant = $this->sj;
+        if (empty($merchant)) {
+            util::success([]);
+        }
+        $merchant = MerchantService::getInfo($this->sj, $this->sjExtend);
+        util::success($merchant);
+    }
+
+    //商家现有的会员等级 ssh 2019.12.12
+    public function actionMemberLevel()
+    {
+        $list = MerchantExtendService::getGradeList($this->sjExtend, false, false);
+        $extend = $this->sjExtend;
+        $gradeSwitch = isset($extend['gradeSwitch']) ? $extend['gradeSwitch'] : 1;
+        util::success(['list' => $list, 'gradeSwitch' => $gradeSwitch]);
+    }
+
+    //会员等级更新 ssh 2019.12.18
+    public function actionMemberLevelUpdate()
+    {
+        $extend = $this->sjExtend;
+        if ($extend['gradeSwitch'] == 0) {
+            util::fail('会员等级已设置不能修改');
+        }
+        $list = Yii::$app->request->post('list');
+        if (empty($list) || is_array($list) == false) {
+            util::fail('请填写会员等级');
+        }
+        if (count($list) > 9) {
+            util::fail('最多可以设置9个等级');
+        }
+        $data = [];
+        foreach ($list as $key => $val) {
+            if ($key > 0) {
+                $currentGrowth = $val[1];
+                $previousGrowth = $list[$key - 1][1];
+                if ($currentGrowth <= $previousGrowth) {
+                    util::fail('等级越高成长值也要越高');
+                }
+                $currentDiscount = $val[2];
+                $previousDiscount = $list[$key - 1][2];
+                if ($currentDiscount >= $previousDiscount) {
+                    util::fail('等级越高折扣要越低');
+                }
+            }
+            $data[] = $val[0] . '_' . $val[1] . '_' . $val[2];
+        }
+        if (empty($data)) {
+            util::fail('请填写会员等级!');
+        }
+        $string = implode('I', $data);
+        MerchantExtendService::updateByCondition(['merchantId' => $this->sjId], ['gradeList' => $string, 'gradeSwitch' => 0]);
+        util::complete('提交成功');
+    }
+
+    //常用链接
+    public function actionCommonUrl()
+    {
+        $list = MerchantService::getCommonUrlList();
+        util::success($list);
+    }
+
+    //商家当前的权限id列表 ssh 2020.1.23
+    public function actionAuth()
+    {
+        $merchant = $this->sj;
+        $setId = $merchant['setId'];
+        $endId = 1;
+        $ids = SetAuthService::getAuthIdList($setId, $endId);
+        util::success(['ids' => $ids]);
+    }
+
+    //商家信息 ssh 2020.1.11
+    public function actionIntroduceShop()
+    {
+        $id = Yii::$app->request->get('id');
+        $merchant = MerchantService::getMerchantById($id);
+        if (empty($merchant)) {
+            util::fail('没有找到介绍人');
+        }
+        $name = isset($merchant['name']) ? $merchant['name'] : '';
+        $logoUrl = isset($merchant['smallLogoUrl']) && !empty($merchant['smallLogoUrl']) ? $merchant['smallLogoUrl'] : imgUtil::getPrefix() . '/hhb_small.png';
+        $address = $merchant['address'] ?? '';
+        $data = ['name' => $name, 'smallLogoUrl' => $logoUrl, 'id' => $id, 'fullAddress' => $address];
+        util::success($data);
+    }
 
 }

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

@@ -32,7 +32,7 @@ class RechargeController extends BaseController
             'amount' => $amount,
             'payWay' => $wxPay,
             'sjId' => $this->sjId,
-            'sjStyle' => MerchantClass::STYLE_RETAIL,
+            'sjStyle' => SjClass::STYLE_RETAIL,
             'shopId' => $this->shopId,
             'modPrice' => 0,
             'remark' => '',

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

@@ -318,7 +318,7 @@ class TestController extends BaseController
 		if (getenv('YII_ENV') == 'dev') {
 			$name = '花美灵';
 		}
-		$merchant = MerchantService::getByCondition(['merchantName' => $name]);
+		$merchant = MerchantService::getByCondition(['name' => $name]);
 		$list = wxUtil::getSubscribeUserList($merchant);
 		dd($list);
 	}

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

@@ -27,7 +27,7 @@ class ApplyController extends BaseController
         $where = [];
         $where['introSjId'] = $this->sjId;
         $status = $get['status'] ?? 0;
-        $style = $get['style'] ?? MerchantClass::STYLE_RETAIL;
+        $style = $get['style'] ?? SjClass::STYLE_RETAIL;
         if (!empty($status)) {
             $where['status'] = $status;
         }
@@ -46,7 +46,7 @@ class ApplyController extends BaseController
         $get['long'] = isset($get['longitude']) ? $get['longitude'] : '';
         $get['lat'] = isset($get['latitude']) ? $get['latitude'] : '';
         $get['from'] = ApplyClass::FROM_RETAIL;
-        $get['style'] = MerchantClass::STYLE_RETAIL;
+        $get['style'] = SjClass::STYLE_RETAIL;
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {

+ 2 - 2
app-hd/controllers/RechargeController.php

@@ -48,7 +48,7 @@ class RechargeController extends BaseController
 			'amount' => 5980,
 			'payWay' => $wxPay,
 			'sjId' => $this->sjId,
-			'sjStyle' => MerchantClass::STYLE_RETAIL,
+			'sjStyle' => SjClass::STYLE_RETAIL,
 			'shopId' => $this->shopId,
 			'modPrice' => 0,
 			'remark' => '免费续期充值',
@@ -114,7 +114,7 @@ class RechargeController extends BaseController
 			'amount' => $amount,
 			'payWay' => $wxPay,
 			'sjId' => $this->sjId,
-			'sjStyle' => MerchantClass::STYLE_RETAIL,
+			'sjStyle' => SjClass::STYLE_RETAIL,
 			'shopId' => $this->shopId,
 			'modPrice' => 0,
 			'remark' => '',

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

@@ -147,7 +147,7 @@ class ShopController extends BaseController
             'telephone' => '15280215347',
             'openTime' => '09:00--18:00',
             'shopName' => '国兰花尚',
-            'merchantName' => '国兰花尚2',
+            'name' => '国兰花尚2',
             'introduction' => '门店介绍',
         ];
         util::success(['ad' => $ad, 'shop' => $shop, 'newUserGift' => $newUserGift]);

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

@@ -85,7 +85,7 @@ class TestController extends BaseController
 		if (getenv('YII_ENV') == 'dev') {
 			$name = '花美灵';
 		}
-		$merchant = MerchantService::getByCondition(['merchantName' => $name]);
+		$merchant = MerchantService::getByCondition(['name' => $name]);
 		$list = wxUtil::getSubscribeUserList($merchant);
 		dd($list);
 	}

+ 35 - 38
app-pt/controllers/BaseController.php

@@ -3,6 +3,7 @@
 namespace pt\controllers;
 
 use bizHd\saas\services\StaffService;
+use common\components\jwt;
 use Yii;
 use yii\web\Controller;
 
@@ -11,42 +12,38 @@ use yii\web\Controller;
  */
 class BaseController extends PublicController
 {
-	
-	public $staff, $staffId, $userId, $user;
-	public $isLogin = false;
-	public $guestAccessAction = [];//不需要登陆的方法名
-	public $validate = true;
-	
-	public function beforeAction($action)
-	{
-
-		//6表示总后台
-		Yii::$app->params['ptStyle'] = 6;
-
-		//token验证
-		//$staffId = jwt::getLoginId();
-		$staffId = 1;
-		$userId = 1;
-		if (empty($staffId)) {
-			$this->validate = false;
-		}
-		//游客可以访问的方法
-		if (in_array($action->id, $this->guestAccessAction)) {
-			$this->validate = true;
-		}
-		if ($this->validate == false) {
-			util::notLogin();
-		}
-		$staff = StaffService::getById($staffId);
-		if (empty($staff)) {
-			util::fail('没有找到管理员');
-		}
-		
-		$this->staff = $staff;
-		$this->staffId = $staffId;
-		$this->user = $staff;
-		$this->userId = $userId;
-		return parent::beforeAction($action);
-	}
-	
+
+    public $staff, $staffId, $userId, $user;
+    public $isLogin = false;
+    public $guestAccessAction = [];//不需要登陆的方法名
+    public $validate = true;
+
+    public function beforeAction($action)
+    {
+        //6表示总后台
+        Yii::$app->params['ptStyle'] = 6;
+
+        $staffId = jwt::getLoginId();
+
+        if (empty($staffId)) {
+            $this->validate = false;
+        }
+        //游客可以访问的方法
+        if (in_array($action->id, $this->guestAccessAction)) {
+            $this->validate = true;
+        }
+        if ($this->validate == false) {
+            util::notLogin();
+        }
+        $staff = StaffService::getById($staffId);
+        if (empty($staff)) {
+            util::fail('没有找到管理员');
+        }
+
+        $this->staff = $staff;
+        $this->staffId = $staffId;
+        $this->user = $staff;
+        return parent::beforeAction($action);
+    }
+
 }

+ 1 - 1
app-pt/controllers/MerchantController.php

@@ -15,7 +15,7 @@ class MerchantController extends BaseController
 	public function actionList()
 	{
 		$get = Yii::$app->request->get();
-		$style = $get['style'] ?? MerchantClass::STYLE_RETAIL;
+		$style = $get['style'] ?? SjClass::STYLE_RETAIL;
 		$where = [];
 		if (!empty($style)) {
 			$where['style'] = $style;

+ 35 - 0
app-pt/controllers/SjController.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace pt\controllers;
+
+use biz\sj\classes\SjClass;
+use common\components\util;
+use biz\sj\services\MerchantService;
+use Yii;
+
+class SjController extends BaseController
+{
+
+    //新增商家 shish 2021.3.29
+    public function actionAdd()
+    {
+        $get = Yii::$app->request->get();
+        $name = isset($get['name']) && !empty($get['name']) ? $get['name'] : '';
+        if (empty($name)) {
+            util::fail('请填写名称');
+        }
+        $connection = Yii::$app->db;
+        $transaction = $connection->beginTransaction();
+        try {
+            $apply['name'] = $name;
+            $apply['style'] = SjClass::STYLE_KM_SUPPLIER;
+            MerchantService::initSjInfo($apply);
+            $transaction->commit();
+            util::complete();
+        } catch (\Exception $exception) {
+            Yii::info("添加商家失败:" . $exception->getMessage());
+            util::fail('操作失败');
+        }
+    }
+
+}

+ 2 - 2
app-pt/controllers/WxOpenController.php

@@ -583,8 +583,8 @@ class WxOpenController extends PublicController
     public function actionCheckMerchantName()
     {
         $get = Yii::$app->request->get();
-        $merchantName = isset($get['merchantName']) ? $get['merchantName'] : '';
-        $m = xhMerchantService::getByMerchantName($merchantName);
+        $merchantName = isset($get['name']) ? $get['name'] : '';
+        $m = xhMerchantService::getByName($merchantName);
         if (!empty($m)) {
             util::fail('公众号名称已经使用');
         }

+ 5 - 4
biz-ghs/custom/classes/CustomClass.php

@@ -4,6 +4,7 @@ namespace bizGhs\custom\classes;
 
 use biz\shop\classes\ShopClass;
 use biz\sj\classes\MerchantClass;
+use biz\sj\classes\SjClass;
 use common\components\business;
 use common\components\imgUtil;
 use common\components\util;
@@ -18,8 +19,8 @@ class CustomClass extends BaseClass
     //申请开店建立客户关系 ssh 2021.2.28
     public static function buildCustom($applyData, $sjId, $shopId, $isOpen)
     {
-        if ($applyData['style'] == MerchantClass::STYLE_RETAIL) {
-            if ($applyData['introStyle'] == MerchantClass::STYLE_SUPPLIER) {
+        if ($applyData['style'] == SjClass::STYLE_RETAIL) {
+            if ($applyData['introStyle'] == SjClass::STYLE_SUPPLIER) {
                 $has = CustomClass::getByCondition(['sjId' => $applyData['introSjId'], 'customSjId' => $sjId, 'customShopId' => $shopId]);
                 if (empty($has)) {
                     $customData = [
@@ -41,8 +42,8 @@ class CustomClass extends BaseClass
                 }
             }
         }
-        if ($applyData['style'] == MerchantClass::STYLE_SUPPLIER) {
-            if ($applyData['introStyle'] == MerchantClass::STYLE_RETAIL) {
+        if ($applyData['style'] == SjClass::STYLE_SUPPLIER) {
+            if ($applyData['introStyle'] == SjClass::STYLE_RETAIL) {
                 $has = CustomClass::getByCondition(['sjId' => $sjId, 'customSjId' => $applyData['introSjId'], 'customShopId' => $applyData['introShopId']]);
                 if (empty($has)) {
                     $introSjId = $applyData['introSjId'] ?? 0;

+ 5 - 5
biz-ghs/merchant/classes/MerchantClass.php

@@ -72,7 +72,7 @@ class MerchantClass extends BaseClass
         $data['precision'] = (string)0;
         $data['wxToken'] = stringUtil::buildWxToken(0);
         $data['photoList'] = isset($data['photoList']) ? $data['photoList'] : '';
-        $data['merchantName'] = isset($data['merchantName']) ? $data['merchantName'] : '';
+        $data['name'] = isset($data['name']) ? $data['name'] : '';
         $data['province'] = isset($data['province']) ? $data['province'] : '';
         $data['city'] = isset($data['city']) ? $data['city'] : '';
         $data['shopDist'] = isset($data['dist']) ? $data['dist'] : '';
@@ -113,9 +113,9 @@ class MerchantClass extends BaseClass
         $extendData = [
             'merchantId' => $merchantId,
             'wxAppId' => isset($data['wxAppId']) ? $data['wxAppId'] : '',
-            'webTitle' => isset($data['merchantName']) ? $data['merchantName'] : '',
-            'webKeyword' => isset($data['merchantName']) ? $data['merchantName'] : '',
-            'webDescription' => isset($data['merchantName']) ? $data['merchantName'] : '',
+            'webTitle' => isset($data['name']) ? $data['name'] : '',
+            'webKeyword' => isset($data['name']) ? $data['name'] : '',
+            'webDescription' => isset($data['name']) ? $data['name'] : '',
             'wxMenuInit' => 0,
             'wxTMessageInit' => 0,
             'payment' => 0,//支付功能关闭
@@ -145,7 +145,7 @@ class MerchantClass extends BaseClass
 
         //创建门店
         $shopData = [
-            'shopName' => $merchant['merchantName'],
+            'shopName' => $merchant['name'],
             'merchantId' => $merchantId,
             'addTime' => $time,
             'createTime' => $date,

+ 1 - 1
biz-ghs/order/services/OrderService.php

@@ -48,7 +48,7 @@ class OrderService extends BaseService
             $data['list'][$key]['goodsInfoList'] = isset($goodsList[$id]) ? $goodsList[$id] : [];
             $data['list'][$key]['bookAvatar'] = isset($userInfoList[$userId]['smallAvatarUrl']) ? $userInfoList[$userId]['smallAvatarUrl'] : '';
             $merchantId = $val['merchantId'];
-            $data['list'][$key]['merchantName'] = isset($merchantList[$merchantId]['merchantName']) ? $merchantList[$merchantId]['merchantName'] : '';
+            $data['list'][$key]['name'] = isset($merchantList[$merchantId]['name']) ? $merchantList[$merchantId]['name'] : '';
             $data['list'][$key]['reachTime'] = OrderClass::getReachTime($val);
             $requireReachTime = '';
             if ($val['reachDate'] != '0000-00-00') {

+ 1 - 1
biz-hd/goods/classes/GoodsClass.php

@@ -49,7 +49,7 @@ class GoodsClass extends BaseClass
             //多款式
             $val['goodsStyleList'] = isset($val['goodsStyle']) && $val['goodsStyle'] == 1 ? array_values(GoodsStyleClass::getStyleList($id)) : [];
             $val['createDate'] = date("Y-m-d", strtotime($val['createTime']));
-            $val['merchantName'] = '';
+            $val['name'] = '';
             //节日涨价
             if (!empty($rise)) {
                 $price = $val['price'];

+ 1 - 1
biz-hd/order/services/OrderService.php

@@ -59,7 +59,7 @@ class OrderService extends BaseService
 			$data['list'][$key]['goodsInfoList'] = isset($goodsList[$id]) ? $goodsList[$id] : [];
 			$data['list'][$key]['bookAvatar'] = isset($customList[$customId]['smallAvatarUrl']) ? $customList[$customId]['smallAvatarUrl'] : '';
 			$merchantId = $val['merchantId'];
-			$data['list'][$key]['merchantName'] = isset($merchantList[$merchantId]['merchantName']) ? $merchantList[$merchantId]['merchantName'] : '';
+			$data['list'][$key]['name'] = isset($merchantList[$merchantId]['name']) ? $merchantList[$merchantId]['name'] : '';
 			$data['list'][$key]['reachTime'] = OrderClass::getReachTime($val);
 			$requireReachTime = '';
 			if ($val['reachDate'] != '0000-00-00') {

+ 2 - 2
biz-hd/purchase/classes/PurchaseClass.php

@@ -147,7 +147,7 @@ class PurchaseClass extends BaseClass
             //补充供货商关系
             $ghsSjId = $purchase->ghsSjId;
             $supplierSj = MerchantClass::getMerchantById($ghsSjId);
-            $upName = $supplierSj['merchantName'] ?? '';
+            $upName = $supplierSj['name'] ?? '';
             $ghsShopId = $purchase->ghsShopId;
             $shopId = $purchase->shopId;
             $merchantId = $purchase->merchantId;
@@ -166,7 +166,7 @@ class PurchaseClass extends BaseClass
 
             //补充客户关系
             $customSj = MerchantClass::getMerchantById($merchantId);
-            $customSjName = $customSj['merchantName'] ?? '';
+            $customSjName = $customSj['name'] ?? '';
             $py = !empty($customSjName) ? stringUtil::getSpelling($customSjName) : '';
             $has = CustomClass::getByCondition(['sjId' => $ghsSjId, 'customSjId' => $merchantId, 'customShopId' => $shopId]);
             if (empty($has)) {

+ 3 - 2
biz-hd/saas/classes/ApplyClass.php

@@ -2,6 +2,7 @@
 
 namespace bizHd\saas\classes;
 
+use biz\sj\classes\SjClass;
 use bizHd\admin\classes\AdminClass;
 use bizHd\admin\classes\ShopAdminClass;
 use bizHd\agent\classes\AgentAssetClass;
@@ -76,7 +77,7 @@ class ApplyClass extends BaseClass
         $floor = $data['floor'] ?? '';
         $address = $data['address'] ?? '';
         $data['fullAddress'] = $prefix . $dist . $address . $floor;
-        $data['style'] = MerchantClass::STYLE_RETAIL;
+        $data['style'] = SjClass::STYLE_RETAIL;
         $respond = self::addApply($data);
         $mobile = $data['mobile'];
         $text = "零售商 {$mobile} 已提交资料,";
@@ -96,7 +97,7 @@ class ApplyClass extends BaseClass
         $floor = $data['floor'] ?? '';
         $address = $data['address'] ?? '';
         $data['fullAddress'] = $prefix . $dist . $address . $floor;
-        $data['style'] = MerchantClass::STYLE_SUPPLIER;
+        $data['style'] = SjClass::STYLE_SUPPLIER;
         $respond = self::addApply($data);
         $mobile = $data['mobile'];
         $text = "供货商 {$mobile} 已提交资料,";

+ 1 - 1
biz-hd/saas/classes/RenewClass.php

@@ -31,7 +31,7 @@ class RenewClass extends BaseClass
 			$merchantId = $val['merchantId'];
 			$userId = $val['userId'];
 			$setId = $val['setId'];
-			$list[$key]['merchantName'] = isset($merchant[$merchantId]['merchantName']) ? $merchant[$merchantId]['merchantName'] : '';
+			$list[$key]['name'] = isset($merchant[$merchantId]['name']) ? $merchant[$merchantId]['name'] : '';
 			$list[$key]['userName'] = isset($user[$userId]['userName']) ? $user[$userId]['userName'] : '';
 			$list[$key]['mobile'] = isset($user[$userId]['mobile']) ? $user[$userId]['mobile'] : '';
 			$list[$key]['setName'] = isset($set[$setId]['name']) ? $set[$setId]['name'] : '';

+ 7 - 6
biz-hd/saas/services/ApplyService.php

@@ -2,6 +2,7 @@
 
 namespace bizHd\saas\services;
 
+use biz\sj\classes\SjClass;
 use bizHd\admin\classes\AdminClass;
 use bizHd\base\services\BaseService;
 use bizGhs\custom\classes\CustomClass;
@@ -44,7 +45,7 @@ class ApplyService extends BaseService
             $list[$key]['licenseNo'] = $extend[$currentId]['licenseNo'] ?? '';
             $list[$key]['license'] = $extend[$currentId]['license'] ?? '';
             $introSjId = $val['introSjId'];
-            $introSjName = $sj[$introSjId]['merchantName'] ?? '';
+            $introSjName = $sj[$introSjId]['name'] ?? '';
             $list[$key]['introSjName'] = $introSjName;
             $avatar = $prefix . 'hhb_small.png';
             if (isset($val['avatar']) && !empty($val['avatar'])) {
@@ -75,7 +76,7 @@ class ApplyService extends BaseService
 
         $adminId = $apply['adminId'];
         $admin = AdminClass::getById($adminId);
-        $apply['merchantName'] = isset($apply['name']) ? $apply['name'] : '';
+        $apply['name'] = isset($apply['name']) ? $apply['name'] : '';
         $apply['adminName'] = $admin['adminName'] ?? '';
         //初始化商家信息
         $respond = MerchantService::initSjInfo($apply);
@@ -101,8 +102,8 @@ class ApplyService extends BaseService
                 $sjId = $shopAdmin['merchantId'] ?? 0;
                 $sj = MerchantClass::getMerchantById($sjId);
                 $data['introSjId'] = $sjId;
-                $data['introStyle'] = $sj['style'] ?? MerchantClass::STYLE_SUPPLIER;
-                $data['introSjName'] = $sj['merchantName'] ?? '';
+                $data['introStyle'] = $sj['style'] ?? SjClass::STYLE_SUPPLIER;
+                $data['introSjName'] = $sj['name'] ?? '';
                 $data['introShopId'] = $shopAdmin['shopId'] ?? 0;
             }
         }
@@ -162,8 +163,8 @@ class ApplyService extends BaseService
                 $sjId = $shopAdmin['merchantId'] ?? 0;
                 $sj = MerchantClass::getMerchantById($sjId);
                 $data['introSjId'] = $sjId;
-                $data['introStyle'] = $sj['style'] ?? MerchantClass::STYLE_SUPPLIER;
-                $data['introSjName'] = $sj['merchantName'] ?? '';
+                $data['introStyle'] = $sj['style'] ?? SjClass::STYLE_SUPPLIER;
+                $data['introSjName'] = $sj['name'] ?? '';
                 $data['introShopId'] = $shopAdmin['shopId'] ?? 0;
             }
         }

+ 1 - 1
biz-hd/user/classes/UserClass.php

@@ -77,7 +77,7 @@ class UserClass extends BaseClass
             $list[$key]['unReadNum'] = ChatClass::getUnreadNum($userId);
             $list[$key] = business::formatUserAvatar($list[$key]);
             $merchantId = $val['merchantId'];
-            $list[$key]['merchantName'] = isset($merchantList[$merchantId]['merchantName']) ? $merchantList[$merchantId]['merchantName'] : '';
+            $list[$key]['name'] = isset($merchantList[$merchantId]['name']) ? $merchantList[$merchantId]['name'] : '';
             //敏感信息不要输出
             if ($sensitive) {
                 unset($list[$key]['password']);

+ 1 - 1
biz-hd/wx/services/MiniUpgradeService.php

@@ -27,7 +27,7 @@ class MiniUpgradeService extends BaseService
 		
 		foreach ($list as $key => $val) {
 			$merchantId = $val['merchantId'];
-			$list[$key]['miniName'] = isset($merchant[$merchantId]['merchantName']) ? $merchant[$merchantId]['merchantName'] : '';
+			$list[$key]['miniName'] = isset($merchant[$merchantId]['name']) ? $merchant[$merchantId]['name'] : '';
 		}
 		$data['list'] = $list;
 		return $data;

+ 1 - 1
biz-mall/goods/classes/GoodsClass.php

@@ -49,7 +49,7 @@ class GoodsClass extends BaseClass
             //多款式
             $val['goodsStyleList'] = isset($val['goodsStyle']) && $val['goodsStyle'] == 1 ? GoodsStyleClass::getStyleList($id) : [];
             $val['createDate'] = date("Y-m-d", strtotime($val['createTime']));
-            $val['merchantName'] = '';
+            $val['name'] = '';
             //节日涨价
             if (!empty($rise)) {
                 $price = $val['price'];

+ 5 - 7
biz-mall/merchant/classes/MerchantClass.php

@@ -72,7 +72,7 @@ class MerchantClass extends BaseClass
         $data['precision'] = (string)0;
         $data['wxToken'] = stringUtil::buildWxToken(0);
         $data['photoList'] = isset($data['photoList']) ? $data['photoList'] : '';
-        $data['merchantName'] = isset($data['merchantName']) ? $data['merchantName'] : '';
+        $data['name'] = isset($data['name']) ? $data['name'] : '';
         $data['province'] = isset($data['province']) ? $data['province'] : '';
         $data['city'] = isset($data['city']) ? $data['city'] : '';
         $data['shopDist'] = isset($data['dist']) ? $data['dist'] : '';
@@ -113,9 +113,9 @@ class MerchantClass extends BaseClass
         $extendData = [
             'merchantId' => $merchantId,
             'wxAppId' => isset($data['wxAppId']) ? $data['wxAppId'] : '',
-            'webTitle' => isset($data['merchantName']) ? $data['merchantName'] : '',
-            'webKeyword' => isset($data['merchantName']) ? $data['merchantName'] : '',
-            'webDescription' => isset($data['merchantName']) ? $data['merchantName'] : '',
+            'webTitle' => isset($data['name']) ? $data['name'] : '',
+            'webKeyword' => isset($data['name']) ? $data['name'] : '',
+            'webDescription' => isset($data['name']) ? $data['name'] : '',
             'wxMenuInit' => 0,
             'wxTMessageInit' => 0,
             'payment' => 0,//支付功能关闭
@@ -124,8 +124,6 @@ class MerchantClass extends BaseClass
             'giveCouponPrice' => 5,//代金劵金额5元
             'couponMeetPrice' => 180,//满足金额
             'couponValidity' => 30,//代金劵有效期30天
-            'alipayAccount' => isset($data['alipayAccount']) ? $data['alipayAccount'] : '',//提现的支付宝帐号
-            'alipayAccountName' => isset($data['alipayAccountName']) ? $data['alipayAccountName'] : '',//提现支付宝帐号姓名
             'gradeList' => '1_2000_0.9I2_5000_0.88I3_10000_0.85I4_20000_0.8',//1 级会员需要满 2000 积分 购物享9折;2 级会员需要满 5000 积分 购物享88折
             'createTime' => $date,
             'updateTime' => $date,
@@ -145,7 +143,7 @@ class MerchantClass extends BaseClass
 
         //创建门店
         $shopData = [
-            'shopName' => $merchant['merchantName'],
+            'shopName' => $merchant['name'],
             'merchantId' => $merchantId,
             'addTime' => $time,
             'createTime' => $date,

+ 6 - 6
biz-mall/merchant/services/MerchantService.php

@@ -199,21 +199,21 @@ class MerchantService extends BaseService
         $env = getenv('YII_ENV');
         switch ($env) {
             case 'local':
-                $merchantName = '花美灵';
+                $name = '花美灵';
                 break;
             case 'dev':
-                $merchantName = '花美灵';
+                $name = '花美灵';
                 break;
             case 'test':
-                $merchantName = '花掌柜';
+                $name = '花掌柜';
                 break;
             case 'production':
-                $merchantName = '花卉宝';
+                $name = '花卉宝';
                 break;
             default:
-                $merchantName = '花卉宝';
+                $name = '花卉宝';
         }
-        echo $merchantName;
+        echo $name;
     }
 
     //获取商家的h5商城二维码 ssh 2020.4.30

+ 1 - 1
biz-mall/order/services/OrderService.php

@@ -52,7 +52,7 @@ class OrderService extends BaseService
             $data['list'][$key]['goodsInfoList'] = isset($goodsList[$id]) ? $goodsList[$id] : [];
             $data['list'][$key]['bookAvatar'] = isset($userInfoList[$userId]['smallAvatarUrl']) ? $userInfoList[$userId]['smallAvatarUrl'] : '';
             $merchantId = $val['merchantId'];
-            $data['list'][$key]['merchantName'] = isset($merchantList[$merchantId]['merchantName']) ? $merchantList[$merchantId]['merchantName'] : '';
+            $data['list'][$key]['name'] = isset($merchantList[$merchantId]['name']) ? $merchantList[$merchantId]['name'] : '';
             $data['list'][$key]['reachTime'] = OrderClass::getReachTime($val);
             $requireReachTime = '';
             if ($val['reachDate'] != '0000-00-00') {

+ 1 - 1
biz-mall/saas/classes/RenewClass.php

@@ -32,7 +32,7 @@ class RenewClass extends BaseClass
             $merchantId = $val['merchantId'];
             $userId = $val['userId'];
             $setId = $val['setId'];
-            $list[$key]['merchantName'] = isset($merchant[$merchantId]['merchantName']) ? $merchant[$merchantId]['merchantName'] : '';
+            $list[$key]['name'] = isset($merchant[$merchantId]['name']) ? $merchant[$merchantId]['name'] : '';
             $list[$key]['userName'] = isset($user[$userId]['userName']) ? $user[$userId]['userName'] : '';
             $list[$key]['mobile'] = isset($user[$userId]['mobile']) ? $user[$userId]['mobile'] : '';
             $list[$key]['setName'] = isset($set[$setId]['name']) ? $set[$setId]['name'] : '';

+ 2 - 2
biz-mall/saas/services/ApplyService.php

@@ -43,7 +43,7 @@ class ApplyService extends BaseService
 			$introMerchantId = $val['introMerchantId'];
 			$list[$key]['adminName'] = isset($adminList[$adminId]) ? $adminList[$adminId]['adminName'] : '';
 			$list[$key]['adminAvatar'] = isset($adminList[$adminId]['avatarUrl']) ? $adminList[$adminId]['avatarUrl'] : '';
-			$list[$key]['oldName'] = isset($merchant[$introMerchantId]['merchantName']) ? $merchant[$introMerchantId]['merchantName'] : '';
+			$list[$key]['oldName'] = isset($merchant[$introMerchantId]['name']) ? $merchant[$introMerchantId]['name'] : '';
 		}
 		$data['list'] = $list;
 		return $data;
@@ -56,7 +56,7 @@ class ApplyService extends BaseService
 		if (empty($apply)) {
 			util::fail('没有找到申请记录');
 		}
-		$apply['merchantName'] = isset($apply['name']) ? $apply['name'] : '';
+		$apply['name'] = isset($apply['name']) ? $apply['name'] : '';
 		$adminId = $apply['adminId'];
 		$admin = AdminClass::getById($adminId);
 		$apply['adminName'] = isset($admin['adminName']) ? $admin['adminName'] : '';

+ 1 - 1
biz-mall/user/classes/UserClass.php

@@ -72,7 +72,7 @@ class UserClass extends BaseClass
             //客户发来新消息数
             $list[$key]['unReadNum'] = ChatClass::getUnreadNum($userId);
             $list[$key] = business::formatUserAvatar($list[$key]);
-            $list[$key]['merchantName'] = '';
+            $list[$key]['name'] = '';
             //敏感信息不要输出
             if ($sensitive) {
                 unset($list[$key]['password']);

+ 1 - 1
biz-mall/wx/services/MiniUpgradeService.php

@@ -27,7 +27,7 @@ class MiniUpgradeService extends BaseService
 		
 		foreach ($list as $key => $val) {
 			$merchantId = $val['merchantId'];
-			$list[$key]['miniName'] = isset($merchant[$merchantId]['merchantName']) ? $merchant[$merchantId]['merchantName'] : '';
+			$list[$key]['miniName'] = isset($merchant[$merchantId]['name']) ? $merchant[$merchantId]['name'] : '';
 		}
 		$data['list'] = $list;
 		return $data;

+ 98 - 102
biz/sj/classes/MerchantClass.php

@@ -14,106 +14,102 @@ use bizHd\base\classes\BaseClass;
 
 class MerchantClass extends BaseClass
 {
-	
-	public static $baseFile = '\biz\sj\models\Merchant';
-	
-	//常用链接
-	public static $commonUrl = [
-		1 => ['id' => 1, 'url' => '/mall/index?account=12358', 'img' => 'http://a.huahb.com/images/avatar.jpg', 'sign' => 'mall', 'name' => '商城'],
-		2 => ['id' => 2, 'url' => '/mall/index?account=12358', 'img' => 'http://a.huahb.com/images/avatar.jpg', 'sign' => 'mall', 'name' => '申请会员'],
-		3 => ['id' => 3, 'url' => '/mall/index?account=12358', 'img' => 'http://a.huahb.com/images/avatar.jpg', 'sign' => 'mall', 'name' => '点我付款'],
-	];
-
-	//零售店
-	const STYLE_RETAIL = 1;
-	//供货商
-	const STYLE_SUPPLIER = 2;
-
-	//状态
-	const STATUS_UN_CHECK = 0;
-	const STATUS_HAS_CHECK = 1;
-	const STATUS_CHECK_NOT_PASS = 2;
-	const STATUS_FREEZE = 3;
-	const STATUS_EXPIRE = 4;
-
-	//开店初始化更多信息,有提供营业执照才初始化的信息 ssh 2021.2.27
-	public static function initMore($applyData, $sjId, $shopId)
-	{
-		if ($applyData['style'] == MerchantClass::STYLE_RETAIL) {
-			self::initRetailMore($applyData, $sjId, $shopId);
-		}
-		if ($applyData['style'] == MerchantClass::STYLE_SUPPLIER) {
-			self::initGhsMore($applyData, $sjId, $shopId);
-		}
-	}
-	
-	public static function initRetailMore($applyData, $sjId, $shopId)
-	{
-		//初始化员工和角色
-		AdminClass::initAdmin($applyData, $sjId, $shopId);
-		//商品和分类初始化
-		CategoryClass::initCategoryGoods($sjId);
-		//商城和门店广告初始化
-		AdClass::initAdd($sjId);
-		//优惠券资产与配置信息初始化
-		CouponAssetClass::add(['merchantId' => $sjId, 'switch' => 1]);
-	}
-	
-	public static function initGhsMore($applyData, $sjId, $shopId)
-	{
-		//初始化员工和角色
-		\bizGhs\admin\classes\AdminClass::initAdmin($applyData, $sjId, $shopId);
-	}
-	
-	//商家信息组合 ssh 2019.12.20
-	public static function groupMerchantBaseInfo($list)
-	{
-		return $list;
-	}
-
-	public static function getMerchantByIds($ids)
-	{
-		$list = self::getAllByCondition(['id' => ['in', $ids]], null, '*', 'id');
-		return self::groupBaseInfo($list);
-	}
-
-	public static function getMerchantById($id)
-	{
-		$sj = self::getById($id);
-		if (empty($sj)) {
-			return $sj;
-		}
-		$list = self::groupBaseInfo([$sj]);
-		return current($list);
-	}
-
-	//组合商家信息 ssh 2021.3.1
-	public static function groupBaseInfo($list)
-	{
-		if (empty($list)) {
-			return $list;
-		}
-		foreach ($list as $key => $val) {
-			$list[$key] = business::formatMerchantLogo($list[$key]);
-			$list[$key]['address'] = '厦门市思明区后埭溪路128号-5';
-		}
-		return $list;
-	}
-	
-	//h5商城链接二维码 ssh 2020.4.30
-	public static function getH5MallQrCode($id)
-	{
-		$url = Yii::$app->params['mallDomain'] . "/#/?account=" . $id;
-		//强制转成https
-		$url = httpUtil::becomeHttps($url);
-		$respond = qrCodeUtil::generateH5MallQrCode($url);
-		return isset($respond['url']) ? $respond['url'] : '';
-	}
-	
-	public static function getDefaultShopId($sj)
-	{
-		$defaultShopId = isset($sj['defaultShopId']) ? $sj['defaultShopId'] : 0;
-		return $defaultShopId;
-	}
-	
+
+    public static $baseFile = '\biz\sj\models\Merchant';
+
+    //常用链接
+    public static $commonUrl = [
+        1 => ['id' => 1, 'url' => '/mall/index?account=12358', 'img' => 'http://a.huahb.com/images/avatar.jpg', 'sign' => 'mall', 'name' => '商城'],
+        2 => ['id' => 2, 'url' => '/mall/index?account=12358', 'img' => 'http://a.huahb.com/images/avatar.jpg', 'sign' => 'mall', 'name' => '申请会员'],
+        3 => ['id' => 3, 'url' => '/mall/index?account=12358', 'img' => 'http://a.huahb.com/images/avatar.jpg', 'sign' => 'mall', 'name' => '点我付款'],
+    ];
+
+
+    //状态
+    const STATUS_UN_CHECK = 0;
+    const STATUS_HAS_CHECK = 1;
+    const STATUS_CHECK_NOT_PASS = 2;
+    const STATUS_FREEZE = 3;
+    const STATUS_EXPIRE = 4;
+
+    //开店初始化更多信息,有提供营业执照才初始化的信息 ssh 2021.2.27
+    public static function initMore($applyData, $sjId, $shopId)
+    {
+        if ($applyData['style'] == SjClass::STYLE_RETAIL) {
+            self::initRetailMore($applyData, $sjId, $shopId);
+        }
+        if ($applyData['style'] == SjClass::STYLE_SUPPLIER) {
+            self::initGhsMore($applyData, $sjId, $shopId);
+        }
+    }
+
+    public static function initRetailMore($applyData, $sjId, $shopId)
+    {
+        //初始化员工和角色
+        AdminClass::initAdmin($applyData, $sjId, $shopId);
+        //商品和分类初始化
+        CategoryClass::initCategoryGoods($sjId);
+        //商城和门店广告初始化
+        AdClass::initAdd($sjId);
+        //优惠券资产与配置信息初始化
+        CouponAssetClass::add(['merchantId' => $sjId, 'switch' => 1]);
+    }
+
+    public static function initGhsMore($applyData, $sjId, $shopId)
+    {
+        //初始化员工和角色
+        \bizGhs\admin\classes\AdminClass::initAdmin($applyData, $sjId, $shopId);
+    }
+
+    //商家信息组合 ssh 2019.12.20
+    public static function groupMerchantBaseInfo($list)
+    {
+        return $list;
+    }
+
+    public static function getMerchantByIds($ids)
+    {
+        $list = self::getAllByCondition(['id' => ['in', $ids]], null, '*', 'id');
+        return self::groupBaseInfo($list);
+    }
+
+    public static function getMerchantById($id)
+    {
+        $sj = self::getById($id);
+        if (empty($sj)) {
+            return $sj;
+        }
+        $list = self::groupBaseInfo([$sj]);
+        return current($list);
+    }
+
+    //组合商家信息 ssh 2021.3.1
+    public static function groupBaseInfo($list)
+    {
+        if (empty($list)) {
+            return $list;
+        }
+        foreach ($list as $key => $val) {
+            $list[$key] = business::formatMerchantLogo($list[$key]);
+            $list[$key]['address'] = '厦门市思明区后埭溪路128号-5';
+        }
+        return $list;
+    }
+
+    //h5商城链接二维码 ssh 2020.4.30
+    public static function getH5MallQrCode($id)
+    {
+        $url = Yii::$app->params['mallDomain'] . "/#/?account=" . $id;
+        //强制转成https
+        $url = httpUtil::becomeHttps($url);
+        $respond = qrCodeUtil::generateH5MallQrCode($url);
+        return isset($respond['url']) ? $respond['url'] : '';
+    }
+
+    public static function getDefaultShopId($sj)
+    {
+        $defaultShopId = isset($sj['defaultShopId']) ? $sj['defaultShopId'] : 0;
+        return $defaultShopId;
+    }
+
 }

+ 20 - 0
biz/sj/classes/SjClass.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace biz\sj\classes;
+
+use Yii;
+use bizHd\base\classes\BaseClass;
+
+class SjClass extends BaseClass
+{
+
+	public static $baseFile = '\biz\sj\models\Sj';
+
+    //零售店
+    const STYLE_RETAIL = 1;
+    //供货商
+    const STYLE_SUPPLIER = 2;
+    //昆明供货商
+    const STYLE_KM_SUPPLIER = 3;
+
+}

+ 13 - 0
biz/sj/models/Sj.php

@@ -0,0 +1,13 @@
+<?php
+namespace biz\sj\models;
+use biz\base\models\Base;
+
+class Sj extends Base
+{
+
+	public static function tableName()
+	{
+		return 'xhSj';
+	}
+
+}

+ 12 - 10
biz/sj/services/MerchantService.php

@@ -34,7 +34,7 @@ class MerchantService extends BaseService
     //补充营业执照后变更商家信息 ssh 2021.2.28
     public static function certChangeSjInfo($applyData)
     {
-        if ($applyData['style'] != MerchantClass::STYLE_RETAIL) {
+        if ($applyData['style'] != SjClass::STYLE_RETAIL) {
             return false;
         }
         $applyId = $applyData['id'] ?? 0;
@@ -54,7 +54,7 @@ class MerchantService extends BaseService
     //初始化商家信息 ssh 2020.2.11
     public static function initSjInfo($applyData)
     {
-        $applyId = $applyData['id'];
+        $applyId = $applyData['id'] ?? 0;
         unset($applyData['id']);
 
         //生成商家
@@ -65,7 +65,7 @@ class MerchantService extends BaseService
         $applyData['precision'] = (string)0;
         $applyData['wxToken'] = stringUtil::buildWxToken(0);
         $applyData['photoList'] = $applyData['photoList'] ?? '';
-        $applyData['merchantName'] = $applyData['merchantName'] ?? '';
+        $applyData['name'] = $applyData['name'] ?? '';
         $applyData['province'] = $applyData['province'] ?? '';
         $applyData['city'] = $applyData['city'] ?? '';
         $applyData['dist'] = $applyData['dist'] ?? '';
@@ -73,11 +73,13 @@ class MerchantService extends BaseService
         $applyData['agentLevel'] = 1;
         $applyData['parentId'] = $applyData['introSjId'] ?? 0;
         $sj = self::add($applyData);
-
         $sjId = $sj['id'];
         $mobile = $applyData['mobile'];
 
-        ApplyClass::updateById($applyId, ['sjId' => $sjId]);
+        if (!empty($applyId)) {
+            ApplyClass::updateById($applyId, ['sjId' => $sjId]);
+        }
+
 
         //生成资产
         $assetData = [
@@ -102,9 +104,9 @@ class MerchantService extends BaseService
         $extendData = [
             'merchantId' => $sjId,
             'wxAppId' => isset($applyData['wxAppId']) ? $applyData['wxAppId'] : '',
-            'webTitle' => isset($applyData['merchantName']) ? $applyData['merchantName'] : '',
-            'webKeyword' => isset($applyData['merchantName']) ? $applyData['merchantName'] : '',
-            'webDescription' => isset($applyData['merchantName']) ? $applyData['merchantName'] : '',
+            'webTitle' => isset($applyData['name']) ? $applyData['name'] : '',
+            'webKeyword' => isset($applyData['name']) ? $applyData['name'] : '',
+            'webDescription' => isset($applyData['name']) ? $applyData['name'] : '',
             'wxMenuInit' => 0,
             'wxTMessageInit' => 0,
             'payment' => 0,//支付功能关闭
@@ -131,7 +133,7 @@ class MerchantService extends BaseService
 
         //创建门店
         $shopData = [
-            'shopName' => $sj['merchantName'],
+            'shopName' => $sj['name'],
             'merchantId' => $sjId,
             'openTime' => '8:00 - 23:00',
             'telephone' => $mobile,
@@ -239,7 +241,7 @@ class MerchantService extends BaseService
     //商家列表 ssh 2019.12.20
     public static function getMerchantList($where)
     {
-        $data = MerchantClass::getList(['id', 'merchantName'], $where, 'addTime DESC');
+        $data = MerchantClass::getList(['id', 'name'], $where, 'addTime DESC');
         $list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
         if (empty($list)) {
             return $data;

+ 34 - 0
biz/sj/services/SjService.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace biz\sj\services;
+
+use bizHd\agent\classes\AgentAssetClass;
+use bizHd\auth\services\AuthService;
+use bizHd\goods\classes\GoodsSettingClass;
+use bizHd\saas\classes\ApplyClass;
+use bizGhs\custom\classes\CustomClass;
+use biz\base\services\BaseService;
+use biz\sj\classes\MerchantAssetClass;
+use biz\sj\classes\MerchantClass;
+use biz\sj\classes\MerchantExtendClass;
+use bizHd\merchant\classes\ShopClass;
+use bizHd\message\services\TMessageService;
+use bizHd\saas\services\SetAuthService;
+use bizHd\saas\services\SetMealService;
+use bizHd\user\services\UserService;
+use bizHd\wx\classes\WxOpenClass;
+use bizHd\wx\services\WxMenuService;
+use biz\sj\classes\MerchantInitClass;
+use common\components\business;
+use common\components\stringUtil;
+use common\components\util;
+use common\services\xhTMessageService;
+use common\services\xhWxMenuService;
+use Yii;
+
+class SjService extends BaseService
+{
+
+    public static $baseFile = '\biz\sj\classes\SjClass';
+
+}

+ 2 - 2
common/components/miniUtil.php

@@ -1378,7 +1378,7 @@ class miniUtil
             $imgUrl = str_replace('http', 'https', $imgUrl);
         }
         $account = isset($merchant['id']) ? $merchant['id'] : 0;
-        $name = isset($merchant['merchantName']) ? $merchant['merchantName'] : '';
+        $name = isset($merchant['name']) ? $merchant['name'] : '';
         $open = [];
         if ($isOpen == 1) {
             $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => \biz\wx\classes\WxOpenClass::OPEN_STYLE_HD]);
@@ -1399,7 +1399,7 @@ class miniUtil
                 'account' => $account,
                 'apiHost' => $apiUrl,
                 'imgHost' => $imgUrl,
-                'merchantName' => $name,
+                'name' => $name,
             ],
         ];
         echo '<pre>';

+ 2 - 2
common/components/rabbitmq/consumer/openShopInitConsumer.php

@@ -27,9 +27,9 @@ class openShopInitConsumer implements ConsumerInterface
 		if ($return == false) {
 			//没有初始化成功短信通知管理员
 			$merchant = MerchantService::getMerchantById($merchantId);
-			$merchantName = $merchant['merchantName'];
+			$name = $merchant['name'];
 			$adminMobile = WxOpenService::getAdminMobile();
-			sms::freeSend($adminMobile, "花店:{$merchantName}({$merchantId})初始化没有成功。", $merchant);
+			sms::freeSend($adminMobile, "花店:{$name}({$merchantId})初始化没有成功。", $merchant);
 		}
 		return ConsumerInterface::MSG_ACK;
 	}

+ 3 - 3
common/components/sms.php

@@ -42,7 +42,7 @@ class sms
 		$asset = MerchantAssetService::getByMerchantId($merchantId, true);
 		$remainSmsNum = $asset->remainSmsNum;
 		if ($remainSmsNum <= 0) {
-			Yii::info($merchant['merchantName'] . '短信余额不足');
+			Yii::info($merchant['name'] . '短信余额不足');
 			return false;
 		}
 		$asset->remainSmsNum = --$remainSmsNum;
@@ -56,7 +56,7 @@ class sms
 		$open = WxOpenService::getById(1);
 		$name = isset($open['name']) ? $open['name'] : '花卉宝';
 		$sms = new chuanglanSMS(self::ACCOUNT, self::PASSWORD);
-		$sign = isset($merchant) == true ? "【{$merchant['merchantName']}】" : "【{$name}】";
+		$sign = isset($merchant) == true ? "【{$merchant['name']}】" : "【{$name}】";
 		$msg .= $sign;
 		$sms->send($mobile, $msg);
 	}
@@ -79,7 +79,7 @@ class sms
 		}
 		$name = isset($open['name']) ? $open['name'] : '花卉宝';
 		$sms = new chuanglanSMS(self::ACCOUNT, self::PASSWORD);
-		$sign = isset($merchant) == true ? "【{$merchant['merchantName']}】" : "【{$name}】";
+		$sign = isset($merchant) == true ? "【{$merchant['name']}】" : "【{$name}】";
 		$msg .= $sign;
 		
 		//验证是否有权限发短信

+ 2 - 2
common/components/wxUtil.php

@@ -1407,7 +1407,7 @@ class wxUtil
             $imgUrl = str_replace('http', 'https', $imgUrl);
         }
         $account = isset($merchant['id']) ? $merchant['id'] : 0;
-        $name = isset($merchant['merchantName']) ? $merchant['merchantName'] : '';
+        $name = isset($merchant['name']) ? $merchant['name'] : '';
         if ($isOpen == 1) {
             $wxBaseId = isset($open['wxBaseId']) ? $open['wxBaseId'] : 0;
             $wxBase = WxBaseClass::getById($wxBaseId);
@@ -1427,7 +1427,7 @@ class wxUtil
                 'account' => $account,
                 'apiHost' => $apiUrl,
                 'imgHost' => $imgUrl,
-                'merchantName' => $name,
+                'name' => $name,
             ],
         ];
         echo '<pre>';

+ 1 - 1
common/services/xhCommonService.php

@@ -22,7 +22,7 @@ class xhCommonService
 		}
 		$name = $open['name'];
 		$sms = new chuanglanSMS('N2890342', 'abc178c7');
-		$sign = isset($merchant) == true ? "【{$merchant['merchantName']}】" : "【{$name}】";
+		$sign = isset($merchant) == true ? "【{$merchant['name']}】" : "【{$name}】";
 		$msg .= $sign;
 		$result = $sms->send($mobile, $msg);
 	}

+ 2 - 2
common/services/xhMerchantService.php

@@ -215,9 +215,9 @@ class xhMerchantService
 		return ['small' => $pre . '_50.' . $extend, 'medium' => $pre . '_200.' . $extend, 'large' => $largeImg];
 	}
 	
-	public static function getByMerchantName($name)
+	public static function getByName($name)
 	{
-		$merchant = xhMerchant::getByCondition(['merchantName' => $name]);
+		$merchant = xhMerchant::getByCondition(['name' => $name]);
 		return $merchant;
 	}
 	

+ 2 - 2
common/services/xhShopService.php

@@ -220,7 +220,7 @@ class xhShopService {
 
         $now = time();
         $data = [];
-        $data['businessName']	= $mcInfo['merchantName'];
+        $data['businessName']	= $mcInfo['name'];
         $data['branchName']		= $branchName;
         $data['merchantId']		= $mcInfo['id'];
         $data['poiId']			= '';
@@ -298,7 +298,7 @@ class xhShopService {
         $info = ["business" =>[
             "base_info" => [
                 //"sid" => '123456',//非必须参数
-                "business_name" => $mcInfo['merchantName'],//门店名称
+                "business_name" => $mcInfo['name'],//门店名称
                 "branch_name" => $branchName,
                 "province" => $mcInfo['province'], //"不超过10个字",
                 "city" => $mcInfo['city'],//"不超过30个字",

+ 2 - 2
console/controllers/OpenShopInitController.php

@@ -25,9 +25,9 @@ class OpenShopInitController extends Controller
         if ($return == false) {
             //没有初始化成功短信通知管理员
             $merchant = MerchantService::getMerchantById($id);
-            $merchantName = $merchant['merchantName'];
+            $name = $merchant['name'];
             $adminMobile = WxOpenService::getAdminMobile();
-            sms::freeSend($adminMobile, "花店:{$merchantName}({$id})初始化没有成功。", $merchant);
+            sms::freeSend($adminMobile, "花店:{$name}({$id})初始化没有成功。", $merchant);
         }
     }
 

+ 2 - 2
console/controllers/ShellController.php

@@ -29,10 +29,10 @@ class ShellController extends Controller
 				foreach ($merchantList as $merchant) {
 					$merchant = $merchant->toArray();
 					$merchantId = $merchant['id'];
-					$merchantName = $merchant['merchantName'];
+					$name = $merchant['name'];
 					$visitData = StatVisitService::saveYesterdayNum($merchantId);//访问量
 					if (!empty($visitData)) {
-						$log = "商家:{$merchantName}({$merchantId}):";
+						$log = "商家:{$name}({$merchantId}):";
 						$time = date("Y-m-d", $visitData['time']);
 						$log .= "访问量:date:{$time} num:{$visitData['riseNum']}\r\n";
 						stringUtil::log($log, '/opt/shell/log/merchant_visit_log_' . date("Ymd") . '.txt');

+ 2 - 1
console/controllers/SjInitController.php

@@ -2,6 +2,7 @@
 
 namespace console\controllers;
 
+use biz\sj\classes\SjClass;
 use bizHd\saas\classes\ApplyClass;
 use bizHd\saas\services\ApplyService;
 use biz\sj\classes\MerchantClass;
@@ -41,7 +42,7 @@ class SjInitController extends Controller
         foreach ($data as $key => $val) {
             $val['from'] = ApplyClass::FROM_GHS;
             $val['introSjId'] = $sjId;
-            $val['introStyle'] = MerchantClass::STYLE_SUPPLIER;
+            $val['introStyle'] = SjClass::STYLE_SUPPLIER;
             $val['name'] = $val['sjName'];
             $val['fullAddress'] = $val['address'];
             $val['nickName'] = $val['adminName'];

+ 6 - 6
console/controllers/UpgradeController.php

@@ -185,7 +185,7 @@ UPDATE xhUserAsset SET `discount`=1;
 ALTER TABLE xhUserAsset MODIFY discount FLOAT(3,2) NOT NULL DEFAULT 1.00 COMMENT '折扣';
 ALTER TABLE xhCoupon CHANGE `meetAmount` `miniCost` INT NOT NULL DEFAULT 0 COMMENT '最低消费金额,0表示任何情况下可用';
 ALTER TABLE xhShop CHANGE `businessName` `shopName` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '门店名称';
-ALTER TABLE xhShop CHANGE `branchName` `merchantName` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '商家名称';
+ALTER TABLE xhShop CHANGE `branchName` `name` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '商家名称';
 ALTER TABLE xhShop DROP COLUMN `poiId`;
 ALTER TABLE xhMerchantExtend ADD `freight` CHAR(10) NOT NULL DEFAULT '5_2' COMMENT '运费计算方式 5公里内免运费,超过每增加一公里+2' AFTER `alipayAccountName`;
 ALTER TABLE xhMerchantExtend DROP COLUMN `giveCoupon`;
@@ -1028,7 +1028,7 @@ ALTER TABLE `xhApply` CHANGE `longitude` `long` VARCHAR(20) NOT NULL DEFAULT ''
 ALTER TABLE `xhApply` CHANGE `latitude` `lat` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '纬度';";
 		Yii::$app->db->createCommand($sql)->execute();
 		
-		$sql = "ALTER TABLE `xhMerchant` DROP INDEX `merchantName`;";
+		$sql = "ALTER TABLE `xhMerchant` DROP INDEX `name`;";
 		Yii::$app->db->createCommand($sql)->execute();
 		
 		$sql = "ALTER TABLE `xhAd` MODIFY `endTime` BIGINT NOT NULL DEFAULT 0 COMMENT '结束时间;值4102416000(2100-01-01 00:00:00)表示永不过期情况';
@@ -1091,14 +1091,14 @@ ALTER TABLE `xhMerchantExtend` ADD openAppBind TINYINT NOT NULL DEFAULT 0 COMMEN
 		
 		//花美灵开放平台的公众号和第一个公众号
 		if ($env == 'dev') {
-			$sql = "update xhMerchant set merchantName='花美灵' where id=12359;update xhShop set shopName='花美灵',merchantName='花美灵',`status`=1 where merchantId=12359;
-update xhMerchant set merchantName='中花卉' where id=12358;update xhShop set shopName='中花卉',merchantName='中花卉' where merchantId=12358;";
+			$sql = "update xhMerchant set name='花美灵' where id=12359;update xhShop set shopName='花美灵',name='花美灵',`status`=1 where merchantId=12359;
+update xhMerchant set name='中花卉' where id=12358;update xhShop set shopName='中花卉',name='中花卉' where merchantId=12358;";
 			Yii::$app->db->createCommand($sql)->execute();
 		}
 		//花掌柜开放平台的公众号和第一个公众号
 		if ($env == 'test') {
-			$sql = "update xhMerchant set merchantName='花掌柜' where id=12359;update xhShop set shopName='花掌柜',merchantName='花掌柜',`status`=1 where merchantId=12359;
-update xhMerchant set merchantName='花店宝' where id=12358;update xhShop set shopName='花店宝',merchantName='花店宝' where merchantId=12358;";
+			$sql = "update xhMerchant set name='花掌柜' where id=12359;update xhShop set shopName='花掌柜',name='花掌柜',`status`=1 where merchantId=12359;
+update xhMerchant set name='花店宝' where id=12358;update xhShop set shopName='花店宝',name='花店宝' where merchantId=12358;";
 			Yii::$app->db->createCommand($sql)->execute();
 		}
 		

+ 4 - 1
sql.sql

@@ -1886,4 +1886,7 @@ ALTER TABLE `xhSj` CHANGE  `shopLat` `lat` VARCHAR(20) NOT NULL DEFAULT '' COMME
 ALTER TABLE `xhSj` CHANGE  `shopLong` `long` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '商店的经度';
 ALTER TABLE `xhSj` CHANGE  `shopPrecision` `precision` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '商店的精度';
 ALTER TABLE `xhSj` CHANGE  `shopPhotoList` `photoList` VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '店面门牌照片 json';
-ALTER TABLE `xhSj` ADD fullAddress VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '完整地址' AFTER `address`;
+ALTER TABLE `xhSj` ADD fullAddress VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '完整地址' AFTER `address`;
+ALTER TABLE `xhSj` DROP COLUMN `property`;
+ALTER TABLE `xhSj` MODIFY `style` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '商家类型 1花店 2供货商 3昆明供货商';
+ALTER TABLE `xhSj` CHANGE `merchantName` `name` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '商家名称';