From 6741b4dacf0cbf4bb6837dcd033cec3c95b0fb21 Mon Sep 17 00:00:00 2001 From: yangyang <781760363@qq.com> Date: Thu, 21 Jan 2016 15:18:04 +0800 Subject: [PATCH] 修改图片ajax请求 --- yohobuy/www.yohobuy.com/application/models/Product/Search.php | 7 +++++-- yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/yohobuy/www.yohobuy.com/application/models/Product/Search.php b/yohobuy/www.yohobuy.com/application/models/Product/Search.php index 8c0000c..ff2440e 100644 --- a/yohobuy/www.yohobuy.com/application/models/Product/Search.php +++ b/yohobuy/www.yohobuy.com/application/models/Product/Search.php @@ -221,8 +221,11 @@ class SearchModel //组织数据结构 $data = HelperSearch::getProductPic($data['data']['product_list'], $options); } - $data['isFavorite'] = $options['isFavorite']; - echo json_encode($data); + $res = array( + 'pics'=>$data, + 'isFavorite'=>$options['isFavorite'] + ); + echo json_encode($res); } /** diff --git a/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php b/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php index d1dcd6e..13aa7e4 100644 --- a/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php +++ b/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php @@ -110,11 +110,13 @@ class IndexController extends WebAction } //收藏品牌 - public function favoriteBrandAction($uid = '', $brandId = '') + public function favoriteBrandAction() { if (!$this->isAjax()) { return; } + $uid = $this->post('uid'); + $brandId = $this->post('brandId'); if ($uid && $brandId) { //调用接口收藏或取消收藏 $result = FavoriteData::changeFavoriteBrand($uid, $brandId); -- libgit2 0.24.0