|
|
@@ -15,7 +15,7 @@ class xhWxMenuService
|
|
|
/**
|
|
|
* 初始化菜单
|
|
|
*/
|
|
|
- public static function applyInit($merchant)
|
|
|
+ public static function applyInit($merchant, $isOpen = 0)
|
|
|
{
|
|
|
$merchantId = isset($merchant['id']) ? $merchant['id'] : 0;
|
|
|
//删除之前存在的菜单
|
|
|
@@ -23,32 +23,32 @@ class xhWxMenuService
|
|
|
$menuOption = configDict::getConfig('wxMenuOption');
|
|
|
$mallDomain = Yii::$app->params['mallDomain'];
|
|
|
$shopDomain = Yii::$app->params['shopDomain'];
|
|
|
- //强制使用https方式
|
|
|
+ //强制转成https方式
|
|
|
if (strpos($mallDomain, 'https') === false) {
|
|
|
$mallDomain = str_replace('http', 'https', $mallDomain);
|
|
|
$shopDomain = str_replace('http', 'https', $shopDomain);
|
|
|
}
|
|
|
+ if ($isOpen == 0) {
|
|
|
// $button = [
|
|
|
// ["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,],
|
|
|
// ];
|
|
|
- $button = [
|
|
|
- ["type" => 'miniprogram', "name" => "鲜花速递", "appid" => $merchant['miniAppId'], "pagepath" => "pages/home/index", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
- ["type" => 'miniprogram', "name" => "会员服务", "appid" => $merchant['miniAppId'], "pagepath" => "pages/home/user", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
- ["type" => 'miniprogram', "name" => "我的订单", "appid" => $merchant['miniAppId'], "pagepath" => "pages/order/list", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
- ];
|
|
|
- $open = WxOpenService::getById(1);
|
|
|
- //平台使用的公众号菜单与花店公众号菜单不一样
|
|
|
- if (isset($open['merchantId']) && $open['merchantId'] == $merchantId) {
|
|
|
+ $button = [
|
|
|
+ ["type" => 'miniprogram', "name" => "鲜花速递", "appid" => $merchant['miniAppId'], "pagepath" => "pages/home/index", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+ ["type" => 'miniprogram', "name" => "会员服务", "appid" => $merchant['miniAppId'], "pagepath" => "pages/home/user", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+ ["type" => 'miniprogram', "name" => "我的订单", "appid" => $merchant['miniAppId'], "pagepath" => "pages/order/list", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+ ];
|
|
|
+
|
|
|
+ } else {
|
|
|
// $button = [
|
|
|
// ["type" => "view", "name" => "官网", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
// ["type" => "view", "name" => "后台", "menuOption" => $menuOption['redirectToCustomUrl'], "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
// ];
|
|
|
$button = [
|
|
|
- ["type" => 'miniprogram', "name" => "官网", "appid" => $merchant['miniAppId'], "pagepath" => "", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
- ["type" => 'miniprogram', "name" => "申请", "appid" => $merchant['miniAppId'], "pagepath" => "", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
- ["type" => 'miniprogram', "name" => "后台", "appid" => $merchant['miniAppId'], "pagepath" => "", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+ ["type" => 'miniprogram', "name" => "官网", "appid" => $merchant['miniAppId'], "pagepath" => "admin/home/console", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+ ["type" => 'miniprogram', "name" => "申请", "appid" => $merchant['miniAppId'], "pagepath" => "admin/home/console", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
+ ["type" => 'miniprogram', "name" => "后台", "appid" => $merchant['miniAppId'], "pagepath" => "admin/home/console", "url" => $mallDomain . '/#/?account=' . $merchantId,],
|
|
|
];
|
|
|
}
|
|
|
$wxUtil = new wxUtil($merchant);
|