| | |
| | | $this->success('获取成功',['list' => $list]); |
| | | } |
| | | |
| | | /** |
| | | * 0元购商品列表(调用9.9包邮精选接口,获取3.9元商品) |
| | | * |
| | | * @return void |
| | | */ |
| | | public function get_first_free_goods(){ |
| | | |
| | | $page = request()->param('page',1); |
| | | $page_size = request()->param('pageSize',10); |
| | | $LogicDataoke = new LogicDataoke(); |
| | | |
| | | $list = $LogicDataoke->getOpGoodsList(1,$page,$page_size); |
| | | |
| | | if($list === false) $this->error($LogicDataoke->getError()); |
| | | |
| | | foreach($list as $key => $value){ |
| | | $list[$key]['fanli'] = $value['actualPrice']; |
| | | } |
| | | |
| | | $this->success('获取成功',['list'=>$list]); |
| | | } |
| | | |
| | | } |
| | |
| | | use app\common\logic\Basic as BasicLogic; |
| | | use app\common\model\user\Browse as ModelUserBrowse; |
| | | use app\api\logic\taoke\device\Jd as LogicJd; |
| | | |
| | | use think\Db; |
| | | |
| | | class UserBrowse extends BasicLogic |
| | | { |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 标记浏览0元购商品记录 |
| | | * |
| | | * * @param [type] $user_id |
| | | * @param [type] $ids |
| | | * @return void |
| | | */ |
| | | public function updatefirstfreelog($user_id,$ids,$new_goodsId) |
| | | { |
| | | if(empty($ids)){ |
| | | fault('宝贝ID不能为空'); |
| | | return true; |
| | | } |
| | | $res=Db::name('user_browse')->where(['user_id'=>$user_id,'goodsId'=>$ids])->update(['is_free'=>1,'goodsId'=>$new_goodsId]); |
| | | |
| | | return true; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | 'friends-circle-list'=>'https://openapi.dataoke.com/api/goods/friends-circle-list', |
| | | 'parse_url'=>'https://openapi.dataoke.com/api/dels/kit/contentParse', |
| | | 'similer_url'=>'https://openapi.dataoke.com/api/goods/list-similer-goods-by-open', |
| | | 'gift_money_url'=>'https://openapi.dataoke.com/api/goods/first-order-gift-money', |
| | | ]; |
| | | |
| | | const shop_type = ["0"=>"淘宝","1"=>"天猫","2"=>"天猫超市","3"=>"天猫国际"]; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 淘礼金商品 https://www.dataoke.com/kfpt/api-d.html?id=29 |
| | | * |
| | | * @param [type] $page |
| | | * @param [type] $page_size |
| | | * @return void |
| | | */ |
| | | public function GetFirstOrderGiftMoney($pageSize,$pageId) |
| | | { |
| | | log::write($pageSize); |
| | | $params = $this->setParams(['pageSize'=>$pageSize,'pageId'=>$pageId]); |
| | | |
| | | $result = send_get(self::request_url['gift_money_url'],$params); |
| | | |
| | | if(empty($result) || $result['code'] != 0) return []; |
| | | |
| | | $list = $result['data']; |
| | | |
| | | if(!empty($list)){ |
| | | |
| | | foreach($list as &$goods){ |
| | | |
| | | // log::write($goods); |
| | | // if((double)$goods['firstOrderAmount']<4){ |
| | | // //删除佣金小于4的商品 |
| | | // $list=array_diff_key($data, ['id'=>$goods['id']]); |
| | | // } |
| | | |
| | | } |
| | | } |
| | | |
| | | return $list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 格式化商品信息 |
| | | * |