code: public function getMainMenuUrl($menu_id, $user_id)
      {
          $auth_menu = MemberLogic::instance()->getUserMenu($user_id);
          if (! in_array($menu_id, $auth_menu)) {
              return null;
          }
          
          $map = array(
              'menu_status' => 1,
              'menu_pid' => $menu_id,
              'id' => [
                  'in',
                  $auth_menu
              ]
          );
          $menu = $this->model->where($map)
              ->order('menu_sort asc')
              ->find();
          return $menu ? Url::build($menu['menu_url']) : '';
      }
docs: 主菜单链接