Authored by whb

商品图片有问题

@@ -77,6 +77,16 @@ class YHMApi_App_V2_Goods extends YHMApi_App_V1_Goods @@ -77,6 +77,16 @@ class YHMApi_App_V2_Goods extends YHMApi_App_V1_Goods
77 if(!empty($productInfo)) 77 if(!empty($productInfo))
78 { 78 {
79 $goodsImages = YHMProduct_Models_Goodsimages_Client::getByProductSkc($skc); 79 $goodsImages = YHMProduct_Models_Goodsimages_Client::getByProductSkc($skc);
  80 + // 是否收藏商品
  81 + if (!empty($params ['uid']))
  82 + {
  83 + $favorite = YHMPassport_Models_Favorite_Goods_Client::findIsFavoriteBySkc($params ['uid'], $params ['product_skc']);
  84 + }
  85 + $favorite_num = YHMPassport_Models_Favorite_Goods_Client::getFavoriteTotal($skc);
  86 + $is_favorite = 'N';
  87 + if (!empty($favorite)) {
  88 + $is_favorite = 'Y';
  89 + }
80 //商品描述 goods_describe 90 //商品描述 goods_describe
81 $goods_describe = YHMProduct_Models_Goods_Client::getGoodsDescribeBySkc($skc); 91 $goods_describe = YHMProduct_Models_Goods_Client::getGoodsDescribeBySkc($skc);
82 $imageList = array(); 92 $imageList = array();
@@ -98,7 +108,10 @@ class YHMApi_App_V2_Goods extends YHMApi_App_V1_Goods @@ -98,7 +108,10 @@ class YHMApi_App_V2_Goods extends YHMApi_App_V1_Goods
98 $resultList[] = array( 108 $resultList[] = array(
99 'image_list' => $imageList, 109 'image_list' => $imageList,
100 'product_skc' => $skc, 110 'product_skc' => $skc,
  111 + 'is_favorite' => $is_favorite, // 是否已收藏,
  112 + 'favorite_num'=> $favorite_num,//收藏数
101 'area_code'=> $productInfo['area_code'], 113 'area_code'=> $productInfo['area_code'],
  114 + 'goods_name'=> $productInfo['goods_name'],
102 'goods_describe' => $goods_describe['goods_describe'], 115 'goods_describe' => $goods_describe['goods_describe'],
103 'create_time' => $productInfo['create_time'], 116 'create_time' => $productInfo['create_time'],
104 'sale_price' => $productInfo['sale_price'], 117 'sale_price' => $productInfo['sale_price'],
@@ -43,7 +43,7 @@ class YHMProduct_Models_Goodsimages_Dao extends YHMProduct_Dao @@ -43,7 +43,7 @@ class YHMProduct_Models_Goodsimages_Dao extends YHMProduct_Dao
43 */ 43 */
44 public function getOneImagesBySkc($product_skc) 44 public function getOneImagesBySkc($product_skc)
45 { 45 {
46 - return $this->dao()->tag($this->_tag . $product_skc)->fetchAssoc(Goodsimages\Goodsimages::SELECT_ONE_IMAGES, array( 46 + return $this->dao()->tag($this->_tag . $product_skc)->fetchOne(Goodsimages\Goodsimages::SELECT_ONE_IMAGES, array(
47 'product_skc' => $product_skc, 47 'product_skc' => $product_skc,
48 'size' => 1 48 'size' => 1
49 )); 49 ));
1 -ALTER TABLE `yhm_shops`.`goods`ADD COLUMN `area_code` INT(11) NULL COMMENT '地理位置' AFTER `selling_point`; 1 +ALTER TABLE `yhm_shops`.`goods`ADD COLUMN `area_code` INT(11) DEFAULT '0' NULL COMMENT '地理位置' AFTER `selling_point`;