作者 郭盛
1 个管道 的构建 通过 耗费 1 秒

修改接口

... ... @@ -1891,6 +1891,7 @@ class User extends Api
}
/**
* @ApiTitle (发短信)
* @ApiSummary (发短信)
... ... @@ -2096,6 +2097,90 @@ class User extends Api
}
}
/**
* @ApiTitle (苹果完成订单)
* @ApiSummary (苹果完成订单)
* @ApiMethod (POST)
* @ApiRoute (/api/user/iphone_finish_order)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
*
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"info": [
{
"id": 13,
"user_id": 10,
"pic_id": null,
"video_id": {
"id": "1346",
"attr": "2K",
"vipprice": 1350,
"thumbnail": "http://qiniuareial.w.broing.cn/uploads/20200811/Fmpouw8DlCJYxSCSveIh2fjlhG9i.gif"
},
"total": 1350,
"status": 2,
"num": "2020081299101519",
"createtime": 1597232108,
"updatetime": 1597232127
},
{
"id": 22,
"user_id": 10,
"pic_id": 31,
"video_id": null,
"total": 2250,
"status": 2,
"num": "2020081810151565",
"createtime": 1597747902,
"updatetime": null
}
],
"is_vip": "1"
}
})
*/
public function iphone_finish_order()
{
$user_id = $this->auth->id;
$user = Db::name('user')->where('id',$user_id)->field('id,is_vip')->find();
$data['info'] = Db::name('iphone')
->where('user_id',$user_id)
->where('status',2)
->select();
$rule = config('verify.path');
foreach ($data['info'] as &$v){
if(!empty($v['pic_id'])){
$v1 = Db::name('pic')->field('id,title,thumbnail,url,code,price,number')->where('id',$v['pic_id'])->find();
$v1['thumbnail'] = $rule.$v1['thumbnail'];
$v1['vipprice'] = $v1['price']*0.75;
}
if(!empty($v['video_id'])){
$v['video_id'] = unserialize($v['video_id']);
$info = Db::name('video')->field('keyword,type_ids,content,is_recommend,buy_num,click_num,createtime,updatetime',true)->where('id',$v['video_id']['id'])->find();
if($v['video_id']['attr'] == 1){
$v['video_id']['attr'] = '2K';
$v['video_id']['vipprice'] = $info['price']*0.75;
}elseif ($v['video_id']['attr'] == 2){
$v['video_id']['attr'] = '4K';
$v['video_id']['four_vipprice'] = $info['four_price'] * 0.75;
}else{
$v['video_id']['attr'] = '8K';
$v['video_id']['eight_vipprice'] =$info['eight_price'] * 0.75;
}
$v['video_id']['thumbnail'] = $rule.$info['thumbnail'];
}
}
$data['is_vip'] = $user['is_vip'];
$this->success('success',$data);
}
//会员
public function fetch($res)
{
... ...
此 diff 太大无法显示。