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

修改详情接口

... ... @@ -729,6 +729,20 @@ class User extends Api
$data['vip_price'] = $data['price'] * 0.75;
$data['thumbnail'] = $rule.$data['thumbnail'];
$data['is_vip'] = 0;
//我已经购买过的视频
$video_buy = Db::name('iphone')
->where('user_id',$uid)
->where('status',2)
->column('pic_id');
if(in_array($pic_id,$video_buy)){
$data['is_buy'] = 1;
}else{
$data['is_buy'] = 2;
}
$this->success('SUCCESS',$data);
}elseif($res['is_vip'] == 1){
$pic_id = $this->request->post('pic_id');
... ... @@ -785,6 +799,16 @@ class User extends Api
$data['water_url'] = request()->domain().$data['thumbnail'];
$data['vip_price'] = $data['price'] * 0.75;
$data['thumbnail'] = $rule.$data['thumbnail'];
//我已经购买过的视频
$video_buy = Db::name('iphone')
->where('user_id',$uid)
->where('status',2)
->column('pic_id');
if(in_array($pic_id,$video_buy)){
$data['is_buy'] = 1;
}else{
$data['is_buy'] = 2;
}
$this->success('SUCCESS',$data);
}
}
... ... @@ -889,6 +913,23 @@ class User extends Api
unset($data['content'][$k]);
}
}
//我已经购买过的视频
$video_buy = Db::name('iphone')
->where('user_id',$uid)
->where('status',2)
->field('video_id')
->select();
foreach ($video_buy as &$v){
if(!empty($v['video_id'])){
$v['video_id'] = unserialize($v['video_id']);
if ($pic_id == $v['video_id']['id']){
$data['is_buy'] = 1;
}else{
$data['is_buy'] = 2;
}
}
}
$this->success('SUCCESS',$data);
}elseif($res['is_vip'] == 1){
$pic_id = $this->request->post('video_id');
... ... @@ -945,6 +986,22 @@ class User extends Api
unset($data['content'][$k]);
}
}
//我已经购买过的视频
$video_buy = Db::name('iphone')
->where('user_id',$uid)
->where('status',2)
->field('video_id')
->select();
foreach ($video_buy as &$v){
if(!empty($v['video_id'])){
$v['video_id'] = unserialize($v['video_id']);
if ($pic_id == $v['video_id']['id']){
$data['is_buy'] = 1;
}else{
$data['is_buy'] = 2;
}
}
}
$this->success('SUCCESS',$data);
}
}
... ...