|
@@ -210,10 +210,6 @@ class Books extends Api
|
|
|
$UserGoods = new UserGoods();
|
|
|
$Certificate = new Certificate();
|
|
|
$good = $UserGoods->where('user_id', $uid)->where('goods_type', 0)->where('goods_id', $v['id'])->find();
|
|
|
- if (!$good) {
|
|
|
- $listss[] = $v;
|
|
|
-// unset($lists[$k]);
|
|
|
- }
|
|
|
//体验卡
|
|
|
$cer = $Certificate->where('user_id',$uid)
|
|
|
->where('goods_id',$v['id'])
|
|
@@ -222,16 +218,19 @@ class Books extends Api
|
|
|
->where('free_end_time','>',date("Y-m-d H:i:s"))
|
|
|
->where('is_deleted',1)->find();
|
|
|
if($cer){
|
|
|
- $list['is_certificate'] = 0;
|
|
|
- $list['free_end_time'] = $cer['free_end_time'];
|
|
|
+ $list[$k]['is_certificate'] = 0;
|
|
|
+ $list[$k]['free_end_time'] = $cer['free_end_time'];
|
|
|
}else{
|
|
|
- $list['is_certificate'] = 1;
|
|
|
+ $list[$k]['is_certificate'] = 1;
|
|
|
//免费/付费
|
|
|
- $lists['data'][$k]['is_free'] = 1;
|
|
|
+ $list[$k]['is_free'] = 1;
|
|
|
if($v['price'] <= 0){
|
|
|
- $lists['data'][$k]['is_free'] = 0;
|
|
|
+ $list[$k]['is_free'] = 0;
|
|
|
}
|
|
|
-
|
|
|
+ }
|
|
|
+ if (!$good) {
|
|
|
+ $listss[] = $v;
|
|
|
+// unset($lists[$k]);
|
|
|
}
|
|
|
}
|
|
|
}else{
|