Browse Source

merchantId 改成 sjId 表达
merchant 改成 sj 表达

shish 5 years ago
parent
commit
62e7f52922
92 changed files with 446 additions and 446 deletions
  1. 7 7
      app/ghs/controllers/AdController.php
  2. 4 4
      app/ghs/controllers/AdminController.php
  3. 1 1
      app/ghs/controllers/AdminLogController.php
  4. 2 2
      app/ghs/controllers/AdminRoleAuthController.php
  5. 4 4
      app/ghs/controllers/AdminRoleController.php
  6. 2 2
      app/ghs/controllers/AgentAssetController.php
  7. 1 1
      app/ghs/controllers/ApplyController.php
  8. 11 11
      app/ghs/controllers/BaseController.php
  9. 9 9
      app/ghs/controllers/CategoryController.php
  10. 12 12
      app/ghs/controllers/ChatController.php
  11. 4 4
      app/ghs/controllers/CheckOrderController.php
  12. 5 5
      app/ghs/controllers/ConsoleController.php
  13. 2 2
      app/ghs/controllers/CouponAssetController.php
  14. 2 2
      app/ghs/controllers/CouponController.php
  15. 4 4
      app/ghs/controllers/CustomController.php
  16. 15 15
      app/ghs/controllers/GoodsController.php
  17. 2 2
      app/ghs/controllers/InviteAssetController.php
  18. 3 3
      app/ghs/controllers/InviteController.php
  19. 4 4
      app/ghs/controllers/ItemClassController.php
  20. 3 3
      app/ghs/controllers/ItemController.php
  21. 2 2
      app/ghs/controllers/MainController.php
  22. 1 1
      app/ghs/controllers/MerchantCapitalController.php
  23. 8 8
      app/ghs/controllers/MerchantController.php
  24. 3 3
      app/ghs/controllers/MerchantRemarkController.php
  25. 6 6
      app/ghs/controllers/OrderController.php
  26. 4 4
      app/ghs/controllers/OrderSendController.php
  27. 9 9
      app/ghs/controllers/PicController.php
  28. 4 4
      app/ghs/controllers/ProductController.php
  29. 2 2
      app/ghs/controllers/PurchaseOrderController.php
  30. 1 1
      app/ghs/controllers/RenewController.php
  31. 7 7
      app/ghs/controllers/ShopAdminController.php
  32. 13 13
      app/ghs/controllers/ShopController.php
  33. 1 1
      app/ghs/controllers/StockOutController.php
  34. 1 1
      app/ghs/controllers/SupplierController.php
  35. 3 3
      app/ghs/controllers/UploadController.php
  36. 16 16
      app/ghs/controllers/UserController.php
  37. 10 10
      app/ghs/controllers/WxMenuController.php
  38. 1 1
      app/ghs/controllers/WxShareController.php
  39. 7 7
      app/shop/controllers/AdController.php
  40. 5 5
      app/shop/controllers/AdminController.php
  41. 1 1
      app/shop/controllers/AdminLogController.php
  42. 2 2
      app/shop/controllers/AdminRoleAuthController.php
  43. 4 4
      app/shop/controllers/AdminRoleController.php
  44. 2 2
      app/shop/controllers/AgentAssetController.php
  45. 3 3
      app/shop/controllers/ApplyController.php
  46. 10 10
      app/shop/controllers/BaseController.php
  47. 9 9
      app/shop/controllers/CategoryController.php
  48. 12 12
      app/shop/controllers/ChatController.php
  49. 8 8
      app/shop/controllers/ConsoleController.php
  50. 2 2
      app/shop/controllers/CouponAssetController.php
  51. 2 2
      app/shop/controllers/CouponController.php
  52. 15 15
      app/shop/controllers/GoodsController.php
  53. 2 2
      app/shop/controllers/InviteAssetController.php
  54. 3 3
      app/shop/controllers/InviteController.php
  55. 2 2
      app/shop/controllers/MainController.php
  56. 2 2
      app/shop/controllers/MallAuthController.php
  57. 3 3
      app/shop/controllers/MallBaseController.php
  58. 3 3
      app/shop/controllers/MallCategoryController.php
  59. 6 6
      app/shop/controllers/MallChatController.php
  60. 2 2
      app/shop/controllers/MallExpressController.php
  61. 2 2
      app/shop/controllers/MallGoodsController.php
  62. 1 1
      app/shop/controllers/MallInformUserController.php
  63. 1 1
      app/shop/controllers/MallInviteController.php
  64. 2 2
      app/shop/controllers/MallMainController.php
  65. 3 3
      app/shop/controllers/MallMerchantController.php
  66. 15 15
      app/shop/controllers/MallOrderController.php
  67. 15 15
      app/shop/controllers/MallPayController.php
  68. 2 2
      app/shop/controllers/MallPaymentController.php
  69. 2 2
      app/shop/controllers/MallPublicController.php
  70. 3 3
      app/shop/controllers/MallRechargeController.php
  71. 2 2
      app/shop/controllers/MallShopController.php
  72. 7 7
      app/shop/controllers/MallUserController.php
  73. 1 1
      app/shop/controllers/MallWxShareController.php
  74. 1 1
      app/shop/controllers/MerchantCapitalController.php
  75. 8 8
      app/shop/controllers/MerchantController.php
  76. 3 3
      app/shop/controllers/MerchantRemarkController.php
  77. 12 12
      app/shop/controllers/OrderController.php
  78. 5 5
      app/shop/controllers/OrderSendController.php
  79. 9 9
      app/shop/controllers/PicController.php
  80. 1 1
      app/shop/controllers/PurchaseClearController.php
  81. 2 2
      app/shop/controllers/PurchaseController.php
  82. 1 1
      app/shop/controllers/RenewController.php
  83. 1 1
      app/shop/controllers/ShopAdminController.php
  84. 13 13
      app/shop/controllers/ShopController.php
  85. 2 2
      app/shop/controllers/SupplierController.php
  86. 3 3
      app/shop/controllers/UploadController.php
  87. 16 16
      app/shop/controllers/UserController.php
  88. 10 10
      app/shop/controllers/WxMenuController.php
  89. 1 1
      app/shop/controllers/WxShareController.php
  90. 4 4
      biz/saas/classes/ApplyClass.php
  91. 3 3
      biz/saas/services/ApplyService.php
  92. 1 1
      common/components/util.php

+ 7 - 7
app/ghs/controllers/AdController.php

@@ -17,7 +17,7 @@ class AdController extends BaseController
 		$get = Yii::$app->request->get();
 		$type = isset($get['type']) ? $get['type'] : 0;
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		$where['type'] = $type;
 		$where['delStatus'] = 0;
 		$list = AdService::getAdList($where);
@@ -28,7 +28,7 @@ class AdController extends BaseController
 	public function actionAdd()
 	{
 		$post = Yii::$app->request->post();
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		$ad = AdService::addAd($post);
 		$id = $ad['id'];
 		$info = AdService::getDetail($id);
@@ -58,7 +58,7 @@ class AdController extends BaseController
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$info = AdService::getById($id);
-		AdService::valid($info, $this->merchantId);
+		AdService::valid($info, $this->sjId);
 		AdService::clickAd($id);
 		util::complete();
 	}
@@ -69,7 +69,7 @@ class AdController extends BaseController
 		$post = Yii::$app->request->post();
 		$id = isset($post['id']) ? $post['id'] : 0;
 		$info = AdService::getById($id);
-		AdService::valid($info, $this->merchantId);
+		AdService::valid($info, $this->sjId);
 		AdService::updateAd($id, $post);
 		util::complete('修改成功');
 	}
@@ -79,7 +79,7 @@ class AdController extends BaseController
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$info = AdService::getById($id);
-		AdService::valid($info, $this->merchantId);
+		AdService::valid($info, $this->sjId);
 		AdService::deleteAd($id);
 		util::complete('删除成功');
 	}
@@ -90,7 +90,7 @@ class AdController extends BaseController
 		$id = Yii::$app->request->get('id', 0);
 		$status = Yii::$app->request->get('status', 1);
 		$info = AdService::getById($id);
-		AdService::valid($info, $this->merchantId);
+		AdService::valid($info, $this->sjId);
 		AdService::updateById($id, ['status' => $status]);
 		util::complete('操作成功');
 	}
@@ -109,7 +109,7 @@ class AdController extends BaseController
 		$id = Yii::$app->request->get('id', 0);
 		$inTurn = Yii::$app->request->get('inTurn', 0);
 		$info = AdService::getById($id);
-		AdService::valid($info, $this->merchantId);
+		AdService::valid($info, $this->sjId);
 		AdService::updateById($id, ['inTurn' => $inTurn]);
 		util::complete('操作成功');
 	}

+ 4 - 4
app/ghs/controllers/AdminController.php

@@ -19,7 +19,7 @@ class AdminController extends BaseController
 	//获取登陆员工的权限 shish 2019.11.24
 	public function actionLoginAuth()
 	{
-		$auth = AdminService::getAuth($this->adminId, $this->merchantId);
+		$auth = AdminService::getAuth($this->adminId, $this->sjId);
 		util::success($auth);
 	}
 	
@@ -27,7 +27,7 @@ class AdminController extends BaseController
 	public function actionAdd()
 	{
 		$post = Yii::$app->request->post();
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		$admin = AdminService::addAdmin($post);
 		$id = $admin['id'];
 		$info = AdminService::getDetail($id);
@@ -40,7 +40,7 @@ class AdminController extends BaseController
 		Yii::$app->end();
 		$id = Yii::$app->request->post('id');
 		$admin = AdminClass::getById($id);
-		AdminService::valid($admin, $this->merchantId);
+		AdminService::valid($admin, $this->sjId);
 		AdminService::deleteAdmin($admin, $this->adminId);
 		util::complete();
 	}
@@ -50,7 +50,7 @@ class AdminController extends BaseController
 	{
 		$id = Yii::$app->request->get('id');
 		$admin = AdminService::getDetail($id);
-		AdminService::valid($admin, $this->merchantId);
+		AdminService::valid($admin, $this->sjId);
 		util::success($admin);
 	}
 	

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

@@ -18,7 +18,7 @@ class AdminLogController extends BaseController
 		$startTime = isset($get['startTime']) ? $get['startTime'] : '';
 		$endTime = isset($get['endTime']) ? $get['endTime'] : '';
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		if ($adminId != -1) {
 			$where['adminId'] = $adminId;
 		}

+ 2 - 2
app/ghs/controllers/AdminRoleAuthController.php

@@ -16,7 +16,7 @@ class AdminRoleAuthController extends BaseController
     {
         $roleId = Yii::$app->request->get('roleId', 0);
         $role = AdminRoleService::getById($roleId);
-        AdminRoleService::valid($role, $this->merchantId);
+        AdminRoleService::valid($role, $this->sjId);
         $roleAuth = AdminRoleAuthService::getByCondition(['roleId' => $roleId, 'endId' => 1]);
         $auth = isset($roleAuth['auth']) ? $roleAuth['auth'] : '';
         $ids = !empty($auth) ? explode(',', $auth) : [];
@@ -29,7 +29,7 @@ class AdminRoleAuthController extends BaseController
         $roleId = Yii::$app->request->post('roleId', 0);
         $authIdList = Yii::$app->request->post('authIdList', ['*']);
         $auth = AdminRoleAuthService::getByCondition(['roleId' => $roleId, 'endId' => 1]);
-        AdminRoleAuthService::valid($auth, $this->merchantId);
+        AdminRoleAuthService::valid($auth, $this->sjId);
         AdminRoleAuthService::updateByCondition(['roleId' => $roleId, 'endId' => 1], ['auth' => implode(',', $authIdList)]);
         util::complete();
     }

+ 4 - 4
app/ghs/controllers/AdminRoleController.php

@@ -16,7 +16,7 @@ class AdminRoleController extends BaseController
 	//角色列表 shish 2019.12.9
 	public function actionList()
 	{
-		$list = AdminRoleService::getRoleList($this->merchantId);
+		$list = AdminRoleService::getRoleList($this->sjId);
 		util::success($list);
 	}
 	
@@ -24,7 +24,7 @@ class AdminRoleController extends BaseController
 	public function actionAdd()
 	{
 		$post = Yii::$app->request->post();
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		$respond = AdminRoleService::addRole($post);
 		util::success($respond);
 	}
@@ -36,7 +36,7 @@ class AdminRoleController extends BaseController
 		$id = isset($post['id']) ? $post['id'] : 0;
 		unset($post['id']);
 		$role = AdminRoleService::getById($id);
-		AdminRoleService::valid($role, $this->merchantId);
+		AdminRoleService::valid($role, $this->sjId);
 		AdminRoleService::updateRole($role, $post);
 		util::complete('修改成功');
 	}
@@ -46,7 +46,7 @@ class AdminRoleController extends BaseController
 	{
 		$id = Yii::$app->request->post('id', 0);
 		$role = AdminRoleService::getById($id);
-		AdminRoleService::valid($role, $this->merchantId);
+		AdminRoleService::valid($role, $this->sjId);
 		AdminRoleService::deleteRole($role);
 		util::complete('删除成功');
 	}

+ 2 - 2
app/ghs/controllers/AgentAssetController.php

@@ -13,8 +13,8 @@ class AgentAssetController extends BaseController
 	//代理资产 shish 2019.12.26
 	public function actionDetail()
 	{
-		$detail = AgentAssetService::getDetail($this->merchantId);
-		$asset = MerchantAssetService::getByMerchantId($this->merchantId);
+		$detail = AgentAssetService::getDetail($this->sjId);
+		$asset = MerchantAssetService::getByMerchantId($this->sjId);
 		$detail['balance'] = isset($asset['balance']) ? $asset['balance'] : 0;
 		util::success($detail);
 	}

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

@@ -22,7 +22,7 @@ class ApplyController extends BaseController
 	{
 		$status = Yii::$app->request->get('status', 0);
 		$where = [];
-		$where['introMerchantId'] = $this->merchantId;
+		$where['introSjId'] = $this->sjId;
 		if ($status != -1) {
 			$where['status'] = $status;
 		}

+ 11 - 11
app/ghs/controllers/BaseController.php

@@ -17,7 +17,7 @@ use common\components\util;
 class BaseController extends PublicController
 {
 	public $admin, $adminId, $adminAvatar, $account;
-	public $merchantId = 0, $merchantName, $merchant, $merchantExtend, $merchantLogo, $signPackage, $shopId = 0;
+	public $sjId = 0, $sj, $sjExtend, $signPackage, $shopId = 0;
 	public $appId;
 	public $isWx = false;
 	public $isLogin = false;
@@ -31,9 +31,9 @@ class BaseController extends PublicController
 		//$adminId = jwt::getLoginId();
 		//模拟用户
 		$adminId = 1;
-		$merchantId = 0;
-		$merchant = [];
-		$merchantExtend = [];
+		$sjId = 0;
+		$sj = [];
+		$sjExtend = [];
 		$admin = [];
 		if (empty($adminId)) {
 			$this->validate = false;
@@ -52,9 +52,9 @@ class BaseController extends PublicController
 				if (empty($shop)) {
 					util::fail('没有找到您的门店');
 				}
-				$merchantId = $shop['merchantId'];
-				$merchant = MerchantService::getMerchantById($merchantId);
-				$merchantExtend = MerchantExtendService::getByMerchantId($merchantId);
+				$sjId = $shop['merchantId'];
+				$sj = MerchantService::getMerchantById($sjId);
+				$sjExtend = MerchantExtendService::getByMerchantId($sjId);
 			}
 			$this->shopId = $shopId;
 		}
@@ -63,13 +63,13 @@ class BaseController extends PublicController
 			$this->validate = true;
 		}
 		if ($this->validate == false) {
-			util::notLogin('您还没有登陆哦');
+			util::notLogin();
 		}
 		$this->admin = $admin;
 		$this->adminId = $adminId;
-		$this->merchantId = $merchantId;
-		$this->merchant = $merchant;
-		$this->merchantExtend = $merchantExtend;
+		$this->sjId = $sjId;
+		$this->sj = $sj;
+		$this->sjExtend = $sjExtend;
 		return parent::beforeAction($action);
 	}
 	

+ 9 - 9
app/ghs/controllers/CategoryController.php

@@ -19,7 +19,7 @@ class CategoryController extends BaseController
 	//分类列表
 	public function actionList()
 	{
-		$list = CategoryService::getCategoryList($this->merchantId);
+		$list = CategoryService::getCategoryList($this->sjId);
 		util::success($list);
 	}
 	
@@ -28,7 +28,7 @@ class CategoryController extends BaseController
 	{
 		$id = Yii::$app->request->get('categoryId', 0);
 		$category = CategoryService::getById($id);
-		CategoryService::valid($category, $this->merchantId);
+		CategoryService::valid($category, $this->sjId);
 		$info = CategoryService::getInfo($id);
 		util::success($info);
 	}
@@ -37,7 +37,7 @@ class CategoryController extends BaseController
 	public function actionAdd()
 	{
 		$post = Yii::$app->request->post();
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		$cat = CategoryService::addCategory($post);
 		util::success(['id' => $cat['id']]);
 	}
@@ -48,7 +48,7 @@ class CategoryController extends BaseController
 		$post = Yii::$app->request->post();
 		$categoryId = isset($post['categoryId']) ? $post['categoryId'] : 0;
 		$category = CategoryService::getById($categoryId);
-		CategoryService::valid($category, $this->merchantId);
+		CategoryService::valid($category, $this->sjId);
 		CategoryService::updateCategory($category, $post);
 		util::complete('修改成功');
 	}
@@ -60,7 +60,7 @@ class CategoryController extends BaseController
 		$categoryId = isset($get['categoryId']) ? $get['categoryId'] : 0;
 		$status = isset($get['status']) ? $get['status'] : 0;
 		$category = CategoryService::getById($categoryId);
-		CategoryService::valid($category, $this->merchantId);
+		CategoryService::valid($category, $this->sjId);
 		CategoryService::changeStatus($categoryId, $status);
 		util::complete();
 	}
@@ -71,7 +71,7 @@ class CategoryController extends BaseController
 		$get = Yii::$app->request->get();
 		$categoryId = isset($get['categoryId']) ? $get['categoryId'] : 0;
 		$category = CategoryService::getById($categoryId);
-		CategoryService::valid($category, $this->merchantId);
+		CategoryService::valid($category, $this->sjId);
 		CategoryService::deleteCategory($categoryId);
 		util::complete('删除成功');
 	}
@@ -81,9 +81,9 @@ class CategoryController extends BaseController
 	{
 		$categoryId = Yii::$app->request->get('categoryId');
 		//没有分类默认取商家第一个分类
-		$categoryId = !empty($categoryId) ? $categoryId : CategoryService::getTopCategoryId($this->merchantId);
+		$categoryId = !empty($categoryId) ? $categoryId : CategoryService::getTopCategoryId($this->sjId);
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		$where['cId'] = $categoryId;
 		$where['delStatus'] = 0;
 		$data = GoodsCategoryService::getGoodsList($where);
@@ -96,7 +96,7 @@ class CategoryController extends BaseController
 		$id = Yii::$app->request->get('id', 0);
 		$inTurn = Yii::$app->request->get('inTurn', 0);
 		$category = CategoryService::getById($id);
-		CategoryService::valid($category, $this->merchantId);
+		CategoryService::valid($category, $this->sjId);
 		CategoryService::updateById($id, ['inTurn' => $inTurn]);
 		util::complete();
 	}

+ 12 - 12
app/ghs/controllers/ChatController.php

@@ -20,7 +20,7 @@ class ChatController extends BaseController
 		$get = Yii::$app->request->get();
 		$userId = isset($get['userId']) ? $get['userId'] : 0;
 		$user = UserService::getById($userId);
-		UserService::valid($user, $this->merchantId);
+		UserService::valid($user, $this->sjId);
 		return $this->renderPartial('index', ['userId' => $userId]);
 	}
 
@@ -29,12 +29,12 @@ class ChatController extends BaseController
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$user = UserService::getUserInfo($id);
-		UserService::valid($user, $this->merchantId);
+		UserService::valid($user, $this->sjId);
 		//新增最近联系人
-		ChatService::addRecentlyUser($this->merchantId, $id);
+		ChatService::addRecentlyUser($this->sjId, $id);
 		//获取最近联系人
-		$recentlyUser = ChatService::getRecentlyUserList($this->merchantId);
-		util::success(['merchant' => $this->merchant, 'user' => $user, 'recentlyUser' => $recentlyUser]);
+		$recentlyUser = ChatService::getRecentlyUserList($this->sjId);
+		util::success(['merchant' => $this->sj, 'user' => $user, 'recentlyUser' => $recentlyUser]);
 	}
 	
 	//绑定 shish 2019.12.28
@@ -42,11 +42,11 @@ class ChatController extends BaseController
 	{
 		$post = Yii::$app->request->post();
 		$clientId = isset($post['clientId']) ? $post['clientId'] : '';
-		$id = 'merchantChat_' . $this->merchantId;
+		$id = 'merchantChat_' . $this->sjId;
 		Gateway::bindUid($clientId, $id);
 		
 		//连接就将新消息置为已读
-		$consoleId = 'merchantConsole_' . $this->merchantId;
+		$consoleId = 'merchantConsole_' . $this->sjId;
 		$consoleOnline = Gateway::getClientIdByUid($consoleId);
 		if ($consoleOnline) {
 			$data = ['type' => 'newMessage', 'status' => 0];
@@ -66,7 +66,7 @@ class ChatController extends BaseController
 	{
 		$post = Yii::$app->request->post();
 		$clientId = isset($post['clientId']) ? $post['clientId'] : '';
-		$id = 'merchantConsole_' . $this->merchantId;
+		$id = 'merchantConsole_' . $this->sjId;
 		Gateway::bindUid($clientId, $id);
 	}
 	
@@ -77,7 +77,7 @@ class ChatController extends BaseController
 		$type = isset($post['type']) ? $post['type'] : 'text';
 		$userId = isset($post['userId']) ? $post['userId'] : 0;
 		$user = UserService::getById($userId);
-		UserService::valid($user, $this->merchantId);
+		UserService::valid($user, $this->sjId);
 		$arr = [];
 		$arr['type'] = $type;
 		$arr['source'] = 'merchant';
@@ -107,7 +107,7 @@ class ChatController extends BaseController
 				//商品
 				$id = $post['goodsId'];
 				$info = GoodsService::getGoodsInfo($id);
-				GoodsService::valid($info, $this->merchantId);
+				GoodsService::valid($info, $this->sjId);
 				$arr['goodsName'] = $info['goodsName'];
 				$arr['img'] = isset($info['smallImgList'][0]) ? $info['smallImgList'][0] : '';
 				$arr['price'] = isset($info['price']) ? $info['price'] : 300;
@@ -128,7 +128,7 @@ class ChatController extends BaseController
 	//最近联系人 shish 2019.12.29
 	public function actionRecentlyUser()
 	{
-		$respond = ChatService::getRecentlyUserList($this->merchantId);
+		$respond = ChatService::getRecentlyUserList($this->sjId);
 		util::success($respond);
 	}
 	
@@ -138,7 +138,7 @@ class ChatController extends BaseController
 		//商品 图片 快捷链接 文字
 		$id = Yii::$app->request->get('id');
 		$info = UserService::getById($id);
-		UserService::valid($info, $this->merchantId);
+		UserService::valid($info, $this->sjId);
 		$respond = ChatService::getMessageList($id);
 		util::success($respond);
 	}

+ 4 - 4
app/ghs/controllers/CheckOrderController.php

@@ -36,7 +36,7 @@ class CheckOrderController extends BaseController
     public function actionCreateOrder()
     {
         $post = Yii::$app->request->post();
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         $post['shopId'] = $this->shopId;
         $post['adminId'] = $this->adminId;
         //盘点是否有未处理的草稿,有的话先处理之前的草稿??
@@ -49,7 +49,7 @@ class CheckOrderController extends BaseController
     public function actionCreateDraft()
     {
         $post = Yii::$app->request->post();
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         $post['shopId'] = $this->shopId;
         $post['adminId'] = $this->adminId;
 
@@ -63,7 +63,7 @@ class CheckOrderController extends BaseController
     public function actionUpdateDraft()
     {
         $post = Yii::$app->request->post();
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         $post['shopId'] = $this->shopId;
         $post['adminId'] = $this->adminId;
         $orderSn = $post['orderSn']??'';
@@ -79,7 +79,7 @@ class CheckOrderController extends BaseController
     public function actionUpdateOrder()
     {
         $post = Yii::$app->request->post();
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         $post['shopId'] = $this->shopId;
         $post['adminId'] = $this->adminId;
         $orderSn = $post['orderSn']??'';

+ 5 - 5
app/ghs/controllers/ConsoleController.php

@@ -17,21 +17,21 @@ class ConsoleController extends BaseController
     //概况 shish 2019.12.19
     public function actionProfile()
     {
-        $asset = MerchantAssetService::getByMerchantId($this->merchantId);
+        $asset = MerchantAssetService::getByMerchantId($this->sjId);
         $notice = [
             //['title' => '您还有10天试用期结束 ', 'action' => '立即续费', 'clickHint' => '请在手机上进行续费', 'url' => 'http://www.test.com'],
         ];
         //今天访客数
-        $todayVisit = StatVisitService::getTodayVisitNum($this->merchantId);
+        $todayVisit = StatVisitService::getTodayVisitNum($this->sjId);
         //今天客户与粉丝数
-        $userData = StatUserService::getTodayNum($this->merchantId);
+        $userData = StatUserService::getTodayNum($this->sjId);
         $todayFansNum = isset($userData['riseFansNum']) ? $userData['riseFansNum'] : 0;
         $todayUserNum = isset($userData['riseUserNum']) ? $userData['riseUserNum'] : 0;
         //今天订单数
-        $orderData = StatOrderService::getTodayNum($this->merchantId);
+        $orderData = StatOrderService::getTodayNum($this->sjId);
         $todayOrder = isset($orderData['riseNum']) ? $orderData['riseNum'] : 0;
         //今天收入
-        $incomeData = StatIncomeService::getTodayNum($this->merchantId);
+        $incomeData = StatIncomeService::getTodayNum($this->sjId);
         $todayIncome = isset($incomeData['amount']) ? $incomeData['amount'] : 0;
         $todayData = ['visit' => $todayVisit, 'fans' => $todayFansNum, 'user' => $todayUserNum, 'income' => $todayIncome, 'order' => $todayOrder, 'expend' => 399];
 

+ 2 - 2
app/ghs/controllers/CouponAssetController.php

@@ -12,7 +12,7 @@ class CouponAssetController extends BaseController
 	//详情 shish 2019.12.18
 	public function actionDetail()
 	{
-		$asset = CouponAssetService::getAsset($this->merchantId);
+		$asset = CouponAssetService::getAsset($this->sjId);
 		util::success($asset);
 	}
 
@@ -20,7 +20,7 @@ class CouponAssetController extends BaseController
 	public function actionUpdate()
 	{
 		$post = Yii::$app->request->post();
-		CouponAssetService::updateAsset($this->merchantId, $post);
+		CouponAssetService::updateAsset($this->sjId, $post);
 		util::complete('修改成功');
 	}
 

+ 2 - 2
app/ghs/controllers/CouponController.php

@@ -20,13 +20,13 @@ class CouponController extends BaseController
 		$get = Yii::$app->request->get();
 		$status = isset($get['status']) ? $get['status'] : -1;
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		if ($status != -1) {
 			$where['status'] = $status;
 		}
 		$data = CouponService::getCouponList($where);
 		
-		$asset = CouponAssetService::getAsset($this->merchantId);
+		$asset = CouponAssetService::getAsset($this->sjId);
 		if (empty($asset)) {
 			util::fail('找不到优惠券初始数据');
 		}

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

@@ -20,7 +20,7 @@ class CustomController extends BaseController
 		$get = Yii::$app->request->get();
 		$type = isset($get['type']) ? $get['type'] : 0;
 		$name = isset($get['name']) ? $get['name'] : '';
-		$where = ['merchantId' => $this->merchantId];
+		$where = ['merchantId' => $this->sjId];
 		switch ($type) {
 			case 1:
 				//已开店
@@ -45,7 +45,7 @@ class CustomController extends BaseController
 		$get = Yii::$app->request->get();
 		$customId = $get['id'] ?? 0;
 		$info = CustomService::getCustomInfo($customId);
-		CustomClass::valid($info, $this->merchantId);
+		CustomClass::valid($info, $this->sjId);
 		$info['sn'] = 1254358;
 		util::success($info);
 	}
@@ -57,7 +57,7 @@ class CustomController extends BaseController
 		$debt = isset($get['debt']) ? $get['debt'] : 0;
 		$customId = isset($get['customId']) ? $get['customId'] : 0;
 		$custom = CustomClass::getById($customId);
-		CustomClass::valid($custom, $this->merchantId);
+		CustomClass::valid($custom, $this->sjId);
 		CustomClass::debt($custom, $debt);
 		util::complete();
 	}
@@ -66,7 +66,7 @@ class CustomController extends BaseController
 	public function actionAdd()
 	{
 		$post = Yii::$app->request->post();
-		ApplyService::addCustom($post, $this->merchantId);
+		ApplyService::addCustom($post, $this->sjId);
 		util::complete('已提交审核');
 	}
 	

+ 15 - 15
app/ghs/controllers/GoodsController.php

@@ -36,10 +36,10 @@ class GoodsController extends BaseController
         if (isset($get['cId']) && $get['cId'] != -1) {
             $where['cId'] = $get['cId'];
         }
-        $where['merchantId'] = $this->merchantId;
+        $where['merchantId'] = $this->sjId;
         $where['delStatus'] = 0;
         $data = GoodsService::getGoodsList($where);
-        $asset = MerchantAssetService::getByMerchantId($this->merchantId);
+        $asset = MerchantAssetService::getByMerchantId($this->sjId);
         $data['MerchantAsset'] = $asset;
         util::success($data);
     }
@@ -48,7 +48,7 @@ class GoodsController extends BaseController
     public function actionAdd()
     {
         $data = Yii::$app->request->post();
-        $data['merchantId'] = $this->merchantId;
+        $data['merchantId'] = $this->sjId;
         $return = GoodsService::addGoods($data);
         $id = $return['id'];
         $info = GoodsService::getById($id);
@@ -69,8 +69,8 @@ class GoodsController extends BaseController
         $data = Yii::$app->request->post();
         $id = isset($data['id']) ? $data['id'] : 0;
         $info = GoodsService::getById($id);
-        GoodsService::valid($info, $this->merchantId);
-        $data['merchantId'] = $this->merchantId;
+        GoodsService::valid($info, $this->sjId);
+        $data['merchantId'] = $this->sjId;
         GoodsService::updateGoods($id, $data);
         util::complete();
     }
@@ -83,11 +83,11 @@ class GoodsController extends BaseController
         $inTurn = Yii::$app->request->get('inTurn', 0);
         //验证商品
         $info = GoodsService::getById($id);
-        GoodsService::valid($info, $this->merchantId);
+        GoodsService::valid($info, $this->sjId);
         if ($cId != 0) {
             //验证分类
             $category = CategoryService::getById($cId);
-            CategoryService::valid($category, $this->merchantId);
+            CategoryService::valid($category, $this->sjId);
             GoodsCategoryService::updateByCondition(['cId' => $cId, 'gId' => $id], ['inTurn' => $inTurn]);
         } else {
             GoodsService::updateById($id, ['inTurn' => $inTurn]);
@@ -101,7 +101,7 @@ class GoodsController extends BaseController
     {
         $id = Yii::$app->request->get('id', 0);
         $goods = GoodsService::getById($id);
-        GoodsService::valid($goods, $this->merchantId);
+        GoodsService::valid($goods, $this->sjId);
         GoodsService::deleteGoods($goods);
         util::complete();
     }
@@ -113,7 +113,7 @@ class GoodsController extends BaseController
         $id = isset($post['id']) ? $post['id'] : 0;
         $status = isset($post['status']) ? $post['status'] : 1;
         $info = GoodsService::getById($id);
-        GoodsService::valid($info, $this->merchantId);
+        GoodsService::valid($info, $this->sjId);
         GoodsService::changeStatus($id, $status);
         util::complete();
     }
@@ -135,7 +135,7 @@ class GoodsController extends BaseController
     //商品说明 shish 2019.12.8
     public function actionIntroduce()
     {
-        $set = GoodsSettingService::getByCondition(['merchantId' => $this->merchantId]);
+        $set = GoodsSettingService::getByCondition(['merchantId' => $this->sjId]);
         $introduce = $set['goodsIntroduce'];
         util::success(['introduce' => $introduce]);
     }
@@ -144,14 +144,14 @@ class GoodsController extends BaseController
     public function actionUpdateIntroduce()
     {
         $introduce = Yii::$app->request->post('introduce', '');
-        GoodsSettingService::updateByCondition(['merchantId' => $this->merchantId], ['goodsIntroduce' => $introduce]);
+        GoodsSettingService::updateByCondition(['merchantId' => $this->sjId], ['goodsIntroduce' => $introduce]);
         util::complete('提交成功');
     }
 
     //设置 shish 2019.12.8
     public function actionSetting()
     {
-        $return = GoodsSettingService::getSetting($this->merchantId);
+        $return = GoodsSettingService::getSetting($this->sjId);
         util::success($return);
     }
 
@@ -166,14 +166,14 @@ class GoodsController extends BaseController
             if (empty($festIdList)) {
                 util::fail('请选择节日');
             }
-            FestRiseService::deleteByCondition(['merchantId' => $this->merchantId]);
+            FestRiseService::deleteByCondition(['merchantId' => $this->sjId]);
             $add = [];
             foreach ($festIdList as $festId) {
-                $add[] = ['merchantId' => $this->merchantId, 'festId' => $festId];
+                $add[] = ['merchantId' => $this->sjId, 'festId' => $festId];
             }
             FestRiseService::batchAdd($add);
         }
-        GoodsSettingService::updateByCondition(['merchantId' => $this->merchantId], $post);
+        GoodsSettingService::updateByCondition(['merchantId' => $this->sjId], $post);
         util::complete('提交成功');
     }
 

+ 2 - 2
app/ghs/controllers/InviteAssetController.php

@@ -15,7 +15,7 @@ class InviteAssetController extends BaseController
 	//详情 shish 2019.12.18
 	public function actionDetail()
 	{
-		$asset = InviteAssetService::getAsset($this->merchantId);
+		$asset = InviteAssetService::getAsset($this->sjId);
 		util::success($asset);
 	}
 
@@ -23,7 +23,7 @@ class InviteAssetController extends BaseController
 	public function actionUpdate()
 	{
 		$post = Yii::$app->request->post();
-		InviteAssetService::updateAsset($this->merchantId, $post);
+		InviteAssetService::updateAsset($this->sjId, $post);
 		util::complete('修改成功');
 	}
 

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

@@ -20,7 +20,7 @@ class InviteController extends BaseController
 		$status = isset($get['status']) ? $get['status'] : -1;
 		$search = isset($get['search']) ? $get['search'] : '';
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		if ($status != -1) {
 			$where['status'] = $status;
 		}
@@ -40,7 +40,7 @@ class InviteController extends BaseController
 	{
 		$id = Yii::$app->request->get('id');
 		$invite = InviteService::getById($id);
-		InviteService::valid($invite, $this->merchantId);
+		InviteService::valid($invite, $this->sjId);
 		$detail = InviteService::getDetail($id);
 		util::success($detail);
 	}
@@ -50,7 +50,7 @@ class InviteController extends BaseController
 	{
 		$id = Yii::$app->request->get('id');
 		$invite = InviteService::getById($id);
-		InviteService::valid($invite, $this->merchantId);
+		InviteService::valid($invite, $this->sjId);
 		InviteService::give($invite);
 		util::complete();
 	}

+ 4 - 4
app/ghs/controllers/ItemClassController.php

@@ -16,7 +16,7 @@ class ItemClassController extends BaseController
 
     public function actionList()
     {
-        $where = ['merchantId' => $this->merchantId];
+        $where = ['merchantId' => $this->sjId];
         $list = ItemClassClass::getGhsItemClassList($where);
         util::success($list);
     }
@@ -25,7 +25,7 @@ class ItemClassController extends BaseController
     {
         $post = Yii::$app->request->post();
         $post['adminId'] = $this->adminId;
-        $res = ItemClassClass::addGhsItemClass($this->merchantId,$post);
+        $res = ItemClassClass::addGhsItemClass($this->sjId,$post);
         util::complete('添加成功');
     }
 
@@ -34,7 +34,7 @@ class ItemClassController extends BaseController
         $data = Yii::$app->request->post();
 
         $data['adminId'] = $this->adminId;
-        $data['merchantId'] = $this->merchantId;
+        $data['merchantId'] = $this->sjId;
         ItemClassClass::updateGhsItemClass($data);
         util::complete('修改成功');
     }
@@ -49,7 +49,7 @@ class ItemClassController extends BaseController
     //开单: 获取所有分类
     public function actionAll()
     {
-        $data = ItemClassClass::getGhsItemClassAll($this->merchantId);
+        $data = ItemClassClass::getGhsItemClassAll($this->sjId);
         util::success($data);
     }
 }

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

@@ -14,7 +14,7 @@ class ItemController extends BaseController
     {
         //classId
         $classId = Yii::$app->request->get('classId',0);
-        $where['merchantId'] =  $this->merchantId;
+        $where['merchantId'] =  $this->sjId;
         $where['classId'] =  $classId;
         $list = ItemClass::getGhsItemList($where);
         util::success($list);
@@ -25,7 +25,7 @@ class ItemController extends BaseController
         $post = Yii::$app->request->post();
         $post['adminId'] = $this->adminId;
         $post['shopId'] = $this->shopId;
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         ItemService::addGhsItem($post);
         util::complete('添加成功');
     }
@@ -34,7 +34,7 @@ class ItemController extends BaseController
     {
         $data = Yii::$app->request->post();
         $data['adminId'] = $this->adminId;
-        $data['merchantId'] = $this->merchantId;
+        $data['merchantId'] = $this->sjId;
         ItemService::updateGshItem($data);
         util::complete('修改成功');
     }

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

@@ -27,7 +27,7 @@ class MainController extends BaseController
 			'msg' => 'aaaa',
 		));
 		
-		$id = 'merchantConsole_' . $this->merchantId;
+		$id = 'merchantConsole_' . $this->sjId;
 		$online = Gateway::getClientIdByUid($id);
 		if ($online) {
 			//直接发送
@@ -45,7 +45,7 @@ class MainController extends BaseController
 			'msg' => 'aaaa',
 		));
 		
-		$id = 'merchantConsole_' . $this->merchantId;
+		$id = 'merchantConsole_' . $this->sjId;
 		$online = Gateway::getClientIdByUid($id);
 		if ($online) {
 			//直接发送

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

@@ -13,7 +13,7 @@ class MerchantCapitalController extends BaseController
 	public function actionList()
 	{
 		$get = Yii::$app->request->get();
-		$where = ['merchantId' => $this->merchantId];
+		$where = ['merchantId' => $this->sjId];
 		$list = MerchantCapitalService::getCapitalList($where);
 		util::success($list);
 	}

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

@@ -18,26 +18,26 @@ class MerchantController extends BaseController
 		$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->merchantId], ['freeDistance' => $first, 'freight' => $add]);
+		MerchantExtendService::updateByCondition(['merchantId' => $this->sjId], ['freeDistance' => $first, 'freight' => $add]);
 		util::complete();
 	}
 	
 	//商家信息 shish 2019.12.8
 	public function actionDetail()
 	{
-		$merchant = $this->merchant;
+		$merchant = $this->sj;
 		if (empty($merchant)) {
 			util::success([]);
 		}
-		$merchant = MerchantService::getInfo($this->merchant, $this->merchantExtend);
+		$merchant = MerchantService::getInfo($this->sj, $this->sjExtend);
 		util::success($merchant);
 	}
 
 	//商家现有的会员等级 shish 2019.12.12
 	public function actionMemberLevel()
 	{
-		$list = MerchantExtendService::getGradeList($this->merchantExtend, false, false);
-		$extend = $this->merchantExtend;
+		$list = MerchantExtendService::getGradeList($this->sjExtend, false, false);
+		$extend = $this->sjExtend;
 		$gradeSwitch = isset($extend['gradeSwitch']) ? $extend['gradeSwitch'] : 1;
 		util::success(['list' => $list, 'gradeSwitch' => $gradeSwitch]);
 	}
@@ -45,7 +45,7 @@ class MerchantController extends BaseController
 	//会员等级更新 shish 2019.12.18
 	public function actionMemberLevelUpdate()
 	{
-		$extend = $this->merchantExtend;
+		$extend = $this->sjExtend;
 		if ($extend['gradeSwitch'] == 0) {
 			util::fail('会员等级已设置不能修改');
 		}
@@ -76,7 +76,7 @@ class MerchantController extends BaseController
 			util::fail('请填写会员等级!');
 		}
 		$string = implode('I', $data);
-		MerchantExtendService::updateByCondition(['merchantId' => $this->merchantId], ['gradeList' => $string, 'gradeSwitch' => 0]);
+		MerchantExtendService::updateByCondition(['merchantId' => $this->sjId], ['gradeList' => $string, 'gradeSwitch' => 0]);
 		util::complete('提交成功');
 	}
 	
@@ -90,7 +90,7 @@ class MerchantController extends BaseController
 	//商家当前的权限id列表 shish 2020.1.23
 	public function actionAuth()
 	{
-		$merchant = $this->merchant;
+		$merchant = $this->sj;
 		$setId = $merchant['setId'];
 		$endId = 1;
 		$ids = SetAuthService::getAuthIdList($setId, $endId);

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

@@ -15,7 +15,7 @@ class MerchantRemarkController extends BaseController
 	{
 		$id = Yii::$app->request->get('id');
 		$remark = MerchantRemarkService::getById($id);
-		MerchantRemarkService::valid($remark, $this->merchantId);
+		MerchantRemarkService::valid($remark, $this->sjId);
 		MerchantRemarkService::deleteById($id);
 		util::complete('删除成功');
 	}
@@ -30,9 +30,9 @@ class MerchantRemarkController extends BaseController
 			util::fail('请填写备注');
 		}
 		$user = UserService::getById($userId);
-		UserService::valid($user, $this->merchantId);
+		UserService::valid($user, $this->sjId);
 		$post['addTime'] = time();
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		MerchantRemarkService::add($post);
 		util::complete('添加成功');
 	}

+ 6 - 6
app/ghs/controllers/OrderController.php

@@ -34,7 +34,7 @@ class OrderController extends BaseController
 		if (!empty($status)) {
 			$where['status'] = $status;
 		}
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		if (isset($get['shopId'])) {
 			$shopId = $get['shopId'] ?? 0;
 			if (!empty($shopId)) {
@@ -75,7 +75,7 @@ class OrderController extends BaseController
 		}
 		
 		$post['payWay'] = $this->isWx == true ? 0 : 1;
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		$post['fromType'] = 1;//商城
 		$post['prePrice'] = 0.01;
 		$post['actPrice'] = 0.01;
@@ -181,7 +181,7 @@ class OrderController extends BaseController
 		$input->SetTrade_type("JSAPI");
 		
 		//花卉宝代为申请的微信支付
-		$merchantExtend = $this->merchantExtend;
+		$merchantExtend = $this->sjExtend;
 		if ($merchantExtend['wxPayApply'] == 1) {
 			$input->SetSub_openid($openId);
 		} else {
@@ -311,7 +311,7 @@ class OrderController extends BaseController
 		$post['discountAmount'] = $discountData['discountAmount'];
 		$post['actPrice'] = $actPrice;
 		$post['payStyle'] = 0;
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		$now = time();
 		//订单5分钟后过期
 		$expireTime = $now + 300;
@@ -329,7 +329,7 @@ class OrderController extends BaseController
 		$order = OrderClass::addOrder($post);
 		$orderId = $order['id'];
 		$orderSn = $order['orderSn'];
-		$merchantId = $this->merchantId;
+		$merchantId = $this->sjId;
 		if ($payWay == 0) {
 			$orderId = $order['id'];
 			$name = '购买商品';
@@ -366,7 +366,7 @@ class OrderController extends BaseController
 			$input->SetTrade_type("JSAPI");
 			
 			//花卉宝代为申请的微信支付
-			//$merchantExtend = $this->merchantExtend;
+			//$merchantExtend = $this->sjExtend;
 			$merchantExtend = WxOpenClass::getGhsWxInfo();
 			if ($merchantExtend['wxPayApply'] == 1) {
 				$input->SetSub_openid($openId);

+ 4 - 4
app/ghs/controllers/OrderSendController.php

@@ -17,7 +17,7 @@ class OrderSendController extends BaseController
     {
         $id = Yii::$app->request->get('id', 0);
         $order = OrderService::getById($id);
-        OrderService::valid($order, $this->merchantId);
+        OrderService::valid($order, $this->sjId);
         //发货列表
         $list = OrderSendService::sendList($order);
         util::success($list);
@@ -29,8 +29,8 @@ class OrderSendController extends BaseController
         $post = Yii::$app->request->post();
         $id = isset($post['id']) ? $post['id'] : 0;
         $order = OrderService::getById($id);
-        OrderService::valid($order, $this->merchantId);
-        $post['merchantId'] = $this->merchantId;
+        OrderService::valid($order, $this->sjId);
+        $post['merchantId'] = $this->sjId;
         OrderSendService::deliver($post);
     }
 
@@ -41,7 +41,7 @@ class OrderSendController extends BaseController
         $id = isset($post['id']) ? $post['id'] : 0;
         $option = isset($post['option']) ? $post['option'] : 0;
         $order = OrderService::getById($id);
-        OrderService::valid($order, $this->merchantId);
+        OrderService::valid($order, $this->sjId);
         OrderSendService::reach($order, ['option' => $option]);
     }
 

+ 9 - 9
app/ghs/controllers/PicController.php

@@ -17,7 +17,7 @@ class PicController extends BaseController
     {
         $get = Yii::$app->request->get();
         $where = [];
-        $where['merchantId'] = $this->merchantId;
+        $where['merchantId'] = $this->sjId;
         $categoryId = isset($get['categoryId']) && is_numeric($get['categoryId']) ? $get['categoryId'] : -1;
         if ($categoryId != -1) {
             $where['categoryId'] = $get['categoryId'];
@@ -31,8 +31,8 @@ class PicController extends BaseController
     //上传图片 shish 2019.12.7
     public function actionAdd()
     {
-        $return = fileUtil::imgUpload($this->merchantId);
-        $merchantId = $this->merchantId;
+        $return = fileUtil::imgUpload($this->sjId);
+        $merchantId = $this->sjId;
         $time = time();
         $name = '未命名';
         $img = isset($return['shortUrl']) ? $return['shortUrl'] : '';
@@ -58,7 +58,7 @@ class PicController extends BaseController
         if (empty($categoryIdList)) {
             util::fail('请选择分类');
         }
-        $merchantHas = CategoryService::getCategoryIdList($this->merchantId);
+        $merchantHas = CategoryService::getCategoryIdList($this->sjId);
         $diff = array_diff($categoryIdList, $merchantHas);
         if (!empty($diff)) {
             util::fail('只能选择自己的分类');
@@ -66,13 +66,13 @@ class PicController extends BaseController
         $picList = PicService::getByIds($picIdList);
         $add = [];
         foreach ($picList as $picKey => $picVal) {
-            if ($picVal['merchantId'] != $this->merchantId) {
+            if ($picVal['merchantId'] != $this->sjId) {
                 util::fail('只能设置自己的图片');
             }
             $currentId = $picVal['id'];
             PicService::updateById($currentId, $post);
             foreach ($categoryIdList as $categoryId) {
-                $add[] = ['categoryId' => $categoryId, 'picId' => $currentId, 'merchantId' => $this->merchantId];
+                $add[] = ['categoryId' => $categoryId, 'picId' => $currentId, 'merchantId' => $this->sjId];
             }
             PicCategoryService::deleteByCondition(['picId' => $currentId]);
         }
@@ -85,7 +85,7 @@ class PicController extends BaseController
     {
         $id = Yii::$app->request->get('id', 0);
         $info = PicService::getById($id);
-        PicService::valid($info, $this->merchantId);
+        PicService::valid($info, $this->sjId);
         $pic = PicService::getPic($info);
         util::success($pic);
     }
@@ -95,7 +95,7 @@ class PicController extends BaseController
     {
         $id = Yii::$app->request->post('id', 0);
         $info = PicService::getById($id);
-        PicService::valid($info, $this->merchantId);
+        PicService::valid($info, $this->sjId);
         PicService::delPic($id);
         util::complete('删除成功');
     }
@@ -105,7 +105,7 @@ class PicController extends BaseController
     {
         $id = Yii::$app->request->post('id', 0);
         $info = PicService::getById($id);
-        PicService::valid($info, $this->merchantId);
+        PicService::valid($info, $this->sjId);
         PicService::top($info);
         util::complete();
     }

+ 4 - 4
app/ghs/controllers/ProductController.php

@@ -27,10 +27,10 @@ class ProductController extends BaseController
 
         //获取所有当前供应商的分类 (全部、常用)
         //根据分类组装分类下的花材信息
-        $classIds = ItemClassClass::getGhsItemClassAll($this->merchantId);
+        $classIds = ItemClassClass::getGhsItemClassAll($this->sjId);
 
         //获取供应商下所有花材ID (itemIds)
-        $itemIdsInfo = ItemService::getGhsItemIds($this->merchantId);
+        $itemIdsInfo = ItemService::getGhsItemIds($this->sjId);
 
         $itemIds = array_column($itemIdsInfo,'itemId');
         if($py){
@@ -40,7 +40,7 @@ class ProductController extends BaseController
 
         //库存预警
         if($type=='waring'){
-            $waringItemIds = ProductClass::getItemIdsWarning($this->merchantId,$this->shopId);
+            $waringItemIds = ProductClass::getItemIdsWarning($this->sjId,$this->shopId);
             $itemIds = array_intersect($itemIds,$waringItemIds);
         }
 
@@ -48,7 +48,7 @@ class ProductController extends BaseController
         $itemInfoData = ProductClass::getProductInfoByItemIds($itemIds);
 
         //常用的itemIds
-        $oftenItemIds = ProductClass::getOftenItemIds($this->merchantId);
+        $oftenItemIds = ProductClass::getOftenItemIds($this->sjId);
 
         //组装数据: [{classId:'','className:'',child:[{itemInfoData}]}]
         $data = ProductService::assembleData($classIds,$itemIdsInfo,$itemInfoData,$oftenItemIds);

+ 2 - 2
app/ghs/controllers/PurchaseOrderController.php

@@ -13,7 +13,7 @@ class PurchaseOrderController extends BaseController
     public function actionCreateOrder()
     {
         $post = Yii::$app->request->post();
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         $post['shopId'] = $this->shopId;
         $post['adminId'] = $this->adminId;
 
@@ -63,7 +63,7 @@ class PurchaseOrderController extends BaseController
         if($orderStatus){
             $where['orderStatus'] = $orderStatus;
         }
-        $where['merchantId'] = $this->merchantId;
+        $where['merchantId'] = $this->sjId;
         $where['shopId'] = $this->shopId;
         $data = PurchaseOrderClass::getOrderList($where);
         util::success($data);

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

@@ -79,7 +79,7 @@ class RenewController extends BaseController
         $input->SetTrade_type("JSAPI");
 
         //花卉宝代为申请的微信支付
-        $merchantExtend = MerchantExtendService::getByMerchantId($this->merchantId);
+        $merchantExtend = MerchantExtendService::getByMerchantId($this->sjId);
         if ($merchantExtend['wxPayApply'] == 1) {
             $input->SetSub_openid($openId);
         } else {

+ 7 - 7
app/ghs/controllers/ShopAdminController.php

@@ -22,13 +22,13 @@ class ShopAdminController extends BaseController
         $post = Yii::$app->request->post();
         $roleId = isset($post['roleId']) ? $post['roleId'] : 0;
         $role = AdminRoleService::getById($roleId);
-        if (empty($role) || isset($role['merchantId']) != $this->merchantId) {
+        if (empty($role) || isset($role['merchantId']) != $this->sjId) {
             util::fail('请选择角色!');
         }
         unset($post['userId']);
         unset($post['status']);
         $post['shopId'] = $this->shopId;
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         $post['adminId'] = $this->adminId;
         $merchant = WxOpenClass::getGhsWxInfo();
         $post['merchant'] = $merchant;
@@ -56,7 +56,7 @@ class ShopAdminController extends BaseController
         if (empty($relation)) {
             util::fail('没有找到员工');
         }
-        ShopAdminClass::valid($relation->attributes, $this->merchantId);
+        ShopAdminClass::valid($relation->attributes, $this->sjId);
         $relation->remind = $remind;
         $relation->save();
         util::complete();
@@ -72,7 +72,7 @@ class ShopAdminController extends BaseController
         if (empty($relation)) {
             util::fail('没有找到员工');
         }
-        ShopAdminClass::valid($relation->attributes, $this->merchantId);
+        ShopAdminClass::valid($relation->attributes, $this->sjId);
         $relation->status = $status;
         $relation->save();
         util::complete();
@@ -95,7 +95,7 @@ class ShopAdminController extends BaseController
         $get = Yii::$app->request->get();
         $id = isset($get['id']) ? $get['id'] : 0;
         $respond = ShopAdminService::getAdminInfo($id);
-        ShopAdminClass::valid($respond, $this->merchantId);
+        ShopAdminClass::valid($respond, $this->sjId);
         util::success($respond);
     }
 
@@ -114,7 +114,7 @@ class ShopAdminController extends BaseController
 
         $adminId = isset($relation->adminId) ? $relation->adminId : 0;
         $originalAdmin = ShopAdminService::getAdminInfo($adminId);
-        ShopAdminClass::valid($originalAdmin, $this->merchantId);
+        ShopAdminClass::valid($originalAdmin, $this->sjId);
         AdminClass::updateById($adminId, $post);
         util::complete('修改成功');
     }
@@ -126,7 +126,7 @@ class ShopAdminController extends BaseController
         $relation = ShopAdminClass::getById($id);
         $adminId = $relation['adminId'] ?? 0;
         $admin = ShopAdminService::getAdminInfo($adminId);
-        ShopAdminClass::valid($admin, $this->merchantId);
+        ShopAdminClass::valid($admin, $this->sjId);
         ShopAdminClass::deleteById($id);
         util::complete();
     }

+ 13 - 13
app/ghs/controllers/ShopController.php

@@ -18,7 +18,7 @@ class ShopController extends BaseController
 	public function actionList()
 	{
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		$where['delStatus'] = 0;
 		$list = ShopClass::getShopList($where);
 		util::success($list);
@@ -28,13 +28,13 @@ class ShopController extends BaseController
 	public function actionUpdate()
 	{
 		$data = Yii::$app->request->post();
-		$data['merchantId'] = $this->merchantId;
+		$data['merchantId'] = $this->sjId;
 		$id = $data['id'] ?? 0;
 		$shop = ShopService::getById($id);
 		if (empty($shop)) {
 			util::fail('没有找到门店');
 		}
-		ShopClass::valid($shop, $this->merchantId);
+		ShopClass::valid($shop, $this->sjId);
 		ShopClass::updateShop($id, $data);
 		util::complete();
 	}
@@ -43,7 +43,7 @@ class ShopController extends BaseController
 	public function actionAdd()
 	{
 		$data = Yii::$app->request->post();
-		$data['merchantId'] = $this->merchantId;
+		$data['merchantId'] = $this->sjId;
 		ShopClass::addShop($data);
 		util::complete();
 	}
@@ -53,8 +53,8 @@ class ShopController extends BaseController
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$shop = ShopService::getById($id);
-		ShopClass::valid($shop, $this->merchantId);
-		$gatheringCode = ShopClass::generateGatheringCode($this->merchantId, $id);
+		ShopClass::valid($shop, $this->sjId);
+		$gatheringCode = ShopClass::generateGatheringCode($this->sjId, $id);
 		$file = dirUtil::getImgDir() . $gatheringCode;
 		if (file_exists($file) == false) {
 			util::fail('没有找到收款码');
@@ -76,13 +76,13 @@ class ShopController extends BaseController
 	public function actionGatheringMiniCode()
 	{
 		$id = Yii::$app->request->get('id', 0);
-		$extend = MerchantExtendService::getByMerchantId($this->merchantId);
+		$extend = MerchantExtendService::getByMerchantId($this->sjId);
 		if ($extend['miniAuth'] == 0) {
 			util::fail('您的小程序还没有授权');
 		}
 		$shop = ShopService::getById($id);
-		ShopClass::valid($shop, $this->merchantId);
-		$applyMemberCode = wxUtil::generateGatheringMiniCode($this->merchant, $id);
+		ShopClass::valid($shop, $this->sjId);
+		$applyMemberCode = wxUtil::generateGatheringMiniCode($this->sj, $id);
 		$file = dirUtil::getImgDir() . $applyMemberCode;
 		if (file_exists($file) == false) {
 			util::fail('没有找到注册会员码');
@@ -104,13 +104,13 @@ class ShopController extends BaseController
 	public function actionApplyMemberCode()
 	{
 		$id = Yii::$app->request->get('id', 0);
-		$extend = MerchantExtendService::getByMerchantId($this->merchantId);
+		$extend = MerchantExtendService::getByMerchantId($this->sjId);
 		if ($extend['miniAuth'] == 0) {
 			util::fail('您的小程序还没有授权');
 		}
 		$shop = ShopService::getById($id);
-		ShopClass::valid($shop, $this->merchantId);
-		$applyMemberCode = wxUtil::generateMemberCode($this->merchant, $id);
+		ShopClass::valid($shop, $this->sjId);
+		$applyMemberCode = wxUtil::generateMemberCode($this->sj, $id);
 		$file = dirUtil::getImgDir() . $applyMemberCode;
 		if (file_exists($file) == false) {
 			util::fail('没有找到注册会员码');
@@ -133,7 +133,7 @@ class ShopController extends BaseController
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$shop = ShopService::getById($id);
-		ShopClass::valid($shop, $this->merchantId);
+		ShopClass::valid($shop, $this->sjId);
 		ShopClass::deleteShop($shop);
 		util::complete();
 	}

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

@@ -27,7 +27,7 @@ class StockOutController extends BaseController
     public function actionCreateOrder()
     {
         $post = Yii::$app->request->post();
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         $post['outShopId'] = $this->shopId;
         $post['adminId'] = $this->adminId;
         $inShopId = $post['inShopId']??0;

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

@@ -16,7 +16,7 @@ class SupplierController extends BaseController
     {
         $get = Yii::$app->request->get();
         $name = isset($get['name']) ? $get['name'] : '';
-        $where = ['merchantId' => $this->merchantId];
+        $where = ['merchantId' => $this->sjId];
         if (!empty($name)) {
             if (stringUtil::isLetter($name)) {
                 $where['py'] = ['like', $name];

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

@@ -28,7 +28,7 @@ class UploadController extends BaseController
 		if (!empty($categoryIds)) {
 			$categoryList = CategoryService::getByIds($categoryIds);
 			foreach ($categoryList as $cat) {
-				if ($cat['merchantId'] != $this->merchantId) {
+				if ($cat['merchantId'] != $this->sjId) {
 					util::fail('请选择自己的分类');
 				}
 			}
@@ -37,7 +37,7 @@ class UploadController extends BaseController
 		//匹配出图片的格式
 		if (preg_match('/^(data:\s*image\/(\w+);base64,)/', $base64_image_content, $result)) {
 			$type = $result[2];
-			$merchantId = $this->merchantId;
+			$merchantId = $this->sjId;
 			$month = date("Ym");
 			$date = date("d");
 			$path = dirUtil::getImgUploadDir() . "/{$merchantId}/{$month}/{$date}/";
@@ -86,7 +86,7 @@ class UploadController extends BaseController
 				$currentId = $pic['id'];
 				$add = [];
 				foreach ($categoryIds as $cat) {
-					$add[] = ['categoryId' => $cat, 'picId' => $currentId, 'merchantId' => $this->merchantId];
+					$add[] = ['categoryId' => $cat, 'picId' => $currentId, 'merchantId' => $this->sjId];
 				}
 				PicCategoryService::batchAdd($add);
 			}

+ 16 - 16
app/ghs/controllers/UserController.php

@@ -28,7 +28,7 @@ class UserController extends BaseController
         //组建where
         $type = isset($get['type']) ? $get['type'] : -1;
         $search = isset($get['search']) ? $get['search'] : '';
-        $where = ['merchantId' => $this->merchantId];
+        $where = ['merchantId' => $this->sjId];
         switch ($type) {
             case 1:
                 //粉丝
@@ -48,7 +48,7 @@ class UserController extends BaseController
             }
         }
         $list = UserService::getUserList($where);
-        $list['asset'] = MerchantAssetService::getByMerchantId($this->merchantId);
+        $list['asset'] = MerchantAssetService::getByMerchantId($this->sjId);
         util::success($list);
     }
 
@@ -57,7 +57,7 @@ class UserController extends BaseController
     {
         $userId = Yii::$app->request->get('userId');
         $info = UserService::getUserInfo($userId);
-        if (isset($info['merchantId']) == false || $this->merchantId != $info['merchantId']) {
+        if (isset($info['merchantId']) == false || $this->sjId != $info['merchantId']) {
             util::fail('没有权限');
         }
         util::success($info);
@@ -68,7 +68,7 @@ class UserController extends BaseController
     {
         $userId = Yii::$app->request->get('userId');
         $info = UserService::getFullUserInfo($userId);
-        UserService::valid($info, $this->merchantId);
+        UserService::valid($info, $this->sjId);
 
         $list = MerchantRemarkService::getRemarkList($userId);
         $info['remarkList'] = $list;
@@ -90,12 +90,12 @@ class UserController extends BaseController
         AdminService::verifyConfirmPassword($this->adminId, $confirmPassword);
 
         $mobile = $post['mobile'];
-        $user = UserService::getByMobile($mobile, $this->merchantId);
+        $user = UserService::getByMobile($mobile, $this->sjId);
         if (!empty($user)) {
             util::fail('手机号已使用');
         }
 
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         $post['member'] = $post['memberLevel'];
         UserService::addUser($post);
 
@@ -115,7 +115,7 @@ class UserController extends BaseController
         if (empty($user)) {
             util::fail('找不到客户');
         }
-        if ($user['merchantId'] != $this->merchantId) {
+        if ($user['merchantId'] != $this->sjId) {
             util::fail('您没有权限操作');
         }
         $userAsset = UserAssetService::getByUserId($userId);
@@ -123,8 +123,8 @@ class UserController extends BaseController
         $totalRecharge = $userAsset['totalRecharge'] + $rechargeAmount;
         $upData['balance'] = $totalBalance;
         $upData['totalRecharge'] = $totalRecharge;
-        $merchantAsset = MerchantAssetService::getByMerchantId($this->merchantId);
-        $return = xhRechargeService::recharge($rechargeAmount, $user, $this->adminId, $this->merchant, $this->merchantExtend, $merchantAsset);
+        $merchantAsset = MerchantAssetService::getByMerchantId($this->sjId);
+        $return = xhRechargeService::recharge($rechargeAmount, $user, $this->adminId, $this->sj, $this->sjExtend, $merchantAsset);
         if ($return['code'] == 'A0001') {
             util::complete();
         }
@@ -142,12 +142,12 @@ class UserController extends BaseController
             util::fail('客户不存在');
         }
         //验证是否商家客户
-        UserService::valid($user, $this->merchantId);
+        UserService::valid($user, $this->sjId);
         //验证确认密码
         $confirmPassword = $post['confirmPassword'];
         AdminService::verifyConfirmPassword($this->adminId, $confirmPassword);
 
-        $grade = xhMerchantExtendService::getGradeList($this->merchantExtend, 'desc');
+        $grade = xhMerchantExtendService::getGradeList($this->sjExtend, 'desc');
         //升级后的成长值
         $newLevelGrowth = $grade[$member]['growth'];
         $newDiscount = $grade[$member]['discount'];
@@ -173,7 +173,7 @@ class UserController extends BaseController
             $upgradeData = [
                 'member' => $member,
                 'prevMember' => $userAsset['member'],
-                'merchantId' => $this->merchantId,
+                'merchantId' => $this->sjId,
                 'gainType' => 0,
                 'addTime' => $now,
                 'userId' => $userId,
@@ -183,7 +183,7 @@ class UserController extends BaseController
             $growthData = [
                 'userId' => $userId,
                 'userName' => $user['userName'],
-                'merchantId' => $this->merchantId,
+                'merchantId' => $this->sjId,
                 'relateId' => $upgradeRespond['id'],
                 'growth' => $newLevelGrowth,
                 'num' => $addGrowth,
@@ -202,7 +202,7 @@ class UserController extends BaseController
             $transaction->rollBack();
             util::fail();
         }
-        $allTM = xhTMessageService::getList($this->merchantId);
+        $allTM = xhTMessageService::getList($this->sjId);
         $openId = isset($user['openId']) ? $user['openId'] : '';
         if (empty($openId)) {
             util::complete();
@@ -220,7 +220,7 @@ class UserController extends BaseController
                 "keyword2" => ["value" => $date, "color" => "#173177"],
                 "remark" => ["value" => "点击查看会员权益", "color" => "#173177"],
             ]];
-        wxUtil::sendTaskInform($data, $this->merchant);
+        wxUtil::sendTaskInform($data, $this->sj);
         util::complete();
     }
 
@@ -231,7 +231,7 @@ class UserController extends BaseController
         $userId = isset($post['userId']) ? $post['userId'] : 0;
         $password = isset($post['password']) ? $post['password'] : 0;
         $info = UserService::getById($userId);
-        UserService::valid($info, $this->merchantId);
+        UserService::valid($info, $this->sjId);
         UserService::updateById($userId, ['payPassword' => password_hash($password, PASSWORD_BCRYPT)]);
         util::complete();
     }

+ 10 - 10
app/ghs/controllers/WxMenuController.php

@@ -20,7 +20,7 @@ class WxMenuController extends BaseController
 		util::fail('即将开通');
 
 		//删除原有菜单
-		xhWxMenuService::delMenuList($this->merchantId);
+		xhWxMenuService::delMenuList($this->sjId);
 		
 		$date = date("Y-m-d H:i:s");
 		foreach ($menu as $key => $val) {//一级菜单数据整理
@@ -29,17 +29,17 @@ class WxMenuController extends BaseController
 			$parentName = $val['name'];
 			$addData = [];
 			$addData['parentId'] = 0;
-			$addData['merchantId'] = $this->merchantId;
+			$addData['merchantId'] = $this->sjId;
 			$addData['menuOrder'] = $parentOrder;
 			$addData['menuOption'] = $parentWxMenuOption;
 			$addData['hasSonMenu'] = isset($val['children']) && !empty($val['children']) ? 1 : 0;
 			$addData['name'] = $parentName;
-			$addData['menuKey'] = $this->merchantId . '_' . $parentOrder;
+			$addData['menuKey'] = $this->sjId . '_' . $parentOrder;
 			$addData['createTime'] = $date;
 			$addData['replyType'] = $val['replyType'];
 			$addData['replyUrl'] = $val['replyUrl'];
 			if (!empty($wxMenuContent)) {
-				$formatData = xhWxMenuService::getFormatData($wxMenuContent, $parentWxMenuOption, $this->merchant);
+				$formatData = xhWxMenuService::getFormatData($wxMenuContent, $parentWxMenuOption, $this->sj);
 				$addData = array_merge($addData, $formatData);
 			}
 			$return = xhWxMenuService::add($addData);
@@ -56,23 +56,23 @@ class WxMenuController extends BaseController
 					$childName = $childValue['name'];
 					$addChildData = [];
 					$addChildData['parentId'] = $parentId;
-					$addChildData['merchantId'] = $this->merchantId;
+					$addChildData['merchantId'] = $this->sjId;
 					$addChildData['menuOrder'] = $childOrder;
 					$addChildData['menuOption'] = $childWxMenuOption;
 					$addChildData['name'] = $childName;
-					$addChildData['menuKey'] = $this->merchantId . '_' . $parentOrder . '_' . $childOrder;
+					$addChildData['menuKey'] = $this->sjId . '_' . $parentOrder . '_' . $childOrder;
 					$addChildData['createTime'] = $date;
 					$addChildData['replyType'] = $childValue['replyType'];
 					$addChildData['replyUrl'] = $childValue['replyUrl'];
 					if (!empty($wxMenuContent)) {
-						$formatData = xhWxMenuService::getFormatData($wxMenuContent, $childWxMenuOption, $this->merchant);
+						$formatData = xhWxMenuService::getFormatData($wxMenuContent, $childWxMenuOption, $this->sj);
 						$addChildData = array_merge($addChildData, $formatData);
 					}
 					xhWxMenuService::add($addChildData);
 				}
 			}
 		}
-		$wxMenu = xhWxMenuService::getMenuList($this->merchantId);
+		$wxMenu = xhWxMenuService::getMenuList($this->sjId);
 		if (empty($wxMenu)) {
 			util::fail('没有找到菜单');
 		}
@@ -99,7 +99,7 @@ class WxMenuController extends BaseController
 		}
 		
 		$subData['button'] = $menuData;
-		$wxUtil = new wxUtil($this->merchant);
+		$wxUtil = new wxUtil($this->sj);
 		$jsonData = $wxUtil->userMenuToWeiXin($subData);
 		$respond = json_decode($jsonData, true);
 		if ($respond['errcode'] == 0) {
@@ -111,7 +111,7 @@ class WxMenuController extends BaseController
 	//微信菜单 shish 2019.12.19
 	public function actionTree()
 	{
-		$list = WxMenuService::getMenuTree($this->merchantId);
+		$list = WxMenuService::getMenuTree($this->sjId);
 		util::success($list);
 	}
 	

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

@@ -14,7 +14,7 @@ class WxShareController extends BaseController
 	{
 		$url = Yii::$app->request->post('url');
 		$jsSDK = new jsSDK();//微信分享
-		$merchant = $this->merchant;
+		$merchant = $this->sj;
 		$return = $jsSDK->GetSignPackage($merchant, $url);
 		util::success($return);
 	}

+ 7 - 7
app/shop/controllers/AdController.php

@@ -17,7 +17,7 @@ class AdController extends BaseController
 		$get = Yii::$app->request->get();
 		$type = isset($get['type']) ? $get['type'] : 0;
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		$where['type'] = $type;
 		$where['delStatus'] = 0;
 		$list = AdService::getAdList($where);
@@ -28,7 +28,7 @@ class AdController extends BaseController
 	public function actionAdd()
 	{
 		$post = Yii::$app->request->post();
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		$ad = AdService::addAd($post);
 		$id = $ad['id'];
 		$info = AdService::getDetail($id);
@@ -58,7 +58,7 @@ class AdController extends BaseController
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$info = AdService::getById($id);
-		AdService::valid($info, $this->merchantId);
+		AdService::valid($info, $this->sjId);
 		AdService::clickAd($id);
 		util::complete();
 	}
@@ -69,7 +69,7 @@ class AdController extends BaseController
 		$post = Yii::$app->request->post();
 		$id = isset($post['id']) ? $post['id'] : 0;
 		$info = AdService::getById($id);
-		AdService::valid($info, $this->merchantId);
+		AdService::valid($info, $this->sjId);
 		AdService::updateAd($id, $post);
 		util::complete('修改成功');
 	}
@@ -79,7 +79,7 @@ class AdController extends BaseController
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$info = AdService::getById($id);
-		AdService::valid($info, $this->merchantId);
+		AdService::valid($info, $this->sjId);
 		AdService::deleteAd($id);
 		util::complete('删除成功');
 	}
@@ -90,7 +90,7 @@ class AdController extends BaseController
 		$id = Yii::$app->request->get('id', 0);
 		$status = Yii::$app->request->get('status', 1);
 		$info = AdService::getById($id);
-		AdService::valid($info, $this->merchantId);
+		AdService::valid($info, $this->sjId);
 		AdService::updateById($id, ['status' => $status]);
 		util::complete('操作成功');
 	}
@@ -109,7 +109,7 @@ class AdController extends BaseController
 		$id = Yii::$app->request->get('id', 0);
 		$inTurn = Yii::$app->request->get('inTurn', 0);
 		$info = AdService::getById($id);
-		AdService::valid($info, $this->merchantId);
+		AdService::valid($info, $this->sjId);
 		AdService::updateById($id, ['inTurn' => $inTurn]);
 		util::complete('操作成功');
 	}

+ 5 - 5
app/shop/controllers/AdminController.php

@@ -18,7 +18,7 @@ class AdminController extends BaseController
     //获取登陆员工的权限 shish 2019.11.24
     public function actionLoginAuth()
     {
-        $auth = AdminService::getAuth($this->adminId, $this->merchantId);
+        $auth = AdminService::getAuth($this->adminId, $this->sjId);
         util::success($auth);
     }
 
@@ -26,7 +26,7 @@ class AdminController extends BaseController
     public function actionAdd()
     {
         $post = Yii::$app->request->post();
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         $admin = AdminService::addAdmin($post);
         $id = $admin['id'];
         $info = AdminService::getDetail($id);
@@ -38,7 +38,7 @@ class AdminController extends BaseController
     {
         $id = Yii::$app->request->post('id');
         $admin = AdminClass::getById($id);
-        AdminService::valid($admin, $this->merchantId);
+        AdminService::valid($admin, $this->sjId);
         AdminService::deleteAdmin($admin, $this->adminId);
         util::complete();
     }
@@ -50,7 +50,7 @@ class AdminController extends BaseController
         $id = isset($post['id']) && is_numeric($post['id']) ? $post['id'] : 0;
         unset($post['id']);
         $originalAdmin = AdminService::getById($id);
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         AdminService::updateAdmin($originalAdmin, $post);
         util::complete('修改成功');
     }
@@ -60,7 +60,7 @@ class AdminController extends BaseController
     {
         $id = Yii::$app->request->get('id');
         $admin = AdminService::getDetail($id);
-        AdminService::valid($admin, $this->merchantId);
+        AdminService::valid($admin, $this->sjId);
         util::success($admin);
     }
 

+ 1 - 1
app/shop/controllers/AdminLogController.php

@@ -18,7 +18,7 @@ class AdminLogController extends BaseController
 		$startTime = isset($get['startTime']) ? $get['startTime'] : '';
 		$endTime = isset($get['endTime']) ? $get['endTime'] : '';
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		if ($adminId != -1) {
 			$where['adminId'] = $adminId;
 		}

+ 2 - 2
app/shop/controllers/AdminRoleAuthController.php

@@ -16,7 +16,7 @@ class AdminRoleAuthController extends BaseController
     {
         $roleId = Yii::$app->request->get('roleId', 0);
         $role = AdminRoleService::getById($roleId);
-        AdminRoleService::valid($role, $this->merchantId);
+        AdminRoleService::valid($role, $this->sjId);
         $roleAuth = AdminRoleAuthService::getByCondition(['roleId' => $roleId, 'endId' => 1]);
         $auth = isset($roleAuth['auth']) ? $roleAuth['auth'] : '';
         $ids = !empty($auth) ? explode(',', $auth) : [];
@@ -29,7 +29,7 @@ class AdminRoleAuthController extends BaseController
         $roleId = Yii::$app->request->post('roleId', 0);
         $authIdList = Yii::$app->request->post('authIdList', ['*']);
         $auth = AdminRoleAuthService::getByCondition(['roleId' => $roleId, 'endId' => 1]);
-        AdminRoleAuthService::valid($auth, $this->merchantId);
+        AdminRoleAuthService::valid($auth, $this->sjId);
         AdminRoleAuthService::updateByCondition(['roleId' => $roleId, 'endId' => 1], ['auth' => implode(',', $authIdList)]);
         util::complete();
     }

+ 4 - 4
app/shop/controllers/AdminRoleController.php

@@ -16,7 +16,7 @@ class AdminRoleController extends BaseController
 	//角色列表 shish 2019.12.9
 	public function actionList()
 	{
-		$list = AdminRoleService::getRoleList($this->merchantId);
+		$list = AdminRoleService::getRoleList($this->sjId);
 		util::success($list);
 	}
 	
@@ -24,7 +24,7 @@ class AdminRoleController extends BaseController
 	public function actionAdd()
 	{
 		$post = Yii::$app->request->post();
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		$respond = AdminRoleService::addRole($post);
 		util::success($respond);
 	}
@@ -36,7 +36,7 @@ class AdminRoleController extends BaseController
 		$id = isset($post['id']) ? $post['id'] : 0;
 		unset($post['id']);
 		$role = AdminRoleService::getById($id);
-		AdminRoleService::valid($role, $this->merchantId);
+		AdminRoleService::valid($role, $this->sjId);
 		AdminRoleService::updateRole($role, $post);
 		util::complete('修改成功');
 	}
@@ -46,7 +46,7 @@ class AdminRoleController extends BaseController
 	{
 		$id = Yii::$app->request->post('id', 0);
 		$role = AdminRoleService::getById($id);
-		AdminRoleService::valid($role, $this->merchantId);
+		AdminRoleService::valid($role, $this->sjId);
 		AdminRoleService::deleteRole($role);
 		util::complete('删除成功');
 	}

+ 2 - 2
app/shop/controllers/AgentAssetController.php

@@ -13,8 +13,8 @@ class AgentAssetController extends BaseController
 	//代理资产 shish 2019.12.26
 	public function actionDetail()
 	{
-		$detail = AgentAssetService::getDetail($this->merchantId);
-		$asset = MerchantAssetService::getByMerchantId($this->merchantId);
+		$detail = AgentAssetService::getDetail($this->sjId);
+		$asset = MerchantAssetService::getByMerchantId($this->sjId);
 		$detail['balance'] = isset($asset['balance']) ? $asset['balance'] : 0;
 		util::success($detail);
 	}

+ 3 - 3
app/shop/controllers/ApplyController.php

@@ -22,7 +22,7 @@ class ApplyController extends BaseController
 	{
 		$status = Yii::$app->request->get('status', 0);
 		$where = [];
-		$where['introMerchantId'] = $this->merchantId;
+		$where['introSjId'] = $this->sjId;
 		if ($status != -1) {
 			$where['status'] = $status;
 		}
@@ -57,8 +57,8 @@ class ApplyController extends BaseController
 		$get['adminId'] = $this->adminId;
 		$get['long'] = isset($get['longitude']) ? $get['longitude'] : '';
 		$get['lat'] = isset($get['latitude']) ? $get['latitude'] : '';
-		$introMerchantId = isset($get['introMerchantId']) && !empty($get['introMerchantId']) ? $get['introMerchantId'] : 0;
-		if (empty($introMerchantId)) {
+		$introSjId = isset($get['introSjId']) && !empty($get['introSjId']) ? $get['introSjId'] : 0;
+		if (empty($introSjId)) {
 			util::fail('只有邀请了才能注册哦~');
 		}
 		$mobile = isset($get['mobile']) && !empty($get['mobile']) && stringUtil::isMobile($get['mobile']) ? $get['mobile'] : 0;

+ 10 - 10
app/shop/controllers/BaseController.php

@@ -16,7 +16,7 @@ use common\components\util;
 class BaseController extends PublicController
 {
     public $admin, $adminId, $adminAvatar, $account;
-    public $merchantId = 0, $merchantName, $merchant, $merchantExtend, $merchantLogo, $signPackage, $shopId = 0;
+    public $sjId = 0, $sj, $sjExtend, $signPackage, $shopId = 0;
     public $appId;
     public $isWx = false;
     public $isLogin = false;
@@ -29,9 +29,9 @@ class BaseController extends PublicController
         //token验证
         //$adminId = jwt::getLoginId();
         $adminId = 18569;
-        $merchantId = 0;
-        $merchant = [];
-        $merchantExtend = [];
+        $sjId = 0;
+        $sj = [];
+        $sjExtend = [];
         $admin = [];
         if (empty($adminId)) {
             $this->validate = false;
@@ -51,9 +51,9 @@ class BaseController extends PublicController
                 if (empty($shop)) {
                     util::fail('您所管理的门店已经跑到月球上去了');
                 }
-                $merchantId = $shop['merchantId'];
-                $merchant = MerchantService::getMerchantById($merchantId);
-                $merchantExtend = MerchantExtendService::getByMerchantId($merchantId);
+                $sjId = $shop['merchantId'];
+                $sj = MerchantService::getMerchantById($sjId);
+                $sjExtend = MerchantExtendService::getByMerchantId($sjId);
             }
             $this->shopId = $shopId;
         }
@@ -66,9 +66,9 @@ class BaseController extends PublicController
         }
         $this->admin = $admin;
         $this->adminId = $adminId;
-        $this->merchantId = $merchantId;
-        $this->merchant = $merchant;
-        $this->merchantExtend = $merchantExtend;
+        $this->sjId = $sjId;
+        $this->sj = $sj;
+        $this->sjExtend = $sjExtend;
         return parent::beforeAction($action);
     }
 

+ 9 - 9
app/shop/controllers/CategoryController.php

@@ -19,7 +19,7 @@ class CategoryController extends BaseController
 	//分类列表
 	public function actionList()
 	{
-		$list = CategoryService::getCategoryList($this->merchantId);
+		$list = CategoryService::getCategoryList($this->sjId);
 		util::success($list);
 	}
 	
@@ -28,7 +28,7 @@ class CategoryController extends BaseController
 	{
 		$id = Yii::$app->request->get('categoryId', 0);
 		$category = CategoryService::getById($id);
-		CategoryService::valid($category, $this->merchantId);
+		CategoryService::valid($category, $this->sjId);
 		$info = CategoryService::getInfo($id);
 		util::success($info);
 	}
@@ -37,7 +37,7 @@ class CategoryController extends BaseController
 	public function actionAdd()
 	{
 		$post = Yii::$app->request->post();
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		$cat = CategoryService::addCategory($post);
 		util::success(['id' => $cat['id']]);
 	}
@@ -48,7 +48,7 @@ class CategoryController extends BaseController
 		$post = Yii::$app->request->post();
 		$categoryId = isset($post['categoryId']) ? $post['categoryId'] : 0;
 		$category = CategoryService::getById($categoryId);
-		CategoryService::valid($category, $this->merchantId);
+		CategoryService::valid($category, $this->sjId);
 		CategoryService::updateCategory($category, $post);
 		util::complete('修改成功');
 	}
@@ -60,7 +60,7 @@ class CategoryController extends BaseController
 		$categoryId = isset($get['categoryId']) ? $get['categoryId'] : 0;
 		$status = isset($get['status']) ? $get['status'] : 0;
 		$category = CategoryService::getById($categoryId);
-		CategoryService::valid($category, $this->merchantId);
+		CategoryService::valid($category, $this->sjId);
 		CategoryService::changeStatus($categoryId, $status);
 		util::complete();
 	}
@@ -71,7 +71,7 @@ class CategoryController extends BaseController
 		$get = Yii::$app->request->get();
 		$categoryId = isset($get['categoryId']) ? $get['categoryId'] : 0;
 		$category = CategoryService::getById($categoryId);
-		CategoryService::valid($category, $this->merchantId);
+		CategoryService::valid($category, $this->sjId);
 		CategoryService::deleteCategory($categoryId);
 		util::complete('删除成功');
 	}
@@ -81,9 +81,9 @@ class CategoryController extends BaseController
 	{
 		$categoryId = Yii::$app->request->get('categoryId');
 		//没有分类默认取商家第一个分类
-		$categoryId = !empty($categoryId) ? $categoryId : CategoryService::getTopCategoryId($this->merchantId);
+		$categoryId = !empty($categoryId) ? $categoryId : CategoryService::getTopCategoryId($this->sjId);
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		$where['cId'] = $categoryId;
 		$where['delStatus'] = 0;
 		$data = GoodsCategoryService::getGoodsList($where);
@@ -96,7 +96,7 @@ class CategoryController extends BaseController
 		$id = Yii::$app->request->get('id', 0);
 		$inTurn = Yii::$app->request->get('inTurn', 0);
 		$category = CategoryService::getById($id);
-		CategoryService::valid($category, $this->merchantId);
+		CategoryService::valid($category, $this->sjId);
 		CategoryService::updateById($id, ['inTurn' => $inTurn]);
 		util::complete();
 	}

+ 12 - 12
app/shop/controllers/ChatController.php

@@ -20,7 +20,7 @@ class ChatController extends BaseController
 		$get = Yii::$app->request->get();
 		$userId = isset($get['userId']) ? $get['userId'] : 0;
 		$user = UserService::getById($userId);
-		UserService::valid($user, $this->merchantId);
+		UserService::valid($user, $this->sjId);
 		return $this->renderPartial('index', ['userId' => $userId]);
 	}
 
@@ -29,12 +29,12 @@ class ChatController extends BaseController
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$user = UserService::getUserInfo($id);
-		UserService::valid($user, $this->merchantId);
+		UserService::valid($user, $this->sjId);
 		//新增最近联系人
-		ChatService::addRecentlyUser($this->merchantId, $id);
+		ChatService::addRecentlyUser($this->sjId, $id);
 		//获取最近联系人
-		$recentlyUser = ChatService::getRecentlyUserList($this->merchantId);
-		util::success(['merchant' => $this->merchant, 'user' => $user, 'recentlyUser' => $recentlyUser]);
+		$recentlyUser = ChatService::getRecentlyUserList($this->sjId);
+		util::success(['merchant' => $this->sj, 'user' => $user, 'recentlyUser' => $recentlyUser]);
 	}
 	
 	//绑定 shish 2019.12.28
@@ -42,11 +42,11 @@ class ChatController extends BaseController
 	{
 		$post = Yii::$app->request->post();
 		$clientId = isset($post['clientId']) ? $post['clientId'] : '';
-		$id = 'merchantChat_' . $this->merchantId;
+		$id = 'merchantChat_' . $this->sjId;
 		Gateway::bindUid($clientId, $id);
 		
 		//连接就将新消息置为已读
-		$consoleId = 'merchantConsole_' . $this->merchantId;
+		$consoleId = 'merchantConsole_' . $this->sjId;
 		$consoleOnline = Gateway::getClientIdByUid($consoleId);
 		if ($consoleOnline) {
 			$data = ['type' => 'newMessage', 'status' => 0];
@@ -66,7 +66,7 @@ class ChatController extends BaseController
 	{
 		$post = Yii::$app->request->post();
 		$clientId = isset($post['clientId']) ? $post['clientId'] : '';
-		$id = 'merchantConsole_' . $this->merchantId;
+		$id = 'merchantConsole_' . $this->sjId;
 		Gateway::bindUid($clientId, $id);
 	}
 	
@@ -77,7 +77,7 @@ class ChatController extends BaseController
 		$type = isset($post['type']) ? $post['type'] : 'text';
 		$userId = isset($post['userId']) ? $post['userId'] : 0;
 		$user = UserService::getById($userId);
-		UserService::valid($user, $this->merchantId);
+		UserService::valid($user, $this->sjId);
 		$arr = [];
 		$arr['type'] = $type;
 		$arr['source'] = 'merchant';
@@ -107,7 +107,7 @@ class ChatController extends BaseController
 				//商品
 				$id = $post['goodsId'];
 				$info = GoodsService::getGoodsInfo($id);
-				GoodsService::valid($info, $this->merchantId);
+				GoodsService::valid($info, $this->sjId);
 				$arr['goodsName'] = $info['goodsName'];
 				$arr['img'] = isset($info['smallImgList'][0]) ? $info['smallImgList'][0] : '';
 				$arr['price'] = isset($info['price']) ? $info['price'] : 300;
@@ -128,7 +128,7 @@ class ChatController extends BaseController
 	//最近联系人 shish 2019.12.29
 	public function actionRecentlyUser()
 	{
-		$respond = ChatService::getRecentlyUserList($this->merchantId);
+		$respond = ChatService::getRecentlyUserList($this->sjId);
 		util::success($respond);
 	}
 	
@@ -138,7 +138,7 @@ class ChatController extends BaseController
 		//商品 图片 快捷链接 文字
 		$id = Yii::$app->request->get('id');
 		$info = UserService::getById($id);
-		UserService::valid($info, $this->merchantId);
+		UserService::valid($info, $this->sjId);
 		$respond = ChatService::getMessageList($id);
 		util::success($respond);
 	}

+ 8 - 8
app/shop/controllers/ConsoleController.php

@@ -17,30 +17,30 @@ class ConsoleController extends BaseController
 	//概况 shish 2019.12.19
 	public function actionProfile()
 	{
-		$asset = MerchantAssetService::getByMerchantId($this->merchantId);
+		$asset = MerchantAssetService::getByMerchantId($this->sjId);
 		$notice = [
 			//['title' => '您还有10天试用期结束 ', 'action' => '立即续费', 'clickHint' => '请在手机上进行续费', 'url' => 'http://www.test.com'],
 		];
 		//今天访客数
-		$todayVisit = StatVisitService::getTodayVisitNum($this->merchantId);
+		$todayVisit = StatVisitService::getTodayVisitNum($this->sjId);
 		//今天客户与粉丝数
-		$userData = StatUserService::getTodayNum($this->merchantId);
+		$userData = StatUserService::getTodayNum($this->sjId);
 		$todayFansNum = isset($userData['riseFansNum']) ? $userData['riseFansNum'] : 0;
 		$todayUserNum = isset($userData['riseUserNum']) ? $userData['riseUserNum'] : 0;
 		//今天订单数
-		$orderData = StatOrderService::getTodayNum($this->merchantId);
+		$orderData = StatOrderService::getTodayNum($this->sjId);
 		$todayOrder = isset($orderData['riseNum']) ? $orderData['riseNum'] : 0;
 		//今天收入
-		$incomeData = StatIncomeService::getTodayNum($this->merchantId);
+		$incomeData = StatIncomeService::getTodayNum($this->sjId);
 		$todayIncome = isset($incomeData['amount']) ? $incomeData['amount'] : 0;
 		$todayData = ['visit' => $todayVisit, 'fans' => $todayFansNum, 'user' => $todayUserNum, 'income' => $todayIncome, 'order' => $todayOrder];
 		
 		//当月的收入
-		$currentMonthIncome = StatIncomeMonthService::getCurrentMonthIncome($this->merchantId);
+		$currentMonthIncome = StatIncomeMonthService::getCurrentMonthIncome($this->sjId);
 		//上个月收入
-		$previousMonthIncome = StatIncomeMonthService::getPreviousMonthIncome($this->merchantId);
+		$previousMonthIncome = StatIncomeMonthService::getPreviousMonthIncome($this->sjId);
 		//最近7天收入变化趋势
-		$latestIncome = StatIncomeService::getLatestSevenDay($this->merchantId);
+		$latestIncome = StatIncomeService::getLatestSevenDay($this->sjId);
 		$incomeStat = [
 			'month' => $currentMonthIncome,
 			'week' => 999,

+ 2 - 2
app/shop/controllers/CouponAssetController.php

@@ -12,7 +12,7 @@ class CouponAssetController extends BaseController
 	//详情 shish 2019.12.18
 	public function actionDetail()
 	{
-		$asset = CouponAssetService::getAsset($this->merchantId);
+		$asset = CouponAssetService::getAsset($this->sjId);
 		util::success($asset);
 	}
 
@@ -20,7 +20,7 @@ class CouponAssetController extends BaseController
 	public function actionUpdate()
 	{
 		$post = Yii::$app->request->post();
-		CouponAssetService::updateAsset($this->merchantId, $post);
+		CouponAssetService::updateAsset($this->sjId, $post);
 		util::complete('修改成功');
 	}
 

+ 2 - 2
app/shop/controllers/CouponController.php

@@ -20,13 +20,13 @@ class CouponController extends BaseController
 		$get = Yii::$app->request->get();
 		$status = isset($get['status']) ? $get['status'] : -1;
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		if ($status != -1) {
 			$where['status'] = $status;
 		}
 		$data = CouponService::getCouponList($where);
 		
-		$asset = CouponAssetService::getAsset($this->merchantId);
+		$asset = CouponAssetService::getAsset($this->sjId);
 		if (empty($asset)) {
 			util::fail('找不到优惠券初始数据');
 		}

+ 15 - 15
app/shop/controllers/GoodsController.php

@@ -36,10 +36,10 @@ class GoodsController extends BaseController
         if (isset($get['cId']) && $get['cId'] != -1) {
             $where['cId'] = $get['cId'];
         }
-        $where['merchantId'] = $this->merchantId;
+        $where['merchantId'] = $this->sjId;
         $where['delStatus'] = 0;
         $data = GoodsService::getGoodsList($where);
-        $asset = MerchantAssetService::getByMerchantId($this->merchantId);
+        $asset = MerchantAssetService::getByMerchantId($this->sjId);
         $data['MerchantAsset'] = $asset;
         util::success($data);
     }
@@ -48,7 +48,7 @@ class GoodsController extends BaseController
     public function actionAdd()
     {
         $data = Yii::$app->request->post();
-        $data['merchantId'] = $this->merchantId;
+        $data['merchantId'] = $this->sjId;
         $return = GoodsService::addGoods($data);
         $id = $return['id'];
         $info = GoodsService::getById($id);
@@ -69,8 +69,8 @@ class GoodsController extends BaseController
         $data = Yii::$app->request->post();
         $id = isset($data['id']) ? $data['id'] : 0;
         $info = GoodsService::getById($id);
-        GoodsService::valid($info, $this->merchantId);
-        $data['merchantId'] = $this->merchantId;
+        GoodsService::valid($info, $this->sjId);
+        $data['merchantId'] = $this->sjId;
         GoodsService::updateGoods($id, $data);
         util::complete();
     }
@@ -83,11 +83,11 @@ class GoodsController extends BaseController
         $inTurn = Yii::$app->request->get('inTurn', 0);
         //验证商品
         $info = GoodsService::getById($id);
-        GoodsService::valid($info, $this->merchantId);
+        GoodsService::valid($info, $this->sjId);
         if ($cId != 0) {
             //验证分类
             $category = CategoryService::getById($cId);
-            CategoryService::valid($category, $this->merchantId);
+            CategoryService::valid($category, $this->sjId);
             GoodsCategoryService::updateByCondition(['cId' => $cId, 'gId' => $id], ['inTurn' => $inTurn]);
         } else {
             GoodsService::updateById($id, ['inTurn' => $inTurn]);
@@ -101,7 +101,7 @@ class GoodsController extends BaseController
     {
         $id = Yii::$app->request->get('id', 0);
         $goods = GoodsService::getById($id);
-        GoodsService::valid($goods, $this->merchantId);
+        GoodsService::valid($goods, $this->sjId);
         GoodsService::deleteGoods($goods);
         util::complete();
     }
@@ -113,7 +113,7 @@ class GoodsController extends BaseController
         $id = isset($post['id']) ? $post['id'] : 0;
         $status = isset($post['status']) ? $post['status'] : 1;
         $info = GoodsService::getById($id);
-        GoodsService::valid($info, $this->merchantId);
+        GoodsService::valid($info, $this->sjId);
         GoodsService::changeStatus($id, $status);
         util::complete();
     }
@@ -135,7 +135,7 @@ class GoodsController extends BaseController
     //商品说明 shish 2019.12.8
     public function actionIntroduce()
     {
-        $set = GoodsSettingService::getByCondition(['merchantId' => $this->merchantId]);
+        $set = GoodsSettingService::getByCondition(['merchantId' => $this->sjId]);
         $introduce = $set['goodsIntroduce'];
         util::success(['introduce' => $introduce]);
     }
@@ -144,14 +144,14 @@ class GoodsController extends BaseController
     public function actionUpdateIntroduce()
     {
         $introduce = Yii::$app->request->post('introduce', '');
-        GoodsSettingService::updateByCondition(['merchantId' => $this->merchantId], ['goodsIntroduce' => $introduce]);
+        GoodsSettingService::updateByCondition(['merchantId' => $this->sjId], ['goodsIntroduce' => $introduce]);
         util::complete('提交成功');
     }
 
     //设置 shish 2019.12.8
     public function actionSetting()
     {
-        $return = GoodsSettingService::getSetting($this->merchantId);
+        $return = GoodsSettingService::getSetting($this->sjId);
         util::success($return);
     }
 
@@ -166,14 +166,14 @@ class GoodsController extends BaseController
             if (empty($festIdList)) {
                 util::fail('请选择节日');
             }
-            FestRiseService::deleteByCondition(['merchantId' => $this->merchantId]);
+            FestRiseService::deleteByCondition(['merchantId' => $this->sjId]);
             $add = [];
             foreach ($festIdList as $festId) {
-                $add[] = ['merchantId' => $this->merchantId, 'festId' => $festId];
+                $add[] = ['merchantId' => $this->sjId, 'festId' => $festId];
             }
             FestRiseService::batchAdd($add);
         }
-        GoodsSettingService::updateByCondition(['merchantId' => $this->merchantId], $post);
+        GoodsSettingService::updateByCondition(['merchantId' => $this->sjId], $post);
         util::complete('提交成功');
     }
 

+ 2 - 2
app/shop/controllers/InviteAssetController.php

@@ -15,7 +15,7 @@ class InviteAssetController extends BaseController
 	//详情 shish 2019.12.18
 	public function actionDetail()
 	{
-		$asset = InviteAssetService::getAsset($this->merchantId);
+		$asset = InviteAssetService::getAsset($this->sjId);
 		util::success($asset);
 	}
 
@@ -23,7 +23,7 @@ class InviteAssetController extends BaseController
 	public function actionUpdate()
 	{
 		$post = Yii::$app->request->post();
-		InviteAssetService::updateAsset($this->merchantId, $post);
+		InviteAssetService::updateAsset($this->sjId, $post);
 		util::complete('修改成功');
 	}
 

+ 3 - 3
app/shop/controllers/InviteController.php

@@ -20,7 +20,7 @@ class InviteController extends BaseController
 		$status = isset($get['status']) ? $get['status'] : -1;
 		$search = isset($get['search']) ? $get['search'] : '';
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		if ($status != -1) {
 			$where['status'] = $status;
 		}
@@ -40,7 +40,7 @@ class InviteController extends BaseController
 	{
 		$id = Yii::$app->request->get('id');
 		$invite = InviteService::getById($id);
-		InviteService::valid($invite, $this->merchantId);
+		InviteService::valid($invite, $this->sjId);
 		$detail = InviteService::getDetail($id);
 		util::success($detail);
 	}
@@ -50,7 +50,7 @@ class InviteController extends BaseController
 	{
 		$id = Yii::$app->request->get('id');
 		$invite = InviteService::getById($id);
-		InviteService::valid($invite, $this->merchantId);
+		InviteService::valid($invite, $this->sjId);
 		InviteService::give($invite);
 		util::complete();
 	}

+ 2 - 2
app/shop/controllers/MainController.php

@@ -27,7 +27,7 @@ class MainController extends BaseController
 			'msg' => 'aaaa',
 		));
 		
-		$id = 'merchantConsole_' . $this->merchantId;
+		$id = 'merchantConsole_' . $this->sjId;
 		$online = Gateway::getClientIdByUid($id);
 		if ($online) {
 			//直接发送
@@ -45,7 +45,7 @@ class MainController extends BaseController
 			'msg' => 'aaaa',
 		));
 		
-		$id = 'merchantConsole_' . $this->merchantId;
+		$id = 'merchantConsole_' . $this->sjId;
 		$online = Gateway::getClientIdByUid($id);
 		if ($online) {
 			//直接发送

+ 2 - 2
app/shop/controllers/MallAuthController.php

@@ -136,8 +136,8 @@ class MallAuthController extends PublicController
 		if (empty($code)) {
 			util::fail('没有CODE信息');
 		}
-		$merchant = $this->merchant;
-		$account = $this->merchantId;
+		$merchant = $this->sj;
+		$account = $this->sjId;
 		$appId = $merchant['miniAppId'];
 		$appSecret = $merchant['miniAppSecret'];
 		if (empty($appSecret)) {

+ 3 - 3
app/shop/controllers/MallBaseController.php

@@ -40,10 +40,10 @@ class MallBaseController extends PublicController
 		if (empty($merchant)) {
 			util::fail('商家信息无效');
 		}
-		$this->merchantId = $merchantId;
-		$this->merchant = $merchant;
+		$this->sjId = $merchantId;
+		$this->sj = $merchant;
 		$this->shopId = $shopId;
-		$this->merchantExtend = MerchantExtendService::getByMerchantId($merchantId);
+		$this->sjExtend = MerchantExtendService::getByMerchantId($merchantId);
 		$this->isWx = util::isWx();
 
 		//收集访问量

+ 3 - 3
app/shop/controllers/MallCategoryController.php

@@ -14,7 +14,7 @@ class MallCategoryController extends BaseController
 	//获取分类 shish 2019.12.2
 	public function actionList()
 	{
-		$return = CategoryService::getEnableList($this->merchantId);
+		$return = CategoryService::getEnableList($this->sjId);
 		util::success($return);
 	}
 	
@@ -23,9 +23,9 @@ class MallCategoryController extends BaseController
 	{
 		$categoryId = Yii::$app->request->get('categoryId');
 		//没有分类默认取商家第一个分类
-		$categoryId = !empty($categoryId) ? $categoryId : CategoryService::getTopCategoryId($this->merchantId);
+		$categoryId = !empty($categoryId) ? $categoryId : CategoryService::getTopCategoryId($this->sjId);
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		$where['cId'] = $categoryId;
 		$where['delStatus'] = 0;
 		$data = GoodsCategoryService::getGoodsList($where);

+ 6 - 6
app/shop/controllers/MallChatController.php

@@ -32,8 +32,8 @@ class MallChatController extends BaseController
 	public function actionBegin()
 	{
 		//新增最近联系人
-		ChatService::addRecentlyUser($this->merchantId, $this->userId);
-		util::success(['merchant' => $this->merchant, 'user' => $this->user]);
+		ChatService::addRecentlyUser($this->sjId, $this->userId);
+		util::success(['merchant' => $this->sj, 'user' => $this->user]);
 	}
 
 	//发消息给老板 shish 2019.12.28
@@ -70,7 +70,7 @@ class MallChatController extends BaseController
 				//商品
 				$id = $post['goodsId'];
 				$info = GoodsService::getGoodsInfo($id);
-				GoodsService::valid($info, $this->merchantId);
+				GoodsService::valid($info, $this->sjId);
 				$arr['goodsName'] = $info['goodsName'];
 				$arr['img'] = isset($info['smallImgList'][0]) ? $info['smallImgList'][0] : '';
 				$arr['price'] = isset($info['price']) ? $info['price'] : 300;
@@ -78,8 +78,8 @@ class MallChatController extends BaseController
 		}
 		$data[] = $arr;
 		
-		$id = 'merchantChat_' . $this->merchantId;
-		$merchantId = $this->merchantId;
+		$id = 'merchantChat_' . $this->sjId;
+		$merchantId = $this->sjId;
 		$userId = $this->userId;
 		$chatOnline = Gateway::getClientIdByUid($id);
 		if ($chatOnline) {
@@ -88,7 +88,7 @@ class MallChatController extends BaseController
 			util::success($data);
 		}
 		//有打开后台但没打开聊天框,通知有新消息
-		$consoleId = 'merchantConsole_' . $this->merchantId;
+		$consoleId = 'merchantConsole_' . $this->sjId;
 		$consoleOnline = Gateway::getClientIdByUid($consoleId);
 		if ($consoleOnline) {
 			$data = ['type' => 'newMessage', 'status' => 1];

+ 2 - 2
app/shop/controllers/MallExpressController.php

@@ -21,8 +21,8 @@ class MallExpressController extends BaseController
 		if (empty($lng) || empty($lat)) {
 			util::fail('经度或纬度不能为空');
 		}
-		$shopId = ShopService::getDefaultShopId($this->merchant);
-		$respond = ExpressService::getUserDistance($lng, $lat, $shopId, $this->merchantExtend);
+		$shopId = ShopService::getDefaultShopId($this->sj);
+		$respond = ExpressService::getUserDistance($lng, $lat, $shopId, $this->sjExtend);
 		util::success($respond);
 	}
 

+ 2 - 2
app/shop/controllers/MallGoodsController.php

@@ -18,8 +18,8 @@ class MallGoodsController extends BaseController
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$info = GoodsService::getGoodsInfo($id);
-		GoodsService::valid($info, $this->merchantId);
-		$setting = GoodsSettingService::getByCondition(['merchantId' => $this->merchantId]);
+		GoodsService::valid($info, $this->sjId);
+		$setting = GoodsSettingService::getByCondition(['merchantId' => $this->sjId]);
 		$commonIntro = isset($setting['goodsIntroduce']) ? $setting['goodsIntroduce'] : '';
 		$info['commonIntro'] = $commonIntro;
 		util::success($info);

+ 1 - 1
app/shop/controllers/MallInformUserController.php

@@ -34,7 +34,7 @@ class MallInformUserController extends BaseController
 		} else {
 			util::fail('发送失败');
 		}
-		sms::send($mobile, $msg, $this->merchant);
+		sms::send($mobile, $msg, $this->sj);
 		util::complete('已发送');
 	}
 

+ 1 - 1
app/shop/controllers/MallInviteController.php

@@ -24,7 +24,7 @@ class MallInviteController extends BaseController
 	public function actionProfile()
 	{
 		$stat = InviteStatService::getStat($this->userId);
-		$asset = InviteAssetService::getAsset($this->merchantId);
+		$asset = InviteAssetService::getAsset($this->sjId);
 		util::success(['stat' => $stat, 'asset' => $asset]);
 	}
 	

+ 2 - 2
app/shop/controllers/MallMainController.php

@@ -15,7 +15,7 @@ class MallMainController extends BaseController
 	//首页 shish 2019.12.2
 	public function actionIndex()
 	{
-		$where = ['merchantId' => $this->merchantId, 'type' => 0, 'status' => 1, 'delStatus' => 0];
+		$where = ['merchantId' => $this->sjId, 'type' => 0, 'status' => 1, 'delStatus' => 0];
 		$adRespond = AdService::getAdList($where);
 		$ad = [];
 		if (isset($adRespond['list']) && !empty($adRespond['list'])) {
@@ -23,7 +23,7 @@ class MallMainController extends BaseController
 				$ad[] = ['adImg' => $single['adImgUrl'], 'url' => ''];
 			}
 		}
-		$category = CategoryService::getTopThreeCategory($this->merchantId);
+		$category = CategoryService::getTopThreeCategory($this->sjId);
 		$categoryList = !empty($category) ? GoodsCategoryService::getAppointCategoryList($category) : [];
 		$data = ['ad' => $ad, 'category' => $categoryList, 'columnStyle' => rand(1, 2)];
 		util::success($data);

+ 3 - 3
app/shop/controllers/MallMerchantController.php

@@ -15,7 +15,7 @@ class MallMerchantController extends BaseController
 	//当前用户获取门店信息
 	public function actionGetShopInfo()
 	{
-		$merchant = $this->merchant;
+		$merchant = $this->sj;
 		$merchant['defaultShop'] = ShopService::getDefaultShopInfo($merchant);
 		util::success($merchant);
 	}
@@ -23,14 +23,14 @@ class MallMerchantController extends BaseController
 	//当前用户获取商家信息
 	public function actionGetInfo()
 	{
-		$merchant = MerchantService::getInfo($this->merchant, $this->merchantExtend);
+		$merchant = MerchantService::getInfo($this->sj, $this->sjExtend);
 		util::success($merchant);
 	}
 
 	//客户的会员等级 shish 2020.1.2
 	public function actionUserGrade()
 	{
-		$list = MerchantExtendService::getGradeList($this->merchantExtend, 'asc', false);
+		$list = MerchantExtendService::getGradeList($this->sjExtend, 'asc', false);
 		util::success($list);
 	}
 	

+ 15 - 15
app/shop/controllers/MallOrderController.php

@@ -58,7 +58,7 @@ class MallOrderController extends BaseController
         $post['bookMobile'] = $bookMobile;
 
         $post['payWay'] = $this->isWx == true ? 0 : 1;
-        $defaultShopId = MerchantService::getDefaultShopId($this->merchant);
+        $defaultShopId = MerchantService::getDefaultShopId($this->sj);
         if (empty($defaultShopId)) {
             util::fail('没有找到门店');
         }
@@ -69,11 +69,11 @@ class MallOrderController extends BaseController
         if ($freightType == 0 && $needSend == 1) {
             $lat = $post['latitude'];//收货人纬度
             $lng = $post['longitude'];//收货人经度
-            $respond = ExpressService::getUserDistance($lng, $lat, $defaultShopId, $this->merchantExtend);
+            $respond = ExpressService::getUserDistance($lng, $lat, $defaultShopId, $this->sjExtend);
             $sendCost = isset($respond['fee']) ? $respond['fee'] : 0;
         }
         $post['sendCost'] = $sendCost;
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         $post['shopId'] = $defaultShopId;
 
         //计算总金额
@@ -118,7 +118,7 @@ class MallOrderController extends BaseController
             'orderId' => $orderId,
             'goodsId' => $goodsId,
             'userId' => $this->userId,
-            'merchantId' => $this->merchantId,
+            'merchantId' => $this->sjId,
             'title' => $goodsInfo['goodsName'],
             'cover' => isset($goodsInfo['shortImgList']) && !empty($goodsInfo['shortImgList']) ? current($goodsInfo['shortImgList']) : '',
             'unitPrice' => $unitPrice,
@@ -135,10 +135,10 @@ class MallOrderController extends BaseController
     public function actionOrderRelate()
     {
         $regionTree = RegionService::tree();
-        $shop = ShopService::getDefaultShop($this->merchant);
-        $freight = MerchantExtendService::getFreight($this->merchantExtend);
+        $shop = ShopService::getDefaultShop($this->sj);
+        $freight = MerchantExtendService::getFreight($this->sjExtend);
         $mapKey = 'OFWBZ-2NTHP-EHNDD-LKWQY-GANM7-PXBJH';
-        $out = ['freight' => $freight, 'shop' => $shop, 'region' => $regionTree, 'txMapKey' => $mapKey, 'merchant' => $this->merchant];
+        $out = ['freight' => $freight, 'shop' => $shop, 'region' => $regionTree, 'txMapKey' => $mapKey, 'merchant' => $this->sj];
         util::success($out);
     }
 
@@ -227,7 +227,7 @@ class MallOrderController extends BaseController
         $input->SetTrade_type("JSAPI");
 
         //花卉宝代为申请的微信支付
-        $merchantExtend = $this->merchantExtend;
+        $merchantExtend = $this->sjExtend;
         if ($merchantExtend['wxPayApply'] == 1) {
             $input->SetSub_openid($openId);
         } else {
@@ -258,10 +258,10 @@ class MallOrderController extends BaseController
         ini_set('date.timezone', 'Asia/Shanghai');
         $post = Yii::$app->request->post();
         $payWay = isset($post['payWay']) ? $post['payWay'] : 0;
-        $shopId = !empty($this->shopId) ? $this->shopId : ShopService::getDefaultShopId($this->merchant);
+        $shopId = !empty($this->shopId) ? $this->shopId : ShopService::getDefaultShopId($this->sj);
         //验证门店是否有效
         $shopInfo = ShopService::getById($shopId);
-        ShopService::valid($shopInfo, $this->merchantId);
+        ShopService::valid($shopInfo, $this->sjId);
         $post['shopId'] = $shopId;
         //默认门店订单
         $store = isset($post['store']) ? $post['store'] : 1;
@@ -289,7 +289,7 @@ class MallOrderController extends BaseController
         $post['discountAmount'] = $discountData['discountAmount'];
         $post['actPrice'] = $actPrice;
         $post['payStyle'] = 0;
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         $now = time();
         $expireTime = $now + 300;//订单5分钟后过期
         $post['createTime'] = date("Y-m-d H:i:s", $now);
@@ -305,7 +305,7 @@ class MallOrderController extends BaseController
         $order = OrderService::addOrder($post);
         $orderId = $order['id'];
         $orderSn = $order['orderSn'];
-        $merchantId = $this->merchantId;
+        $merchantId = $this->sjId;
         if ($payWay == 0) {
             $orderId = $order['id'];
             $name = '购买商品';
@@ -342,7 +342,7 @@ class MallOrderController extends BaseController
             $input->SetTrade_type("JSAPI");
 
             //花卉宝代为申请的微信支付
-            $merchantExtend = $this->merchantExtend;
+            $merchantExtend = $this->sjExtend;
             if ($merchantExtend['wxPayApply'] == 1) {
                 $input->SetSub_openid($openId);
             } else {
@@ -447,7 +447,7 @@ class MallOrderController extends BaseController
         $post = Yii::$app->request->post();
         $id = $post['id'];
         $order = OrderService::getById($id);
-        OrderService::valid($order, $this->merchantId);
+        OrderService::valid($order, $this->sjId);
         if ($order['grade'] > 0) {
             util::fail('您已经评过了');
         }
@@ -467,7 +467,7 @@ class MallOrderController extends BaseController
         if (!empty($orderSn)) {
             $detail = OrderService::getOrderBySn($orderSn);
         }
-        OrderService::valid($detail, $this->merchantId);
+        OrderService::valid($detail, $this->sjId);
         util::success($detail);
     }
 

+ 15 - 15
app/shop/controllers/MallPayController.php

@@ -43,8 +43,8 @@ class MallPayController extends BaseController
 		$post['payWay'] = $this->isWx == true ? 0 : 1;
 		$lat2 = $post['receiveLat'];//收货人纬度
 		$lng2 = $post['receiveLong'];//收货人经度
-		$lat1 = $this->merchant['shopLat'];//花店纬度
-		$lng1 = $this->merchant['shopLong'];//花店经度
+		$lat1 = $this->sj['shopLat'];//花店纬度
+		$lng1 = $this->sj['shopLong'];//花店经度
 		$calcDistance = util::getDistance($lat1, $lng1, $lat2, $lng2);//防止别人改动,PHP计算的距离会比腾讯js算的小,但能保证有一定准确性
 		$post['sendDistance'] = $post['sendDistance'] >= $calcDistance ? $post['sendDistance'] : $calcDistance;//二地距离
 		$sendDistance = $post['sendDistance'];
@@ -60,7 +60,7 @@ class MallPayController extends BaseController
 			$addPrice = intval($subDistance / $nextDistance) * $nextPrice;
 			$post['sendCost'] = $firstPrice + $addPrice;
 		}
-		if (empty($this->merchantExtend['payment'])) {
+		if (empty($this->sjExtend['payment'])) {
 			util::fail('支付功能未开通,暂时无法购买哦~');
 		}
 		$couponAmount = 0;
@@ -78,9 +78,9 @@ class MallPayController extends BaseController
 		}
 		//不要将代金劵保存到订单表,付款成功后再保存进去!!!
 		unset($post['couponId']);
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		//店铺id
-		$post['shopId'] = $this->merchant['defaultShopId'];
+		$post['shopId'] = $this->sj['defaultShopId'];
 		$order = xhOrderService::add($post);//创建订单
 		if ($order == false) {
 			util::fail('创建订单失败');
@@ -124,7 +124,7 @@ class MallPayController extends BaseController
 				'orderId' => $orderId,
 				'goodsId' => $goodsId,
 				'userId' => $userId,
-				'merchantId' => $this->merchantId,
+				'merchantId' => $this->sjId,
 				'title' => $goods['goodsName'],
 				'cover' => $goods['cover'],
 				'unitPrice' => $price,
@@ -148,7 +148,7 @@ class MallPayController extends BaseController
 		$userAsset = xhUserAssetService::getByUserId($userId);
 		$level = $userAsset['member'];
 		if ($level > 0) {
-			$gradeList = xhMerchantExtendService::getGradeList($this->merchantExtend);
+			$gradeList = xhMerchantExtendService::getGradeList($this->sjExtend);
 			$discount = $gradeList[$level]['discount'];
 			$discount = strlen($discount) == 1 ? $discount * 10 : $discount;
 			$totalFee = number_format($discount * $totalFee / 100, 2);
@@ -167,7 +167,7 @@ class MallPayController extends BaseController
 		//来源 0自建商城 1门店 2微信朋友圈 3淘宝
 		$sourceType = isset($post['sourceType']) ? $post['sourceType'] : 0;
 		$shopInfo = xhShop::find()->where(['id' => $shopId])->one();
-		if (empty($shopInfo) || $shopInfo->merchantId != $this->merchantId) {
+		if (empty($shopInfo) || $shopInfo->merchantId != $this->sjId) {
 			util::fail('门店无效');
 		}
 		
@@ -177,7 +177,7 @@ class MallPayController extends BaseController
 		
 		$userAsset = xhUserAssetService::getByUserId($this->userId);
 		$level = isset($userAsset['member']) ? $userAsset['member'] : 0;
-		$merchantExtend = xhMerchantExtendService::getByMerchantId($this->merchantId);
+		$merchantExtend = xhMerchantExtendService::getByMerchantId($this->sjId);
 		$memberIntegral = xhMerchantExtendService::getGradeList($merchantExtend, 'desc');
 		Yii::info(json_encode($merchantExtend));
 		Yii::info(json_encode($memberIntegral));
@@ -201,7 +201,7 @@ class MallPayController extends BaseController
 		}
 		$post['actPrice'] = $actPrice;
 		$post['payStyle'] = 0;
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		$now = time();
 		$expireTime = $now + 1800;//订单30分钟后过期
 		$post['createTime'] = date("Y-m-d H:i:s", $now);
@@ -229,7 +229,7 @@ class MallPayController extends BaseController
 			$post['modPriceStatus'] = 1;//微信已经提交不能再修改价格
 		}
 		$post['sourceType'] = $sourceType;
-		$post['id'] = stringUtil::generateOrderNo($this->merchantId, $this->userId);
+		$post['id'] = stringUtil::generateOrderNo($this->sjId, $this->userId);
 		$payment = xhOrderService::add($post);
 		$orderId = $payment['id'];
 
@@ -241,7 +241,7 @@ class MallPayController extends BaseController
 		if ($this->isWx) {
 			$userId = $post['userId'];
 			$user = xhUserService::getById($userId);
-			if ($user['merchantId'] != $this->merchantId) {
+			if ($user['merchantId'] != $this->sjId) {
 				util::fail('非法用户');
 			}
 			$openId = $user['openId'];
@@ -263,7 +263,7 @@ class MallPayController extends BaseController
 			
 			
 			//服务商 代设置微信支付,要添加的参数设置
-			if ($this->merchantExtend['wxPayApply'] == 1) {
+			if ($this->sjExtend['wxPayApply'] == 1) {
 				//$input->SetOpenid($openId);
 				$input->SetSub_openid($openId);
 				//自设置 微信支付
@@ -271,9 +271,9 @@ class MallPayController extends BaseController
 				$input->SetOpenid($openId);
 			}
 			
-			$wxOrder = \WxPayApi::unifiedOrder($input, 6, $this->merchantExtend);
+			$wxOrder = \WxPayApi::unifiedOrder($input, 6, $this->sjExtend);
 			$tools = new \JsApiPay();
-			$jsApiParameters = $tools->GetJsApiParameters($wxOrder, $this->merchantExtend);
+			$jsApiParameters = $tools->GetJsApiParameters($wxOrder, $this->sjExtend);
 			$newParams = json_decode($jsApiParameters, true);
 			$newParams['orderId'] = $orderId;
 			util::success($newParams);

+ 2 - 2
app/shop/controllers/MallPaymentController.php

@@ -34,7 +34,7 @@ class MallPaymentController extends MobileendController
         $payAdd['payStyle']		= configDict::getConfig('payStyle','weixinPay');
         $payAdd['payStatus']	= 0;
         $payAdd['userId']		= 0; //订单所有者(默认为0,未定) $this->userId
-        $payAdd['merchantId']	= $this->merchantId;
+        $payAdd['merchantId']	= $this->sjId;
         $payAdd['createTime']	= date("Y-m-d H:i:s", $now);
         $payAdd['deadline']		= $expireTime;
         xhOrderService::formatPost($payAdd, $post);
@@ -42,7 +42,7 @@ class MallPaymentController extends MobileendController
         $payAdd['actPrice']		= $amount;
         $order = xhOrderService::add($payAdd);
         $payId = $order['id'];
-		return $this->renderPartial('orderGenerate', ['payId'=>$payId, 'goodName'=>$post['orderName'], 'price'=>$post['price'], 'logo'=>$this->merchant['logo']]);
+		return $this->renderPartial('orderGenerate', ['payId'=>$payId, 'goodName'=>$post['orderName'], 'price'=>$post['price'], 'logo'=>$this->sj['logo']]);
 	}
 
 }

+ 2 - 2
app/shop/controllers/MallPublicController.php

@@ -24,8 +24,8 @@ class MallPublicController extends baseController
 		$header = httpUtil::getHeader();
 		$account = isset($header['account']) ? $header['account'] : 0;
 		if (!empty($account)) {
-			$this->merchantId = $account;
-			$this->merchant = MerchantService::getMerchantById($account);
+			$this->sjId = $account;
+			$this->sj = MerchantService::getMerchantById($account);
 		}
 		return parent::beforeAction($action);
 	}

+ 3 - 3
app/shop/controllers/MallRechargeController.php

@@ -17,9 +17,9 @@ class MallRechargeController extends BaseController
 	public function actionLaunch()
 	{
 		$rechargeAmount = Yii::$app->request->get('amount', 1);
-		$account = $this->merchantId;
-		$merchant = $this->merchant;
-		$extend = $this->merchantExtend;
+		$account = $this->sjId;
+		$merchant = $this->sj;
+		$extend = $this->sjExtend;
 		$user = $this->user;
 		ini_set('date.timezone', 'Asia/Shanghai');
 		if ($rechargeAmount <= 0) {

+ 2 - 2
app/shop/controllers/MallShopController.php

@@ -20,9 +20,9 @@ class MallShopController extends BaseController
 	public function actionDetail()
 	{
 		$introUserId = Yii::$app->request->get('introUserId');
-		$merchant = $this->merchant;
+		$merchant = $this->sj;
 		$shop = ShopService::getDefaultShop($merchant);
-		$ad = AdService::getValidAdList($this->merchantId);
+		$ad = AdService::getValidAdList($this->sjId);
 		
 		//新人专享礼物
 		$newUserGift = [];

+ 7 - 7
app/shop/controllers/MallUserController.php

@@ -35,8 +35,8 @@ class MallUserController extends BaseController
 		$post = Yii::$app->request->post();
 		$iv = isset($post['iv']) ? $post['iv'] : '';
 		$encryptedData = isset($post['encryptedData']) ? $post['encryptedData'] : '';
-		$appId = $this->merchant['miniAppId'];
-		$merchantId = $this->merchantId;
+		$appId = $this->sj['miniAppId'];
+		$merchantId = $this->sjId;
 		$miniOpenId = $this->user['miniOpenId'];
 		if (empty($miniOpenId)) {
 			util::fail('mini_open_id empty');
@@ -66,8 +66,8 @@ class MallUserController extends BaseController
 		$post = Yii::$app->request->post();
 		$iv = $post['iv'];
 		$encryptedData = $post['encryptedData'];
-		$merchantId = $this->merchantId;
-		$merchant = $this->merchant;
+		$merchantId = $this->sjId;
+		$merchant = $this->sj;
 		$appId = $merchant['miniAppId'];
 		$miniOpenId = $this->user['miniOpenId'];
 		$user = $this->user;
@@ -150,7 +150,7 @@ class MallUserController extends BaseController
 		if (isset($post['birthday']) && !empty($post['birthday'])) {
 			$update['birthday'] = $post['birthday'];
 		}
-		$user = UserService::getByCondition(['merchantId' => $this->merchantId, 'mobile' => $mobile]);
+		$user = UserService::getByCondition(['merchantId' => $this->sjId, 'mobile' => $mobile]);
 		if ($userId == $user['id']) {
 			util::fail('手机号已验证');
 		}
@@ -158,7 +158,7 @@ class MallUserController extends BaseController
 			util::fail('手机号已经注册过了');
 		}
 		$update['mobile'] = $mobile;
-		UserService::becomeMember($this->user, $this->merchant, $update);
+		UserService::becomeMember($this->user, $this->sj, $update);
 		util::complete('注册成功');
 	}
 	
@@ -167,7 +167,7 @@ class MallUserController extends BaseController
 	{
 		$user = UserService::getUserInfo($this->userId);
 		$growth = $user['userAsset']['growth'];
-		$extend = $this->merchantExtend;
+		$extend = $this->sjExtend;
 		$grade = MerchantExtendService::getGradeList($extend, 'asc');
 		//下个等级的积分
 		$nextLevelGrowth = 0;

+ 1 - 1
app/shop/controllers/MallWxShareController.php

@@ -14,7 +14,7 @@ class MallWxShareController extends BaseController
 	{
 		$url = Yii::$app->request->post('url');
 		$jsSDK = new jsSDK();//微信分享
-		$merchant = $this->merchant;
+		$merchant = $this->sj;
 		$return = $jsSDK->GetSignPackage($merchant, $url);
 		util::success($return);
 	}

+ 1 - 1
app/shop/controllers/MerchantCapitalController.php

@@ -13,7 +13,7 @@ class MerchantCapitalController extends BaseController
 	public function actionList()
 	{
 		$get = Yii::$app->request->get();
-		$where = ['merchantId' => $this->merchantId];
+		$where = ['merchantId' => $this->sjId];
 		$list = MerchantCapitalService::getCapitalList($where);
 		util::success($list);
 	}

+ 8 - 8
app/shop/controllers/MerchantController.php

@@ -18,26 +18,26 @@ class MerchantController extends BaseController
         $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->merchantId], ['freeDistance' => $first, 'freight' => $add]);
+        MerchantExtendService::updateByCondition(['merchantId' => $this->sjId], ['freeDistance' => $first, 'freight' => $add]);
         util::complete();
     }
 
     //商家信息 shish 2019.12.8
     public function actionDetail()
     {
-        $merchant = $this->merchant;
+        $merchant = $this->sj;
         if (empty($merchant)) {
             util::success([]);
         }
-        $merchant = MerchantService::getInfo($this->merchant, $this->merchantExtend);
+        $merchant = MerchantService::getInfo($this->sj, $this->sjExtend);
         util::success($merchant);
     }
 
     //商家现有的会员等级 shish 2019.12.12
     public function actionMemberLevel()
     {
-        $list = MerchantExtendService::getGradeList($this->merchantExtend, false, false);
-        $extend = $this->merchantExtend;
+        $list = MerchantExtendService::getGradeList($this->sjExtend, false, false);
+        $extend = $this->sjExtend;
         $gradeSwitch = isset($extend['gradeSwitch']) ? $extend['gradeSwitch'] : 1;
         util::success(['list' => $list, 'gradeSwitch' => $gradeSwitch]);
     }
@@ -45,7 +45,7 @@ class MerchantController extends BaseController
     //会员等级更新 shish 2019.12.18
     public function actionMemberLevelUpdate()
     {
-        $extend = $this->merchantExtend;
+        $extend = $this->sjExtend;
         if ($extend['gradeSwitch'] == 0) {
             util::fail('会员等级已设置不能修改');
         }
@@ -76,7 +76,7 @@ class MerchantController extends BaseController
             util::fail('请填写会员等级!');
         }
         $string = implode('I', $data);
-        MerchantExtendService::updateByCondition(['merchantId' => $this->merchantId], ['gradeList' => $string, 'gradeSwitch' => 0]);
+        MerchantExtendService::updateByCondition(['merchantId' => $this->sjId], ['gradeList' => $string, 'gradeSwitch' => 0]);
         util::complete('提交成功');
     }
 
@@ -90,7 +90,7 @@ class MerchantController extends BaseController
     //商家当前的权限id列表 shish 2020.1.23
     public function actionAuth()
     {
-        $merchant = $this->merchant;
+        $merchant = $this->sj;
         $setId = $merchant['setId'];
         $endId = 1;
         $ids = SetAuthService::getAuthIdList($setId, $endId);

+ 3 - 3
app/shop/controllers/MerchantRemarkController.php

@@ -15,7 +15,7 @@ class MerchantRemarkController extends BaseController
 	{
 		$id = Yii::$app->request->get('id');
 		$remark = MerchantRemarkService::getById($id);
-		MerchantRemarkService::valid($remark, $this->merchantId);
+		MerchantRemarkService::valid($remark, $this->sjId);
 		MerchantRemarkService::deleteById($id);
 		util::complete('删除成功');
 	}
@@ -30,9 +30,9 @@ class MerchantRemarkController extends BaseController
 			util::fail('请填写备注');
 		}
 		$user = UserService::getById($userId);
-		UserService::valid($user, $this->merchantId);
+		UserService::valid($user, $this->sjId);
 		$post['addTime'] = time();
-		$post['merchantId'] = $this->merchantId;
+		$post['merchantId'] = $this->sjId;
 		MerchantRemarkService::add($post);
 		util::complete('添加成功');
 	}

+ 12 - 12
app/shop/controllers/OrderController.php

@@ -24,7 +24,7 @@ class OrderController extends BaseController
 		$get = Yii::$app->request->get();
 		$search = isset($get['search']) ? $get['search'] : '';
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		if (isset($get['status']) && $get['status'] != -1) {
 			$where['status'] = $get['status'];
 		}
@@ -36,7 +36,7 @@ class OrderController extends BaseController
 			}
 		}
 		$list = OrderService::getOrderList($where);
-		$list['asset'] = MerchantAssetService::getByMerchantId($this->merchantId);
+		$list['asset'] = MerchantAssetService::getByMerchantId($this->sjId);
 		util::success($list);
 	}
 	
@@ -54,7 +54,7 @@ class OrderController extends BaseController
 		$post = Yii::$app->request->post();
 		$id = isset($post['id']) ? $post['id'] : 0;
 		$order = OrderService::getById($id);
-		OrderService::valid($order, $this->merchantId);
+		OrderService::valid($order, $this->sjId);
 		$categoryId = isset($post['categoryId']) ? $post['categoryId'] : $post['categoryId'];
 		$usageId = isset($post['usageId']) ? $post['usageId'] : $post['usageId'];
 		OrderService::classify($id, $categoryId, $usageId);
@@ -68,7 +68,7 @@ class OrderController extends BaseController
 		$id = isset($post['id']) ? $post['id'] : 0;
 		unset($post['id']);
 		$order = OrderService::getById($id);
-		OrderService::valid($order, $this->merchantId);
+		OrderService::valid($order, $this->sjId);
 		OrderService::updateSheet($order, $post);
 		util::complete('提交成功');
 	}
@@ -81,7 +81,7 @@ class OrderController extends BaseController
 		$payWay = isset($post['payWay']) && is_numeric($post['payWay']) ? $post['payWay'] : 0;
 		$userId = isset($post['userId']) ? $post['userId'] : 0;
 		$userInfo = UserService::getById($userId);
-		if (empty($userInfo) || $userInfo['merchantId'] != $this->merchantId) {
+		if (empty($userInfo) || $userInfo['merchantId'] != $this->sjId) {
 			util::fail('您选择的客户无效');
 		}
 		if ($price <= 0) {
@@ -94,7 +94,7 @@ class OrderController extends BaseController
 		$post['userId'] = $userId;
 		$post['goodsNum'] = 1;
 		$post['orderName'] = '商品';
-		$shopId = MerchantService::getDefaultShopId($this->merchant);
+		$shopId = MerchantService::getDefaultShopId($this->sj);
 		$post['shopId'] = $shopId;
 		$order = OrderService::addOrder($post);
 		$id = $order['id'];
@@ -125,7 +125,7 @@ class OrderController extends BaseController
 	{
 		$id = Yii::$app->request->get('id');
 		$order = OrderService::getById($id);
-		OrderService::valid($order, $this->merchantId);
+		OrderService::valid($order, $this->sjId);
 		//配送流程变更
 		$currentFlow = OrderSendClass::withoutSend($order);
 		util::success(['currentFlow' => $currentFlow]);
@@ -137,7 +137,7 @@ class OrderController extends BaseController
 		$id = Yii::$app->request->get('id');
 		$price = Yii::$app->request->get('price', 1);
 		$order = OrderService::getById($id);
-		OrderService::valid($order, $this->merchantId);
+		OrderService::valid($order, $this->sjId);
 		if (isset($order['modPrice']) && $order['modPrice'] == 0) {
 			util::fail('已发起支付,不能修改价格');
 		}
@@ -149,10 +149,10 @@ class OrderController extends BaseController
 	public function actionOrderRelate()
 	{
 		$regionTree = RegionService::tree();
-		$shop = ShopService::getDefaultShop($this->merchant);
-		$freight = MerchantExtendService::getFreight($this->merchantExtend);
+		$shop = ShopService::getDefaultShop($this->sj);
+		$freight = MerchantExtendService::getFreight($this->sjExtend);
 		$mapKey = 'OFWBZ-2NTHP-EHNDD-LKWQY-GANM7-PXBJH';
-		$out = ['freight' => $freight, 'shop' => $shop, 'region' => $regionTree, 'txMapKey' => $mapKey, 'merchant' => $this->merchant];
+		$out = ['freight' => $freight, 'shop' => $shop, 'region' => $regionTree, 'txMapKey' => $mapKey, 'merchant' => $this->sj];
 		util::success($out);
 	}
 	
@@ -161,7 +161,7 @@ class OrderController extends BaseController
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$order = OrderService::getById($id);
-		OrderService::valid($order, $this->merchantId);
+		OrderService::valid($order, $this->sjId);
 		$reachDate = isset($order['reachDate']) && !empty($order['reachDate']) ? $order['reachDate'] : '';
 		$reachPeriodId = $order['reachPeriod'];
 		$reachPeriodArr = [0 => '上午', 1 => '下午', 2 => '晚上'];

+ 5 - 5
app/shop/controllers/OrderSendController.php

@@ -15,7 +15,7 @@ class OrderSendController extends BaseController
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$order = OrderService::getById($id);
-		OrderService::valid($order, $this->merchantId);
+		OrderService::valid($order, $this->sjId);
 		$list = OrderSendService::sendList($order);
 		util::success($list);
 	}
@@ -27,7 +27,7 @@ class OrderSendController extends BaseController
 		$id = isset($post['id']) ? $post['id'] : 0;
 		$option = isset($post['option']) ? $post['option'] : 0;
 		$order = OrderService::getById($id);
-		OrderService::valid($order, $this->merchantId);
+		OrderService::valid($order, $this->sjId);
 		OrderSendService::printOrder(['id' => $id, 'option' => $option]);
 	}
 	
@@ -37,8 +37,8 @@ class OrderSendController extends BaseController
 		$post = Yii::$app->request->post();
 		$id = isset($post['id']) ? $post['id'] : 0;
 		$order = OrderService::getById($id);
-		OrderService::valid($order, $this->merchantId);
-		$post['merchantId'] = $this->merchantId;
+		OrderService::valid($order, $this->sjId);
+		$post['merchantId'] = $this->sjId;
 		OrderSendService::deliver($post);
 	}
 	
@@ -49,7 +49,7 @@ class OrderSendController extends BaseController
 		$id = isset($post['id']) ? $post['id'] : 0;
 		$option = isset($post['option']) ? $post['option'] : 0;
 		$order = OrderService::getById($id);
-		OrderService::valid($order, $this->merchantId);
+		OrderService::valid($order, $this->sjId);
 		OrderSendService::reach($order, ['option' => $option]);
 	}
 	

+ 9 - 9
app/shop/controllers/PicController.php

@@ -17,7 +17,7 @@ class PicController extends BaseController
     {
         $get = Yii::$app->request->get();
         $where = [];
-        $where['merchantId'] = $this->merchantId;
+        $where['merchantId'] = $this->sjId;
         $categoryId = isset($get['categoryId']) && is_numeric($get['categoryId']) ? $get['categoryId'] : -1;
         if ($categoryId != -1) {
             $where['categoryId'] = $get['categoryId'];
@@ -31,8 +31,8 @@ class PicController extends BaseController
     //上传图片 shish 2019.12.7
     public function actionAdd()
     {
-        $return = fileUtil::imgUpload($this->merchantId);
-        $merchantId = $this->merchantId;
+        $return = fileUtil::imgUpload($this->sjId);
+        $merchantId = $this->sjId;
         $time = time();
         $name = '未命名';
         $img = isset($return['shortUrl']) ? $return['shortUrl'] : '';
@@ -58,7 +58,7 @@ class PicController extends BaseController
         if (empty($categoryIdList)) {
             util::fail('请选择分类');
         }
-        $merchantHas = CategoryService::getCategoryIdList($this->merchantId);
+        $merchantHas = CategoryService::getCategoryIdList($this->sjId);
         $diff = array_diff($categoryIdList, $merchantHas);
         if (!empty($diff)) {
             util::fail('只能选择自己的分类');
@@ -66,13 +66,13 @@ class PicController extends BaseController
         $picList = PicService::getByIds($picIdList);
         $add = [];
         foreach ($picList as $picKey => $picVal) {
-            if ($picVal['merchantId'] != $this->merchantId) {
+            if ($picVal['merchantId'] != $this->sjId) {
                 util::fail('只能设置自己的图片');
             }
             $currentId = $picVal['id'];
             PicService::updateById($currentId, $post);
             foreach ($categoryIdList as $categoryId) {
-                $add[] = ['categoryId' => $categoryId, 'picId' => $currentId, 'merchantId' => $this->merchantId];
+                $add[] = ['categoryId' => $categoryId, 'picId' => $currentId, 'merchantId' => $this->sjId];
             }
             PicCategoryService::deleteByCondition(['picId' => $currentId]);
         }
@@ -85,7 +85,7 @@ class PicController extends BaseController
     {
         $id = Yii::$app->request->get('id', 0);
         $info = PicService::getById($id);
-        PicService::valid($info, $this->merchantId);
+        PicService::valid($info, $this->sjId);
         $pic = PicService::getPic($info);
         util::success($pic);
     }
@@ -95,7 +95,7 @@ class PicController extends BaseController
     {
         $id = Yii::$app->request->post('id', 0);
         $info = PicService::getById($id);
-        PicService::valid($info, $this->merchantId);
+        PicService::valid($info, $this->sjId);
         PicService::delPic($id);
         util::complete('删除成功');
     }
@@ -105,7 +105,7 @@ class PicController extends BaseController
     {
         $id = Yii::$app->request->post('id', 0);
         $info = PicService::getById($id);
-        PicService::valid($info, $this->merchantId);
+        PicService::valid($info, $this->sjId);
         PicService::top($info);
         util::complete();
     }

+ 1 - 1
app/shop/controllers/PurchaseClearController.php

@@ -14,7 +14,7 @@ class PurchaseClearController extends BaseController
 	{
 		$post = Yii::$app->request->post();
 		$ids = $post['id'];
-		$data['merchantId'] = $this->merchantId;
+		$data['merchantId'] = $this->sjId;
 		$data['id'] = $ids;
 		$respond = PurchaseClearClass::addClear($data);
 		util::success($respond);

+ 2 - 2
app/shop/controllers/PurchaseController.php

@@ -73,7 +73,7 @@ class PurchaseController extends BaseController
 	public function actionList()
 	{
 		$get = Yii::$app->request->get();
-		$where = ['merchantId' => $this->merchantId];
+		$where = ['merchantId' => $this->sjId];
 		$status = $get['status'] ?? 0;
 		if (!empty($status)) {
 			$where['status'] = $status;
@@ -108,7 +108,7 @@ class PurchaseController extends BaseController
 	{
 		$get = Yii::$app->request->get();
 		$where = [
-			'merchantId' => $this->merchantId,
+			'merchantId' => $this->sjId,
 			'debt' => PurchaseClass::DEBT_YES
 		];
 		$respond = PurchaseService::getDebtList($where);

+ 1 - 1
app/shop/controllers/RenewController.php

@@ -79,7 +79,7 @@ class RenewController extends BaseController
         $input->SetTrade_type("JSAPI");
 
         //花卉宝代为申请的微信支付
-        $merchantExtend = MerchantExtendService::getByMerchantId($this->merchantId);
+        $merchantExtend = MerchantExtendService::getByMerchantId($this->sjId);
         if ($merchantExtend['wxPayApply'] == 1) {
             $input->SetSub_openid($openId);
         } else {

+ 1 - 1
app/shop/controllers/ShopAdminController.php

@@ -19,7 +19,7 @@ class ShopAdminController extends BaseController
 		$post = Yii::$app->request->post();
 		$roleId = isset($post['roleId']) ? $post['roleId'] : 0;
 		$role = AdminRoleService::getById($roleId);
-		if (empty($role) || isset($role['merchantId']) != $this->merchantId) {
+		if (empty($role) || isset($role['merchantId']) != $this->sjId) {
 			util::fail('请选择角色!');
 		}
 		unset($post['userId']);

+ 13 - 13
app/shop/controllers/ShopController.php

@@ -16,7 +16,7 @@ class ShopController extends BaseController
 	public function actionList()
 	{
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		$where['delStatus'] = 0;
 		$list = ShopService::getShopList($where);
 		util::success($list);
@@ -26,11 +26,11 @@ class ShopController extends BaseController
 	public function actionUpdate()
 	{
 		$data = Yii::$app->request->post();
-		$data['merchantId'] = $this->merchantId;
+		$data['merchantId'] = $this->sjId;
 		$id = isset($data['id']) ? $data['id'] : 0;
 		unset($data['id']);
 		$shop = ShopService::getById($id);
-		ShopService::valid($shop, $this->merchantId);
+		ShopService::valid($shop, $this->sjId);
 		ShopService::updateShop($id, $data);
 		util::complete();
 	}
@@ -38,7 +38,7 @@ class ShopController extends BaseController
 	public function actionAdd()
 	{
 		$data = Yii::$app->request->post();
-		$data['merchantId'] = $this->merchantId;
+		$data['merchantId'] = $this->sjId;
 		ShopService::addShop($data);
 		util::complete();
 	}
@@ -48,8 +48,8 @@ class ShopController extends BaseController
 	{
 		$id = Yii::$app->request->get('id', 0);
 		$shop = ShopService::getById($id);
-		ShopService::valid($shop, $this->merchantId);
-		$gatheringCode = ShopService::generateGatheringCode($this->merchantId, $id);
+		ShopService::valid($shop, $this->sjId);
+		$gatheringCode = ShopService::generateGatheringCode($this->sjId, $id);
 		$file = dirUtil::getImgDir() . $gatheringCode;
 		if (file_exists($file) == false) {
 			util::fail('没有找到收款码');
@@ -67,13 +67,13 @@ class ShopController extends BaseController
 	public function actionGatheringMiniCode()
 	{
 		$id = Yii::$app->request->get('id', 0);
-		$extend = MerchantExtendService::getByMerchantId($this->merchantId);
+		$extend = MerchantExtendService::getByMerchantId($this->sjId);
 		if ($extend['miniAuth'] == 0) {
 			util::fail('您的小程序还没有授权');
 		}
 		$shop = ShopService::getById($id);
-		ShopService::valid($shop, $this->merchantId);
-		$applyMemberCode = wxUtil::generateGatheringMiniCode($this->merchant, $id);
+		ShopService::valid($shop, $this->sjId);
+		$applyMemberCode = wxUtil::generateGatheringMiniCode($this->sj, $id);
 		$file = dirUtil::getImgDir() . $applyMemberCode;
 		if (file_exists($file) == false) {
 			util::fail('没有找到注册会员码');
@@ -91,13 +91,13 @@ class ShopController extends BaseController
 	public function actionApplyMemberCode()
 	{
 		$id = Yii::$app->request->get('id', 0);
-		$extend = MerchantExtendService::getByMerchantId($this->merchantId);
+		$extend = MerchantExtendService::getByMerchantId($this->sjId);
 		if ($extend['miniAuth'] == 0) {
 			util::fail('您的小程序还没有授权');
 		}
 		$shop = ShopService::getById($id);
-		ShopService::valid($shop, $this->merchantId);
-		$applyMemberCode = wxUtil::generateMemberCode($this->merchant, $id);
+		ShopService::valid($shop, $this->sjId);
+		$applyMemberCode = wxUtil::generateMemberCode($this->sj, $id);
 		$file = dirUtil::getImgDir() . $applyMemberCode;
 		if (file_exists($file) == false) {
 			util::fail('没有找到注册会员码');
@@ -117,7 +117,7 @@ class ShopController extends BaseController
 		$id = Yii::$app->request->get('id', 0);
 		util::fail('功能开发中');
 		$shop = ShopService::getById($id);
-		ShopService::valid($shop, $this->merchantId);
+		ShopService::valid($shop, $this->sjId);
 		ShopService::deleteShop($shop);
 		util::complete();
 	}

+ 2 - 2
app/shop/controllers/SupplierController.php

@@ -16,7 +16,7 @@ class SupplierController extends BaseController
 	public function actionList()
 	{
 		$where = [];
-		$where['merchantId'] = $this->merchantId;
+		$where['merchantId'] = $this->sjId;
 		$respond = SupplierService::getSupplierList($where);
 		util::success($respond);
 	}
@@ -25,7 +25,7 @@ class SupplierController extends BaseController
 	public function actionDebtList()
 	{
 		$get = Yii::$app->request->get();
-		$where = ['merchantId' => $this->merchantId];
+		$where = ['merchantId' => $this->sjId];
 		$status = $get['status'] ?? 0;
 		if (!empty($status)) {
 			$where['status'] = $status;

+ 3 - 3
app/shop/controllers/UploadController.php

@@ -28,7 +28,7 @@ class UploadController extends BaseController
 		if (!empty($categoryIds)) {
 			$categoryList = CategoryService::getByIds($categoryIds);
 			foreach ($categoryList as $cat) {
-				if ($cat['merchantId'] != $this->merchantId) {
+				if ($cat['merchantId'] != $this->sjId) {
 					util::fail('请选择自己的分类');
 				}
 			}
@@ -37,7 +37,7 @@ class UploadController extends BaseController
 		//匹配出图片的格式
 		if (preg_match('/^(data:\s*image\/(\w+);base64,)/', $base64_image_content, $result)) {
 			$type = $result[2];
-			$merchantId = $this->merchantId;
+			$merchantId = $this->sjId;
 			$month = date("Ym");
 			$date = date("d");
 			$path = dirUtil::getImgUploadDir() . "/{$merchantId}/{$month}/{$date}/";
@@ -86,7 +86,7 @@ class UploadController extends BaseController
 				$currentId = $pic['id'];
 				$add = [];
 				foreach ($categoryIds as $cat) {
-					$add[] = ['categoryId' => $cat, 'picId' => $currentId, 'merchantId' => $this->merchantId];
+					$add[] = ['categoryId' => $cat, 'picId' => $currentId, 'merchantId' => $this->sjId];
 				}
 				PicCategoryService::batchAdd($add);
 			}

+ 16 - 16
app/shop/controllers/UserController.php

@@ -28,7 +28,7 @@ class UserController extends BaseController
         //组建where
         $type = isset($get['type']) ? $get['type'] : -1;
         $search = isset($get['search']) ? $get['search'] : '';
-        $where = ['merchantId' => $this->merchantId];
+        $where = ['merchantId' => $this->sjId];
         switch ($type) {
             case 1:
                 //粉丝
@@ -48,7 +48,7 @@ class UserController extends BaseController
             }
         }
         $list = UserService::getUserList($where);
-        $list['asset'] = MerchantAssetService::getByMerchantId($this->merchantId);
+        $list['asset'] = MerchantAssetService::getByMerchantId($this->sjId);
         util::success($list);
     }
 
@@ -57,7 +57,7 @@ class UserController extends BaseController
     {
         $userId = Yii::$app->request->get('userId');
         $info = UserService::getUserInfo($userId);
-        if (isset($info['merchantId']) == false || $this->merchantId != $info['merchantId']) {
+        if (isset($info['merchantId']) == false || $this->sjId != $info['merchantId']) {
             util::fail('没有权限');
         }
         util::success($info);
@@ -68,7 +68,7 @@ class UserController extends BaseController
     {
         $userId = Yii::$app->request->get('userId');
         $info = UserService::getFullUserInfo($userId);
-        UserService::valid($info, $this->merchantId);
+        UserService::valid($info, $this->sjId);
 
         $list = MerchantRemarkService::getRemarkList($userId);
         $info['remarkList'] = $list;
@@ -90,12 +90,12 @@ class UserController extends BaseController
         AdminService::verifyConfirmPassword($this->adminId, $confirmPassword);
 
         $mobile = $post['mobile'];
-        $user = UserService::getByMobile($mobile, $this->merchantId);
+        $user = UserService::getByMobile($mobile, $this->sjId);
         if (!empty($user)) {
             util::fail('手机号已使用');
         }
 
-        $post['merchantId'] = $this->merchantId;
+        $post['merchantId'] = $this->sjId;
         $post['member'] = $post['memberLevel'];
         UserService::addUser($post);
 
@@ -115,7 +115,7 @@ class UserController extends BaseController
         if (empty($user)) {
             util::fail('找不到客户');
         }
-        if ($user['merchantId'] != $this->merchantId) {
+        if ($user['merchantId'] != $this->sjId) {
             util::fail('您没有权限操作');
         }
         $userAsset = UserAssetService::getByUserId($userId);
@@ -123,8 +123,8 @@ class UserController extends BaseController
         $totalRecharge = $userAsset['totalRecharge'] + $rechargeAmount;
         $upData['balance'] = $totalBalance;
         $upData['totalRecharge'] = $totalRecharge;
-        $merchantAsset = MerchantAssetService::getByMerchantId($this->merchantId);
-        $return = xhRechargeService::recharge($rechargeAmount, $user, $this->adminId, $this->merchant, $this->merchantExtend, $merchantAsset);
+        $merchantAsset = MerchantAssetService::getByMerchantId($this->sjId);
+        $return = xhRechargeService::recharge($rechargeAmount, $user, $this->adminId, $this->sj, $this->sjExtend, $merchantAsset);
         if ($return['code'] == 'A0001') {
             util::complete();
         }
@@ -142,12 +142,12 @@ class UserController extends BaseController
             util::fail('客户不存在');
         }
         //验证是否商家客户
-        UserService::valid($user, $this->merchantId);
+        UserService::valid($user, $this->sjId);
         //验证确认密码
         $confirmPassword = $post['confirmPassword'];
         AdminService::verifyConfirmPassword($this->adminId, $confirmPassword);
 
-        $grade = xhMerchantExtendService::getGradeList($this->merchantExtend, 'desc');
+        $grade = xhMerchantExtendService::getGradeList($this->sjExtend, 'desc');
         //升级后的成长值
         $newLevelGrowth = $grade[$member]['growth'];
         $newDiscount = $grade[$member]['discount'];
@@ -173,7 +173,7 @@ class UserController extends BaseController
             $upgradeData = [
                 'member' => $member,
                 'prevMember' => $userAsset['member'],
-                'merchantId' => $this->merchantId,
+                'merchantId' => $this->sjId,
                 'gainType' => 0,
                 'addTime' => $now,
                 'userId' => $userId,
@@ -183,7 +183,7 @@ class UserController extends BaseController
             $growthData = [
                 'userId' => $userId,
                 'userName' => $user['userName'],
-                'merchantId' => $this->merchantId,
+                'merchantId' => $this->sjId,
                 'relateId' => $upgradeRespond['id'],
                 'growth' => $newLevelGrowth,
                 'num' => $addGrowth,
@@ -202,7 +202,7 @@ class UserController extends BaseController
             $transaction->rollBack();
             util::fail();
         }
-        $allTM = xhTMessageService::getList($this->merchantId);
+        $allTM = xhTMessageService::getList($this->sjId);
         $openId = isset($user['openId']) ? $user['openId'] : '';
         if (empty($openId)) {
             util::complete();
@@ -220,7 +220,7 @@ class UserController extends BaseController
                 "keyword2" => ["value" => $date, "color" => "#173177"],
                 "remark" => ["value" => "点击查看会员权益", "color" => "#173177"],
             ]];
-        wxUtil::sendTaskInform($data, $this->merchant);
+        wxUtil::sendTaskInform($data, $this->sj);
         util::complete();
     }
 
@@ -231,7 +231,7 @@ class UserController extends BaseController
         $userId = isset($post['userId']) ? $post['userId'] : 0;
         $password = isset($post['password']) ? $post['password'] : 0;
         $info = UserService::getById($userId);
-        UserService::valid($info, $this->merchantId);
+        UserService::valid($info, $this->sjId);
         UserService::updateById($userId, ['payPassword' => password_hash($password, PASSWORD_BCRYPT)]);
         util::complete();
     }

+ 10 - 10
app/shop/controllers/WxMenuController.php

@@ -20,7 +20,7 @@ class WxMenuController extends BaseController
 		util::fail('即将开通');
 
 		//删除原有菜单
-		xhWxMenuService::delMenuList($this->merchantId);
+		xhWxMenuService::delMenuList($this->sjId);
 		
 		$date = date("Y-m-d H:i:s");
 		foreach ($menu as $key => $val) {//一级菜单数据整理
@@ -29,17 +29,17 @@ class WxMenuController extends BaseController
 			$parentName = $val['name'];
 			$addData = [];
 			$addData['parentId'] = 0;
-			$addData['merchantId'] = $this->merchantId;
+			$addData['merchantId'] = $this->sjId;
 			$addData['menuOrder'] = $parentOrder;
 			$addData['menuOption'] = $parentWxMenuOption;
 			$addData['hasSonMenu'] = isset($val['children']) && !empty($val['children']) ? 1 : 0;
 			$addData['name'] = $parentName;
-			$addData['menuKey'] = $this->merchantId . '_' . $parentOrder;
+			$addData['menuKey'] = $this->sjId . '_' . $parentOrder;
 			$addData['createTime'] = $date;
 			$addData['replyType'] = $val['replyType'];
 			$addData['replyUrl'] = $val['replyUrl'];
 			if (!empty($wxMenuContent)) {
-				$formatData = xhWxMenuService::getFormatData($wxMenuContent, $parentWxMenuOption, $this->merchant);
+				$formatData = xhWxMenuService::getFormatData($wxMenuContent, $parentWxMenuOption, $this->sj);
 				$addData = array_merge($addData, $formatData);
 			}
 			$return = xhWxMenuService::add($addData);
@@ -56,23 +56,23 @@ class WxMenuController extends BaseController
 					$childName = $childValue['name'];
 					$addChildData = [];
 					$addChildData['parentId'] = $parentId;
-					$addChildData['merchantId'] = $this->merchantId;
+					$addChildData['merchantId'] = $this->sjId;
 					$addChildData['menuOrder'] = $childOrder;
 					$addChildData['menuOption'] = $childWxMenuOption;
 					$addChildData['name'] = $childName;
-					$addChildData['menuKey'] = $this->merchantId . '_' . $parentOrder . '_' . $childOrder;
+					$addChildData['menuKey'] = $this->sjId . '_' . $parentOrder . '_' . $childOrder;
 					$addChildData['createTime'] = $date;
 					$addChildData['replyType'] = $childValue['replyType'];
 					$addChildData['replyUrl'] = $childValue['replyUrl'];
 					if (!empty($wxMenuContent)) {
-						$formatData = xhWxMenuService::getFormatData($wxMenuContent, $childWxMenuOption, $this->merchant);
+						$formatData = xhWxMenuService::getFormatData($wxMenuContent, $childWxMenuOption, $this->sj);
 						$addChildData = array_merge($addChildData, $formatData);
 					}
 					xhWxMenuService::add($addChildData);
 				}
 			}
 		}
-		$wxMenu = xhWxMenuService::getMenuList($this->merchantId);
+		$wxMenu = xhWxMenuService::getMenuList($this->sjId);
 		if (empty($wxMenu)) {
 			util::fail('没有找到菜单');
 		}
@@ -99,7 +99,7 @@ class WxMenuController extends BaseController
 		}
 		
 		$subData['button'] = $menuData;
-		$wxUtil = new wxUtil($this->merchant);
+		$wxUtil = new wxUtil($this->sj);
 		$jsonData = $wxUtil->userMenuToWeiXin($subData);
 		$respond = json_decode($jsonData, true);
 		if ($respond['errcode'] == 0) {
@@ -111,7 +111,7 @@ class WxMenuController extends BaseController
 	//微信菜单 shish 2019.12.19
 	public function actionTree()
 	{
-		$list = WxMenuService::getMenuTree($this->merchantId);
+		$list = WxMenuService::getMenuTree($this->sjId);
 		util::success($list);
 	}
 	

+ 1 - 1
app/shop/controllers/WxShareController.php

@@ -14,7 +14,7 @@ class WxShareController extends BaseController
 	{
 		$url = Yii::$app->request->post('url');
 		$jsSDK = new jsSDK();//微信分享
-		$merchant = $this->merchant;
+		$merchant = $this->sj;
 		$return = $jsSDK->GetSignPackage($merchant, $url);
 		util::success($return);
 	}

+ 4 - 4
biz/saas/classes/ApplyClass.php

@@ -18,12 +18,12 @@ class ApplyClass extends BaseClass
     public static function addApply($data)
     {
         //邀请人数+1
-        $introMerchantId = isset($data['introMerchantId']) ? $data['introMerchantId'] : '';
-        if (!empty($introMerchantId)) {
-            $agent = AgentAssetClass::getByCondition(['merchantId' => $introMerchantId], true);
+        $introSjId = isset($data['introSjId']) ? $data['introSjId'] : '';
+        if (!empty($introSjId)) {
+            $agent = AgentAssetClass::getByCondition(['merchantId' => $introSjId], true);
             if (empty($agent)) {
                 $time = time();
-                $agent = AgentAssetClass::add(['merchantId' => $introMerchantId, 'addTime' => $time], true);
+                $agent = AgentAssetClass::add(['merchantId' => $introSjId, 'addTime' => $time], true);
             }
             $agent->inviteNum += 1;
             $agent->save();

+ 3 - 3
biz/saas/services/ApplyService.php

@@ -33,7 +33,7 @@ class ApplyService extends BaseService
 		$adminIdList = array_column($list, 'adminId');
 		$adminList = AdminService::getByIds($adminIdList, null, 'id');
 		//商家信息
-		$oldList = array_column($list, 'introMerchantId');
+		$oldList = array_column($list, 'introSjId');
 		$merchantIdList = array_column($list, 'merchantId');
 		$idList = array_merge($merchantIdList, $oldList);
 		$idList = array_unique(array_filter($idList));
@@ -43,7 +43,7 @@ class ApplyService extends BaseService
 		}
 		foreach ($list as $key => $val) {
 			$adminId = $val['adminId'];
-			$introMerchantId = $val['introMerchantId'];
+			$introSjId = $val['introSjId'];
 		}
 		$data['list'] = $list;
 		return $data;
@@ -109,7 +109,7 @@ class ApplyService extends BaseService
 		$dist = isset($data['dist']) ? $data['dist'] : '';
 		$floor = isset($data['floor']) ? $data['floor'] : '';
 		$data['fullAddress'] = $prefix . $dist . $currentAddress . $floor;
-		$data['introMerchantId'] = $merchantId;
+		$data['introSjId'] = $merchantId;
 		$data['introStyle'] = MerchantClass::STYLE_SUPPLIER;
 		$mobile = $data['mobile'];
 		noticeUtil::push('客户 ' . $mobile . ' 已由供货商提交开店资料,请及时跟进', '15280215347');

+ 1 - 1
common/components/util.php

@@ -297,7 +297,7 @@ class util
         self::encode(['code' => 1, 'msg' => $msg, 'data' => []]);
     }
 
-    public static function notLogin($msg = '没有登陆')
+    public static function notLogin($msg = '您还没有登陆')
     {
         self::encode(['code' => -1, 'msg' => $msg, 'data' => []]);
     }