shish 6 ani în urmă
părinte
comite
9d2c71e4c1

+ 2 - 2
app/mall/controllers/OrderController.php

@@ -205,7 +205,7 @@ class OrderController extends BaseController
 		$input->SetTime_start(date("YmdHis", $now));
 		$input->SetAttach($attach);//将流水类型、代金劵等传给微信再回传
 		$input->SetTime_expire(date("YmdHis", $expireTime));
-		$input->SetNotify_url(Yii::$app->params['mHost'] . '/notice/wx-callback/');
+		$input->SetNotify_url(Yii::$app->params['mallHost'] . '/notice/wx-callback/');
 		$input->SetTrade_type("JSAPI");
 		
 		//花卉宝代为申请的微信支付
@@ -309,7 +309,7 @@ class OrderController extends BaseController
 			$input->SetTime_start(date("YmdHis", $now));
 			$input->SetAttach($attach);
 			$input->SetTime_expire(date("YmdHis", $expireTime));//设置订单有效期5分钟
-			$input->SetNotify_url(Yii::$app->params['mHost'] . '/notice/wx-callback/');
+			$input->SetNotify_url(Yii::$app->params['mallHost'] . '/notice/wx-callback/');
 			$input->SetTrade_type("JSAPI");
 			
 			//花卉宝代为申请的微信支付

+ 2 - 2
app/saas/controllers/UserController.php

@@ -92,7 +92,7 @@ class UserController extends BaseController
 		}
 		$gatheringCode = isset($shop['gatheringCode']) ? $shop['gatheringCode'] : '';
 		$file = dirUtil::getImgDir() . $gatheringCode;
-		$url = Yii::$app->params['mDomain'] . "/#/pages/pay/index?account={$merchantId}&shopId=" . $id;
+		$url = Yii::$app->params['mallDomain'] . "/#/pages/pay/index?account={$merchantId}&shopId=" . $id;
 		$url = httpUtil::becomeHttps($url);
 		if (empty($gatheringCode) || file_exists($file) == false) {
 			//强制转成https
@@ -103,7 +103,7 @@ class UserController extends BaseController
 		echo '<br /><br />收款码<br /><br />';
 		echo "<img width='300' src='{$imgUrl}' /><br /><br />";
 		echo $url;
-		$mall = Yii::$app->params['mDomain'] . "/#/?account=" . $merchantId;
+		$mall = Yii::$app->params['mallDomain'] . "/#/?account=" . $merchantId;
 		echo "<br /><br />商城首页:<br />" . httpUtil::becomeHttps($mall);
 	}
 	

+ 1 - 1
app/saas/controllers/WxOpenController.php

@@ -181,7 +181,7 @@ class WxOpenController extends PublicController
         $oData['preAuthCodeTime'] = date("Y-m-d H:i:s");
         //设置预授码过期,让下个用户可以获取新的预授码
         xhWxOpenService::updateById(1, $oData);
-        $url = Yii::$app->params['wHost'] . '/wx-open-callback/' . $merchantId;
+        $url = Yii::$app->params['saasHost'] . '/wx-open-callback/' . $merchantId;
         echo "<a href='https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid={$appId}&pre_auth_code={$pre}&redirect_uri={$url}&auth_type={$authType}'>授权</a>";
     }
 

+ 1 - 8
app/www/controllers/MerchantController.php

@@ -48,12 +48,5 @@ class MerchantController extends BaseController
 		$data = ['merchantName' => $merchantName, 'smallLogoUrl' => $smallLogoUrl, 'id' => $id, 'logoUrl' => $logoUrl, 'fullAddress' => '暂无'];
 		util::success($data);
 	}
-	
-	//平台帐号激活 shish 2020.2.15
-	public function actionAddPlatformMerchant()
-	{
-		MerchantService::initOpenMerchant();
-		echo 'ok';
-	}
-	
+
 }

+ 1 - 1
biz/merchant/classes/ShopClass.php

@@ -86,7 +86,7 @@ class ShopClass extends BaseClass
 	//生成收款码 shish 2020.3.9
 	public static function generateGatheringCode($merchantId, $shopId)
 	{
-		$url = Yii::$app->params['mDomain'] . "/#/pages/pay/index?account={$merchantId}&shopId=" . $shopId;
+		$url = Yii::$app->params['mallDomain'] . "/#/pages/pay/index?account={$merchantId}&shopId=" . $shopId;
 		//强制转成https
 		$url = httpUtil::becomeHttps($url);
 		$gatheringCode = qrCodeUtil::generateGatheringQrCode($url, $merchantId, $shopId, '', 10);

+ 190 - 208
biz/merchant/services/MerchantService.php

@@ -25,214 +25,196 @@ use Yii;
 
 class MerchantService extends BaseService
 {
-	
-	public static $baseFile = '\biz\merchant\classes\MerchantClass';
-	
-	//商家在业务端的权限 shish 2019.11.25
-	public static function getAuthIdList($merchantId, $endId)
-	{
-		$merchant = self::getById($merchantId);
-		$setId = $merchant['setId'];
-		if (empty($setId)) {
-			util::fail('没有找到商家的套餐');
-		}
-		
-		//业务端总共有哪些权限
-		$idList = AuthService::getListId($endId);
-		
-		//套餐在业务端有哪些权限
-		$setIdList = SetAuthService::getAuthIdList($setId, $endId);
-		
-		//有*号表示有所有的权限
-		$commonIdList = in_array('*', $setIdList) ? $idList : array_intersect($idList, $setIdList);
-		
-		return $commonIdList;
-		
-	}
-	
-	//获取默认门店
-	public static function getDefaultShopId($merchant)
-	{
-		$defaultShopId = isset($merchant['defaultShopId']) ? $merchant['defaultShopId'] : 0;
-		return $defaultShopId;
-	}
-	
-	//商家基本信息,$sensitive true 除敏感信息 shish 2019.12.8
-	public static function getInfo($merchant, $extend, $sensitive = true)
-	{
-		if ($sensitive) {
-			$delete = ['miniAppId', 'miniAppSecret', 'wxAppId', 'wxAppSecret', 'openAppId', 'wxToken', 'wxJsApiTicket', 'wxAccessToken', 'wxRefreshToken'];
-			foreach ($delete as $del) {
-				unset($merchant[$del]);
-			}
-			$deleteExtend = ['miniAppId', 'miniAccessToken', 'miniRefreshToken', 'wxPayKey', 'wxPayMerchantId', 'wxAppId'];
-			foreach ($deleteExtend as $delExtend) {
-				unset($extend[$delExtend]);
-			}
-		}
-		$merchant['extend'] = $extend;
-		return $merchant;
-	}
-	
-	//常用链接 shish 2019.12.19
-	public static function getCommonUrlList()
-	{
-		$list = MerchantClass::$commonUrl;
-		return array_values($list);
-	}
-	
-	//取指定常用链接 shish 2019.12.28
-	public static function getCommonUrl($id)
-	{
-		$list = MerchantClass::$commonUrl;
-		return isset($list[$id]) ? $list[$id] : [];
-	}
-	
-	//取平台下的商家 shish 2019.12.20
-	public static function getSaasMerchant($where)
-	{
-		$data = MerchantClass::getList('*', $where, 'addTime DESC');
-		$list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
-		if (empty($list)) {
-			return $data;
-		}
-		
-		//管理员
-		$adminIdList = array_column($list, 'adminId');
-		$admin = AdminService::getAdminByIds($adminIdList, null, 'id');
-		//商家资产
-		$merchantIdList = array_column($list, 'id');
-		$asset = MerchantAssetService::getAssetByMerchantIds($merchantIdList);
-		//套餐
-		$setIdList = array_column($list, 'setId');
-		$set = SetMealService::getSetByIds($setIdList);
-		//拓展
-		$ext = MerchantExtendService::getExtendByMerchantIds($merchantIdList);
-		foreach ($list as $key => $val) {
-			$adminId = $val['adminId'];
-			$merchantId = $val['id'];
-			$setId = $val['setId'];
-			$val['adminName'] = isset($admin[$adminId]['adminName']) ? $admin[$adminId]['adminName'] : '';
-			$val['merchantAsset'] = isset($asset[$merchantId]) ? $asset[$merchantId] : [];
-			$val['setMealName'] = isset($set[$setId]) ? $set[$setId]['name'] : '';
-			$val['extend'] = isset($ext[$merchantId]) ? $ext[$merchantId] : [];
-			$list[$key] = business::formatMerchantLogo($val);
-		}
-		$data['list'] = $list;
-		return $data;
-	}
-	
-	//根据id批量取商家 shish 2019.12.20
-	public static function getMerchantByIds($ids)
-	{
-		return MerchantClass::getMerchantByIds($ids);
-	}
-	
-	//获取商家 shish 2019.12.30
-	public static function getMerchantById($id)
-	{
-		return MerchantClass::getMerchantById($id);
-	}
-	
-	public static function getCurrentSetId($id)
-	{
-		return MerchantClass::getCurrentSetId($id);
-	}
-	
-	//开店公众号授权之后初始化 shish 2020.2.7
-	public static function openShopInit($data)
-	{
-		$merchantId = $data['merchantId'];
-		$merchant = MerchantClass::getMerchantById($merchantId);
-		if (empty($merchant)) {
-			return false;
-		}
-		$extend = MerchantExtendClass::getByMerchantId($merchantId);
-		if (isset($extend['init']) && $extend['init'] == 1) {
-			return true;
-		}
-		//事务处理
-		$connection = Yii::$app->db;
-		$transaction = $connection->beginTransaction();
-		try {
-			
-			//初始化微信菜单
-			$hasMenu = WxMenuService::getByCondition(['merchantId' => $merchantId]);
-			if (empty($hasMenu)) {
-				xhWxMenuService::applyInit($merchant);
-			}
-			
-			//微信客户初始化
-			$hasUser = UserService::getByCondition(['merchantId' => $merchantId]);
-			if (empty($hasUser)) {
-				$return = UserService::syncWxAllUser($merchantId);
-				$totalNum = isset($return['total']) ? $return['total'] : 0;
-				MerchantAssetClass::updateByCondition(['merchantId' => $merchantId], ['totalFans' => $totalNum, 'totalUser' => $totalNum]);
-			}
-			
-			//模板消息
-			$hasMessage = TMessageService::getByCondition(['merchantId' => $merchantId]);
-			if (empty($hasMessage)) {
-				xhTMessageService::init($merchant);
-			}
-			
-			//完成初始化标识
-			MerchantExtendClass::updateByCondition(['merchantId' => $merchantId], ['init' => 1]);
-			
-			//代理资产
-			AgentAssetClass::add(['merchantId' => $merchantId]);
-			
-			$transaction->commit();
-			return true;
-		} catch (Exception $e) {
-			$transaction->rollBack();
-			return false;
-		}
-	}
-	
-	//初始化平台的商家 shish 2020.2.11
-	public static function initOpenMerchant()
-	{
-		$open = WxOpenClass::getOpen();
-		if (isset($open['merchantId']) && !empty($open['merchantId'])) {
-			util::stop('已初始化,无需重复操作');
-		}
-		$env = getenv('YII_ENV');
-		switch ($env) {
-			case 'local':
-				$merchantName = '花美灵';
-				break;
-			case 'dev':
-				$merchantName = '花美灵';
-				break;
-			case 'test':
-				$merchantName = '花掌柜';
-				break;
-			case 'production':
-				$merchantName = '花卉宝';
-				break;
-			default:
-				$merchantName = '花卉宝';
-		}
-		$merchant = MerchantClass::getByCondition(['merchantName' => $merchantName]);
-		if (!empty($merchant)) {
-			util::stop('平台要使用的商家信息已初始化了');
-		}
-		$data = [
-			'merchantName' => $merchantName,
-			'mobile' => '17189513228',
-			'province' => '福建',
-			'city' => '厦门',
-			'dist' => '思明区',
-			'address' => '上湖社126号',
-			'floor' => '306室',
-			'alipayAccount' => 'shishaohua8879@sina.com',
-			'alipayAccountName' => '石少华',
-			'adminName' => '石头',
-		];
-		return MerchantClass::generateMerchant($data);
-	}
-	
 
+    public static $baseFile = '\biz\merchant\classes\MerchantClass';
+
+    //商家在业务端的权限 shish 2019.11.25
+    public static function getAuthIdList($merchantId, $endId)
+    {
+        $merchant = self::getById($merchantId);
+        $setId = $merchant['setId'];
+        if (empty($setId)) {
+            util::fail('没有找到商家的套餐');
+        }
+
+        //业务端总共有哪些权限
+        $idList = AuthService::getListId($endId);
+
+        //套餐在业务端有哪些权限
+        $setIdList = SetAuthService::getAuthIdList($setId, $endId);
+
+        //有*号表示有所有的权限
+        $commonIdList = in_array('*', $setIdList) ? $idList : array_intersect($idList, $setIdList);
+
+        return $commonIdList;
+
+    }
+
+    //获取默认门店
+    public static function getDefaultShopId($merchant)
+    {
+        $defaultShopId = isset($merchant['defaultShopId']) ? $merchant['defaultShopId'] : 0;
+        return $defaultShopId;
+    }
+
+    //商家基本信息,$sensitive true 除敏感信息 shish 2019.12.8
+    public static function getInfo($merchant, $extend, $sensitive = true)
+    {
+        if ($sensitive) {
+            $delete = ['miniAppId', 'miniAppSecret', 'wxAppId', 'wxAppSecret', 'openAppId', 'wxToken', 'wxJsApiTicket', 'wxAccessToken', 'wxRefreshToken'];
+            foreach ($delete as $del) {
+                unset($merchant[$del]);
+            }
+            $deleteExtend = ['miniAppId', 'miniAccessToken', 'miniRefreshToken', 'wxPayKey', 'wxPayMerchantId', 'wxAppId'];
+            foreach ($deleteExtend as $delExtend) {
+                unset($extend[$delExtend]);
+            }
+        }
+        $merchant['extend'] = $extend;
+        return $merchant;
+    }
+
+    //常用链接 shish 2019.12.19
+    public static function getCommonUrlList()
+    {
+        $list = MerchantClass::$commonUrl;
+        return array_values($list);
+    }
+
+    //取指定常用链接 shish 2019.12.28
+    public static function getCommonUrl($id)
+    {
+        $list = MerchantClass::$commonUrl;
+        return isset($list[$id]) ? $list[$id] : [];
+    }
+
+    //取平台下的商家 shish 2019.12.20
+    public static function getSaasMerchant($where)
+    {
+        $data = MerchantClass::getList('*', $where, 'addTime DESC');
+        $list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
+        if (empty($list)) {
+            return $data;
+        }
+
+        //管理员
+        $adminIdList = array_column($list, 'adminId');
+        $admin = AdminService::getAdminByIds($adminIdList, null, 'id');
+        //商家资产
+        $merchantIdList = array_column($list, 'id');
+        $asset = MerchantAssetService::getAssetByMerchantIds($merchantIdList);
+        //套餐
+        $setIdList = array_column($list, 'setId');
+        $set = SetMealService::getSetByIds($setIdList);
+        //拓展
+        $ext = MerchantExtendService::getExtendByMerchantIds($merchantIdList);
+        foreach ($list as $key => $val) {
+            $adminId = $val['adminId'];
+            $merchantId = $val['id'];
+            $setId = $val['setId'];
+            $val['adminName'] = isset($admin[$adminId]['adminName']) ? $admin[$adminId]['adminName'] : '';
+            $val['merchantAsset'] = isset($asset[$merchantId]) ? $asset[$merchantId] : [];
+            $val['setMealName'] = isset($set[$setId]) ? $set[$setId]['name'] : '';
+            $val['extend'] = isset($ext[$merchantId]) ? $ext[$merchantId] : [];
+            $list[$key] = business::formatMerchantLogo($val);
+        }
+        $data['list'] = $list;
+        return $data;
+    }
+
+    //根据id批量取商家 shish 2019.12.20
+    public static function getMerchantByIds($ids)
+    {
+        return MerchantClass::getMerchantByIds($ids);
+    }
+
+    //获取商家 shish 2019.12.30
+    public static function getMerchantById($id)
+    {
+        return MerchantClass::getMerchantById($id);
+    }
+
+    public static function getCurrentSetId($id)
+    {
+        return MerchantClass::getCurrentSetId($id);
+    }
+
+    //开店公众号授权之后初始化 shish 2020.2.7
+    public static function openShopInit($data)
+    {
+        $merchantId = $data['merchantId'];
+        $merchant = MerchantClass::getMerchantById($merchantId);
+        if (empty($merchant)) {
+            return false;
+        }
+        $extend = MerchantExtendClass::getByMerchantId($merchantId);
+        if (isset($extend['init']) && $extend['init'] == 1) {
+            return true;
+        }
+        //事务处理
+        $connection = Yii::$app->db;
+        $transaction = $connection->beginTransaction();
+        try {
+
+            //初始化微信菜单
+            $hasMenu = WxMenuService::getByCondition(['merchantId' => $merchantId]);
+            if (empty($hasMenu)) {
+                xhWxMenuService::applyInit($merchant);
+            }
+
+            //微信客户初始化
+            $hasUser = UserService::getByCondition(['merchantId' => $merchantId]);
+            if (empty($hasUser)) {
+                $return = UserService::syncWxAllUser($merchantId);
+                $totalNum = isset($return['total']) ? $return['total'] : 0;
+                MerchantAssetClass::updateByCondition(['merchantId' => $merchantId], ['totalFans' => $totalNum, 'totalUser' => $totalNum]);
+            }
+
+            //模板消息
+            $hasMessage = TMessageService::getByCondition(['merchantId' => $merchantId]);
+            if (empty($hasMessage)) {
+                xhTMessageService::init($merchant);
+            }
+
+            //完成初始化标识
+            MerchantExtendClass::updateByCondition(['merchantId' => $merchantId], ['init' => 1]);
+
+            //代理资产
+            AgentAssetClass::add(['merchantId' => $merchantId]);
+
+            $transaction->commit();
+            return true;
+        } catch (Exception $e) {
+            $transaction->rollBack();
+            return false;
+        }
+    }
+
+    //初始化平台的商家 shish 2020.2.11
+    public static function initOpenMerchant()
+    {
+        $open = WxOpenClass::getOpen();
+        if (isset($open['wx_base_id']) && !empty($open['wx_base_id']) && isset($open['wx_mini_base_id']) && !empty($open['wx_mini_base_id'])) {
+            util::stop('已初始化,无需重复操作');
+        }
+        $env = getenv('YII_ENV');
+        switch ($env) {
+            case 'local':
+                $merchantName = '花美灵';
+                break;
+            case 'dev':
+                $merchantName = '花美灵';
+                break;
+            case 'test':
+                $merchantName = '花掌柜';
+                break;
+            case 'production':
+                $merchantName = '花卉宝';
+                break;
+            default:
+                $merchantName = '花卉宝';
+        }
+        echo $merchantName;
+    }
 
 }

+ 1 - 1
biz/message/classes/InformAdminClass.php

@@ -127,7 +127,7 @@ class InformAdminClass extends BaseClass
 		foreach ($userList as $user) {
 			if (isset($user['subscribe']) && $user['subscribe'] == 1) {
 				$openId = $user['openId'];
-				$url = Yii::$app->params['bDomain'] . "/#/admin/order/detail?id=" . $order['id'];
+				$url = Yii::$app->params['shopDomain'] . "/#/admin/order/detail?id=" . $order['id'];
 				$url = httpUtil::becomeHttps($url);
 				$data = [
 					"touser" => $openId,

+ 1 - 1
biz/message/classes/InformUserClass.php

@@ -26,7 +26,7 @@ class InformUserClass extends BaseClass
 			$allTM = xhTMessageService::getList($merchantId);
 			$shortTempId = 'OPENTM201205968';//订单送达通知
 			$tempId = $allTM[$shortTempId];
-			$url = Yii::$app->params['mDomain'] . "/#/pages/order/detail?id={$order['id']}&account=" . $merchantId;
+			$url = Yii::$app->params['mallDomain'] . "/#/pages/order/detail?id={$order['id']}&account=" . $merchantId;
 			$url = httpUtil::becomeHttps($url);
 			$data = [
 				"touser" => $openId,

+ 13 - 13
common/components/wxUtil.php

@@ -1197,18 +1197,18 @@ class wxUtil
 		$accessToken = self::getMiniProgramAccessToken($merchant);
 		$url = "https://api.weixin.qq.com/wxa/modify_domain?access_token=" . $accessToken;
 		$curl = new curl\Curl();
-		$mHost = Yii::$app->params['mHost'];
-		$has = strpos($mHost, 'https');
+		$mallHost = Yii::$app->params['mallHost'];
+		$has = strpos($mallHost, 'https');
 		//如果不是https则换成https
 		if ($has === false) {
-			$mHost = str_replace('http', 'https', $mHost);
+			$mallHost = str_replace('http', 'https', $mallHost);
 		}
 		$data = [
 			"action" => "set",
-			"requestdomain" => [$mHost],
-			"wsrequestdomain" => [$mHost],
-			"uploaddomain" => [$mHost],
-			"downloaddomain" => [$mHost],
+			"requestdomain" => [$mallHost],
+			"wsrequestdomain" => [$mallHost],
+			"uploaddomain" => [$mallHost],
+			"downloaddomain" => [$mallHost],
 		];
 		print_r($data);
 		$result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
@@ -1222,15 +1222,15 @@ class wxUtil
 		$accessToken = self::getMiniProgramAccessToken($merchant);
 		$url = "https://api.weixin.qq.com/wxa/setwebviewdomain?access_token=" . $accessToken;
 		$curl = new curl\Curl();
-		$mHost = Yii::$app->params['mHost'];
-		$has = strpos($mHost, 'https');
+		$mallHost = Yii::$app->params['mallHost'];
+		$has = strpos($mallHost, 'https');
 		//如果不是https则换成https
 		if ($has === false) {
-			$mHost = str_replace('http', 'https', $mHost);
+			$mallHost = str_replace('http', 'https', $mallHost);
 		}
 		$data = [
 			"action" => "set",
-			"webviewdomain" => [$mHost],
+			"webviewdomain" => [$mallHost],
 		];
 		$result = $curl->setOption(CURLOPT_POSTFIELDS, Json::encode($data))->post($url);
 		$respond = Json::decode($result);
@@ -1243,7 +1243,7 @@ class wxUtil
 		$accessToken = self::getMiniProgramAccessToken($merchant);
 		$url = 'https://api.weixin.qq.com/wxa/commit?access_token=' . $accessToken;
 		$curl = new curl\Curl();
-		$mUrl = Yii::$app->params['mHost'];
+		$mUrl = Yii::$app->params['mallHost'];
 		$imgUrl = Yii::$app->params['imgHost'];
 		
 		//如果不是https则换成https
@@ -1262,7 +1262,7 @@ class wxUtil
 			'extAppid' => $merchant['miniAppId'],
 			'ext' => [
 				'account' => $merchant['id'],
-				'mHost' => $mUrl,
+				'mallHost' => $mUrl,
 				'imgHost' => $imgUrl,
 				'merchantName' => $merchant['merchantName'],
 			],

+ 18 - 26
common/config/params.php

@@ -4,8 +4,8 @@ $http = $hostData['http'];
 $suffix = $hostData['suffix'];
 $miniUrl = $http . 'mini.' . $suffix;
 $adminUrl = $http . 'a.' . $suffix;
-$frontUrl = $http . 'm.' . $suffix;
-$mobileUrl = $http . 'm.' . $suffix;
+$frontUrl = $http . 'mall.' . $suffix;
+$mobileUrl = $http . 'mall.' . $suffix;
 $openUrl = $http . 'o.' . $suffix;
 $picUrl = $http . 'pic.' . $suffix;
 $wwwUrl = $http . 'www.' . $suffix;
@@ -58,59 +58,51 @@ if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'){
 }
 
 if (getenv('YII_ENV') == 'local') {
-	$config['mHost'] = $prefixHttp . 'api.m.hhb.com';
+	$config['mallHost'] = $prefixHttp . 'api.mall.hhb.com';
 	$config['bHost'] = $prefixHttp . 'api.b.hhb.com';
 	if (strpos($referrer, $prefixHttp . 'h') === true || strpos($referrer, $prefixHttp . 'api.h') === true) {
 		$config['bHost'] = $prefixHttp . 'api.h.hhb.com';
 	}
-	$config['sHost'] = $prefixHttp . 'api.s.hhb.com';
-	$config['wHost'] = $prefixHttp . 'api.w.hhb.com';
+	$config['saasHost'] = $prefixHttp . 'api.saas.hhb.com';
 	$config['host'] = 'hhb.com';
 	$config['imgHost'] = $prefixHttp . 'img.hhb.com';
-    $config['wDomain'] = $prefixHttp . 'www.hhb.com';
-    $config['mDomain'] = $prefixHttp . 'm.hhb.com';
-    $config['bDomain'] = $prefixHttp . 'b.hhb.com';
+    $config['mallDomain'] = $prefixHttp . 'mall.hhb.com';
+    $config['shopDomain'] = $prefixHttp . 'shop.hhb.com';
 }
 if (getenv('YII_ENV') == 'test') {
-	$config['mHost'] = $prefixHttp . 'api.m.hzghd.com';
+	$config['mallHost'] = $prefixHttp . 'api.mall.hzghd.com';
 	$config['bHost'] = $prefixHttp . 'api.b.hzghd.com';
 	if (strpos($referrer, $prefixHttp . 'h') === true || strpos($referrer, $prefixHttp . 'api.h') === true) {
 		$config['bHost'] = $prefixHttp . 'api.h.hzghd.com';
 	}
-	$config['sHost'] = $prefixHttp . 'api.s.hzghd.com';
-	$config['wHost'] = $prefixHttp . 'api.w.hzghd.com';
+	$config['saasHost'] = $prefixHttp . 'api.saas.hzghd.com';
 	$config['host'] = 'hzghd.com';
 	$config['imgHost'] = $prefixHttp . 'img.hzghd.com';
-    $config['wDomain'] = $prefixHttp . 'www.hzghd.com';
-    $config['mDomain'] = $prefixHttp . 'm.hzghd.com';
-    $config['bDomain'] = $prefixHttp . 'b.hzghd.com';
+    $config['mallDomain'] = $prefixHttp . 'mall.hzghd.com';
+    $config['shopDomain'] = $prefixHttp . 'shop.hzghd.com';
 }
 if (getenv('YII_ENV') == 'dev') {
-	$config['mHost'] = $prefixHttp . 'api.m.huaml.com';
+	$config['mallHost'] = $prefixHttp . 'api.mall.huaml.com';
 	$config['bHost'] = $prefixHttp . 'api.b.huaml.com';
 	if (strpos($referrer, $prefixHttp . 'h') === true || strpos($referrer, $prefixHttp . 'api.h') === true) {
 		$config['bHost'] = $prefixHttp . 'api.h.huaml.com';
 	}
-	$config['sHost'] = $prefixHttp . 'api.s.huaml.com';
-	$config['wHost'] = $prefixHttp . 'api.w.huaml.com';
+	$config['saasHost'] = $prefixHttp . 'api.saas.huaml.com';
 	$config['host'] = 'huaml.com';
 	$config['imgHost'] = $prefixHttp . 'img.huaml.com';
-    $config['wDomain'] = $prefixHttp . 'www.huaml.com';
-    $config['mDomain'] = $prefixHttp . 'm.huaml.com';
-    $config['bDomain'] = $prefixHttp . 'b.huaml.com';
+    $config['mallDomain'] = $prefixHttp . 'mall.huaml.com';
+    $config['shopDomain'] = $prefixHttp . 'shop.huaml.com';
 }
 if (getenv('YII_ENV') == 'production') {
-	$config['mHost'] = $prefixHttp . 'api.m.huahb.com';
+	$config['mallHost'] = $prefixHttp . 'api.mall.huahb.com';
 	$config['bHost'] = $prefixHttp . 'api.b.huahb.com';
 	if (strpos($referrer, $prefixHttp . 'h') === true || strpos($referrer, $prefixHttp . 'api.h') === true) {
 		$config['bHost'] = $prefixHttp . 'api.h.huahb.com';
 	}
-	$config['sHost'] = $prefixHttp . 'api.s.huahb.com';
-	$config['wHost'] = $prefixHttp . 'api.w.huahb.com';
+	$config['saasHost'] = $prefixHttp . 'api.saas.huahb.com';
 	$config['host'] = 'huahb.com';
 	$config['imgHost'] = $prefixHttp . 'img.huahb.com';
-    $config['wDomain'] = $prefixHttp . 'www.huahb.com';
-    $config['mDomain'] = $prefixHttp . 'm.huahb.com';
-    $config['bDomain'] = $prefixHttp . 'b.huahb.com';
+    $config['mallDomain'] = $prefixHttp . 'mall.huahb.com';
+    $config['shopDomain'] = $prefixHttp . 'shop.huahb.com';
 }
 return $config;

+ 11 - 11
common/services/xhWxMenuService.php

@@ -21,29 +21,29 @@ class xhWxMenuService
 	    //删除之前存在的菜单
 	    self::delMenuList($merchantId);
         $menuOption = configDict::getConfig('wxMenuOption');
-        $mDomain = Yii::$app->params['mDomain'];
+        $mallDomain = Yii::$app->params['mallDomain'];
         $wDomain = Yii::$app->params['wDomain'];
-        $bDomain = Yii::$app->params['bDomain'];
+        $shopDomain = Yii::$app->params['shopDomain'];
         //强制使用https方式
-        if (strpos($mDomain, 'https') === false) {
-            $mDomain = str_replace('http', 'https', $mDomain);
+        if (strpos($mallDomain, 'https') === false) {
+            $mallDomain = str_replace('http', 'https', $mallDomain);
             $wDomain = str_replace('http', 'https', $wDomain);
-            $bDomain = str_replace('http', 'https', $bDomain);
+            $shopDomain = str_replace('http', 'https', $shopDomain);
         }
         $button = [
-            ["type" => 'view', "name" => "鲜花速递", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mDomain . '/#/?account=' . $merchantId,],
-            ["type" => 'view', "name" => "会员服务", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mDomain . '/#/?account=' . $merchantId,],
-            ["type" => 'view', "name" => "我的订单", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mDomain . '/#/?account=' . $merchantId,],
+            ["type" => 'view', "name" => "鲜花速递", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
+            ["type" => 'view', "name" => "会员服务", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
+            ["type" => 'view', "name" => "我的订单", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
         ];
         $open = WxOpenService::getById(1);
         //平台使用的公众号菜单与花店公众号菜单不一样
         if (isset($open['merchantId']) && $open['merchantId'] == $merchantId) {
             $button = [
                 ["type" => 'view', "name" => "官网", "menuOption" => $menuOption['redirectToCommonUseUrl'], "url" => $wDomain],
-                ["type" => "view", "name" => "商城", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $mDomain . '/#/?account=' . $merchantId,],
+                ["type" => "view", "name" => "商城", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
                 ["type" => "view", "name" => "更多", "menuOption" => $menuOption['redirectToCommonUseUrl'], "sub_button" => [
-                    ["type" => "view", "name" => "快速付款", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $mDomain . '/#/pages/pay/index?account=' . $merchantId],
-                    ["type" => "view", "name" => "后台", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $bDomain . '/#/?account=' . $merchantId],
+                    ["type" => "view", "name" => "快速付款", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $mallDomain . '/#/pages/pay/index?account=' . $merchantId],
+                    ["type" => "view", "name" => "后台", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $shopDomain . '/#/?account=' . $merchantId],
                 ],],
             ];
         }

+ 11 - 0
console/controllers/UpgradeController.php

@@ -12,6 +12,7 @@ use biz\merchant\services\MerchantService;
 use biz\message\services\TMessageService;
 use biz\order\services\OrderGoodsService;
 use biz\order\services\OrderService;
+use biz\saas\services\StaffService;
 use biz\stat\services\StatIncomeMonthService;
 use biz\stat\services\StatIncomeSourceMonthService;
 use biz\stat\services\StatOrderMonthService;
@@ -1363,6 +1364,9 @@ ALTER TABLE `xhAdmin` DROP COLUMN `defaultShopId`;
 ALTER TABLE `xhAdmin` DROP COLUMN `currentShopId`;";
         Yii::$app->db->createCommand($sql)->execute($sql);
 
+        //修改总后台员工登陆密码
+        StaffService::updateById(1,['password'=>password_hash('123456', PASSWORD_BCRYPT)]);
+
     }
 
     //数据迁移 shish 2020.1.12
@@ -1519,4 +1523,11 @@ ALTER TABLE `xhAdmin` DROP COLUMN `currentShopId`;";
         }
     }
 
+    //补充操作
+    public function actionBc()
+    {
+        //修改总后台员工登陆密码
+        StaffService::updateById(1,['password'=>password_hash('123456', PASSWORD_BCRYPT)]);
+    }
+
 }