|
@@ -49,7 +49,6 @@ class WechatMenuService extends BaseService
|
|
|
if (is_empty($info)) {
|
|
|
self::throwErrMsg('该菜单不存在或已删除');
|
|
|
}
|
|
|
-
|
|
|
WechatMenu::where('id', $id)->update($param);
|
|
|
$data = [
|
|
|
'type' => $param['type'],
|
|
@@ -57,8 +56,8 @@ class WechatMenuService extends BaseService
|
|
|
'msg_content' => $param['msg_content']
|
|
|
];
|
|
|
WechatAccountMenuDetail::where('menu_id', $id)->update($data);
|
|
|
- $appIds = WechatAccountMenuDetail::where(['status' => 1, 'menu_id' => $info->id])->pluck('wechat_authorization_info_id')->toArray();
|
|
|
// 更新公众号菜单
|
|
|
+ $appIds = WechatAccountMenuDetail::where(['status' => 1, 'menu_id' => $info->id])->pluck('wechat_authorization_info_id')->toArray();
|
|
|
self::createWechatMenus($appIds,$id);
|
|
|
return ['msg' => '操作成功'];
|
|
|
}
|
|
@@ -89,12 +88,13 @@ class WechatMenuService extends BaseService
|
|
|
"client_platform_type" => $val->type == "iso" ? "1" : "2",
|
|
|
];
|
|
|
$res = $app->menu->create($val->content, $matchRule);
|
|
|
-
|
|
|
+ myLog('wx-meun')->info(['res' => $res]);
|
|
|
|
|
|
$errcode = getProp($res,'errcode',"");
|
|
|
if (intval($errcode) == 65303){
|
|
|
$res = $app->menu->create($val->content);
|
|
|
}
|
|
|
+ myLog('wx-meun')->info(['res' => $res]);
|
|
|
$wxMenuId = getProp($res, 'menuid', "");
|
|
|
$res = $app->menu->create($val->content, $matchRule);
|
|
|
myLog('wx-meun')->info(['res' => $res,'mid' => $wxMenuId]);
|
|
@@ -237,12 +237,8 @@ class WechatMenuService extends BaseService
|
|
|
}
|
|
|
}
|
|
|
// $allSet = WechatAccountMenuDetail::query()->where('user_id', $info->user_id)->get();
|
|
|
-
|
|
|
+ $appIds = [];
|
|
|
foreach ($wechatAccountInfos as $val) {
|
|
|
- if (!in_array($val->id, $appIds)) {
|
|
|
- $createAddIp[] = $val->id;
|
|
|
- }
|
|
|
-
|
|
|
$data['wechat_accounts'][] = [
|
|
|
'id' => $val->id,
|
|
|
'appid' => $val->authorizer_appid,
|
|
@@ -288,6 +284,7 @@ class WechatMenuService extends BaseService
|
|
|
} catch (\Exception $exception) {
|
|
|
self::throwErrMsg('操作失败');
|
|
|
}
|
|
|
+ $createAddIp = WechatAccountMenuDetail::where(['status' => 1, 'menu_id' => $info->id])->pluck('wechat_authorization_info_id')->toArray();
|
|
|
myLog('wx-meun')->info(['c' => $createAddIp,'del' => $delAppId]);
|
|
|
if (!empty($createAddIp)) {
|
|
|
self::createWechatMenus($createAddIp,$id);
|