/** * 我的收藏. * * @access public * @return void */ public function myCollectionList() { $pageConfig = C('page'); $page = (int) I('post.' . $pageConfig['var_page'], 1); // page. $pageSize = (int) I('post.' . $pageConfig['var_page_size'], 10); // rows. $locateCountry = $this->getLocateCountry(); $loginedUserInfo = $this->getLoginedUserInfo(); $countryId = (int) I('post.countryId', (int) $locateCountry['id']); $userId = (int) $loginedUserInfo['uid']; $collectType = (int) I('post.collectType', 0); // 收藏类型: 0: 分类, 1: 社区资讯. $allowType = [0, 1]; if (!in_array($collectType, $allowType, TRUE)) { $this->setAjaxData(Message::PARAM_ERROR, Message::get(Message::PARAM_ERROR))->myAjaxReturn(); } $modelUserCollect = new UserCollectModel(); $result = $modelUserCollect->fetchListByCountry($userId, $collectType, $countryId, $page, $pageSize); Util::resolveCity($result['lists'], 'city_name'); $this->setAjaxData(Message::SUCCESS, Message::get(Message::SUCCESS), $result)->myAjaxReturn(); }