| | |
| | | /** |
| | | * 各大榜单 http://jingtuitui.com/api_item?id=9 |
| | | * |
| | | * @param [type] $eliteId 频道ID discountReal实时爆单榜;inOrderCount30Days 30天销量榜;inOrderComm30Days 30天收益榜;discountCount总领券 |
| | | * @param [type] $eliteId 频道ID discountReal实时爆单榜;inOrderCount30Days 30天销量榜;inOrderComm30Days 30天收益榜;discountCount总领券; |
| | | * @param integer $page |
| | | * @param [type] $page_size |
| | | * @return void |
| | |
| | | 'pageSize' => $pageSize, |
| | | 'keyword' => $keyword |
| | | ]; |
| | | |
| | | if($isCoupon == 1)$send_data['isCoupon'] = $isCoupon; |
| | | $result = send_get(self::request_url['search_url'],$send_data); |
| | | if(empty($result) || $result['return'] != 0) return []; |
| | | $list = $result['result']['goods']; |
| | | if(!empty($list)){ |
| | | foreach($list as &$goods){ |
| | | $goods = self::initSearchGoods($goods); |
| | | } |
| | | } |
| | | return $list; |
| | | } |
| | | |
| | | /** |
| | | * 搜索商品(增加类目id--hyt) http://jingtuitui.com/api_item?id=3 |
| | | * |
| | | * @param [type] $keyword 关键词 |
| | | * @param [type] $sort asc=升降序;desc=默认降序 |
| | | * @param [type] $owner 商品类型 :(g:自营;p:POP) |
| | | * @param [type] $isCoupon 是否是优惠券商品 1=有优惠券 |
| | | * @param [type] $sortName 排序字段 price单价; commissionShare佣金比例; commission佣金;inOrderCount30Days 30天引单量;inOrderComm30Days 30天支出佣金 |
| | | * @param [type] $page |
| | | * @param [type] $pageSize |
| | | * @param [type] $cid1 类目id |
| | | * @return void |
| | | */ |
| | | public function search_cid_Goods($keyword,$sort,$owner,$isCoupon,$sortName,$page,$pageSize,$cid1) |
| | | { |
| | | $send_data = [ |
| | | 'appkey' => $this->appkey, |
| | | 'appid' => $this->appid, |
| | | 'v' => $this->search_version, |
| | | 'sort' => $sort, |
| | | 'owner' => $owner, |
| | | 'sortName' => $sortName, |
| | | 'pageIndex' => $page, |
| | | 'pageSize' => $pageSize, |
| | | 'keyword' => $keyword, |
| | | 'cid1' => $cid1 |
| | | ]; |
| | | |
| | | if($isCoupon == 1)$send_data['isCoupon'] = $isCoupon; |
| | | $result = send_get(self::request_url['search_url'],$send_data); |
| | | if(empty($result) || $result['return'] != 0) return []; |
| | |
| | | }else{ |
| | | return []; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 京东0元购商品列表 http://jingtuitui.com/api_item?id=1 |
| | | * |
| | | * @param [type] $page |
| | | * @param [type] $pageSize |
| | | * @return void |
| | | */ |
| | | public function getNineSift($page,$pageSize) |
| | | { |
| | | $send_data = [ |
| | | 'appkey' => $this->appkey, |
| | | 'appid' => $this->appid, |
| | | 'v' => $this->goods_version, |
| | | 'pageIndex' => $page, |
| | | 'pageSize' => $pageSize, |
| | | 'sortName'=>' OrderCount30Days ', |
| | | 'sort'=>'desc', |
| | | 'price_start'=>1, |
| | | 'price_end'=>5 |
| | | ]; |
| | | $result = send_get(self::request_url['goods_list_url'],$send_data); |
| | | |
| | | if(empty($result) || $result['return'] != 0) fault('数据获取失败'); |
| | | $list = $result['result']['data']; |
| | | if(!empty($list)){ |
| | | foreach($list as &$goods){ |
| | | $goods = self::initGoods($goods); |
| | | } |
| | | } |
| | | return $list; |
| | | } |
| | | |
| | | |
| | |
| | | if($init_goods["originalPrice"])$init_goods["originalPrice"] = (string)$init_goods["originalPrice"]; |
| | | $init_goods['fanli'] = self::rebate($goods['final_price'],$goods['commissionShare']/100); |
| | | $init_goods['topFanli'] = self::rebate($goods['final_price'],$goods['commissionShare']/100,self::$topFanliRate); |
| | | //新增商品类目ID--byhyt |
| | | $init_goods['cid'] = isset($goods['categoryInfo']['cid1']) ? $goods['categoryInfo']['cid1'] : ''; |
| | | return $init_goods; |
| | | } |
| | | |
| | |
| | | $init_goods['isCollect'] = self::isCollect($init_goods); |
| | | $init_goods['fanli'] = self::rebate($init_goods["actualPrice"],$goods['commissionInfo']['commissionShare']/100); |
| | | $init_goods['topFanli'] = self::rebate($init_goods['actualPrice'],$goods['commissionInfo']['commissionShare']/100,self::$topFanliRate); |
| | | //新增商品类目ID--byhyt |
| | | $init_goods['cid'] = isset($goods['categoryInfo']['cid1']) ? $goods['categoryInfo']['cid1'] : ''; |
| | | return $init_goods; |
| | | } |
| | | |