ChoiceGoods.php
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
header("Content-type: text/html; charset=utf-8");
class YHMApi_App_V1_ChoiceGoods extends YHMApi_App_V1_Base {
/**
* 获取精选的列表
*
* @param array $params
* @param string $fields
*/
public static function getChoiceGoodsList(array $params, $fields = '*') {
$buyGoodsListResult=array();
$offset = !empty($params ['offset']) ? (int) $params ['offset'] : '0';
$num = !empty($params ['num']) ? (int) $params ['num'] : "15";
$choice_list = YHMSupport_Models_Choicegoods_Client::getGoodsList($offset, $num);
foreach ($choice_list as $k=>$val)
{
$goodsInfo = YHMProduct_Models_Goods_Client::getOneByProductSkc($val['product_skc']);
$productImage = YHMProduct_Models_Goodsimages_Client::getOneImagesBySkc($val['product_skc']);
$buyGoodsListResult[] = array(
'goodsName' => $goodsInfo['goods_name'],
'product_skc' => (int) $goodsInfo['product_skc'],
'create_time' => (int) $goodsInfo['create_time'],
'goodsImageUrl' =>YHMUpload_Images::view($productImage,200, 200, 1, 'yhfair-product'),// YHMUpload_Images::view($productImage, 'yhfair-product'),
'is_deleted' => ($goodsInfo['status'] == 0 ? 'Y' : 'N'),
'sale_price' => $goodsInfo['sale_price']
);
}
return self::result(200, '精选商品列表', array(
'sales_list' => $buyGoodsListResult
));
}
}