Пример #1
0
 /**
  * 删除旧菜单.
  *
  * @param int $accountId 公众号id
  */
 public function destroyMenu($accountId)
 {
     $menus = $this->all($accountId);
     array_map(function ($menu) {
         if ($menu['type'] == 'click') {
             $this->eventRepository->distoryByEventKey($menu['key']);
         }
     }, $menus);
     $this->model->where('account_id', $accountId)->delete();
 }