|
@@ -79,15 +79,15 @@ class WechatMenuService extends BaseService
|
|
|
}
|
|
|
$info = WechatAccountMenuDetail::query()->whereIn('wechat_authorization_info_id', $appIds)->where('menu_id',$menuId)->get();
|
|
|
foreach ($info as $val) {
|
|
|
- $app = self::getofficialAccount($info->wechat_authorization_info_id);
|
|
|
+ $app = self::getofficialAccount($val->wechat_authorization_info_id);
|
|
|
if ($val->wx_menuid) {
|
|
|
// 有菜单则删除菜单
|
|
|
- $app->menu->delete($info->wx_menuid);
|
|
|
+ $app->menu->delete($val->wx_menuid);
|
|
|
}
|
|
|
$matchRule = [
|
|
|
- "client_platform_type" => $info->type == "iso" ? "1" : "2",
|
|
|
+ "client_platform_type" => $val->type == "iso" ? "1" : "2",
|
|
|
];
|
|
|
- $res = $app->menu->create($info->content, $matchRule);
|
|
|
+ $res = $app->menu->create($val->content, $matchRule);
|
|
|
$wxMenuId = getProp($res, 'menuid', "");
|
|
|
if ($wxMenuId) {
|
|
|
WechatAccountMenuDetail::query()->where('id', $val->id)->update(['wx_menuid' => $wxMenuId]);
|
|
@@ -176,7 +176,7 @@ class WechatMenuService extends BaseService
|
|
|
|
|
|
if ($val->wx_menuid) {
|
|
|
// 有菜单则删除菜单
|
|
|
- $app = self::getofficialAccount($info->wechat_authorization_info_id);
|
|
|
+ $app = self::getofficialAccount($val->wechat_authorization_info_id);
|
|
|
$app->menu->delete($info->wx_menuid);
|
|
|
}
|
|
|
|
|
@@ -279,7 +279,7 @@ class WechatMenuService extends BaseService
|
|
|
} catch (\Exception $exception) {
|
|
|
self::throwErrMsg('操作失败');
|
|
|
}
|
|
|
- myLog('wx-meun')->info(['c' => $createAddIp,'del' => $delAppId]);
|
|
|
+ // myLog('wx-meun')->info(['c' => $createAddIp,'del' => $delAppId]);
|
|
|
if (!empty($createAddIp)) {
|
|
|
self::createWechatMenus($createAddIp,$id);
|
|
|
}
|
|
@@ -337,7 +337,7 @@ class WechatMenuService extends BaseService
|
|
|
if ($val->wx_menuid) {
|
|
|
// 有菜单则删除菜单
|
|
|
$app = self::getofficialAccount($info->wechat_authorization_info_id);
|
|
|
- $app->menu->delete($info->wx_menuid);
|
|
|
+ $app->menu->delete($val->wx_menuid);
|
|
|
}
|
|
|
|
|
|
WechatAccountMenuDetail::query()->where('wechat_authorization_info_id', $val->id)->update(['wx_menuid' => ""]);
|