...
|
...
|
@@ -398,14 +398,6 @@ class Cars extends Api |
|
|
$res1 = Common::selectSoftWhereData('goods',['id'=>['in',$goods_id_s],'type'=>$flag[1]],'id,t_id');
|
|
|
$b_id_s = array_unique(array_values(array_column($res1,'t_id')));
|
|
|
|
|
|
//包含品牌中的商品
|
|
|
if(!empty($b_id_s)){
|
|
|
$where2['bg_id'] = ['in',$b_id_s];
|
|
|
$where2['type'] = $type[1];
|
|
|
}else{
|
|
|
$where2 = [];
|
|
|
}
|
|
|
|
|
|
//普通商品
|
|
|
$where1['bg_id'] = ['in',$goods_id_s];
|
|
|
$where1['type'] = $type[2];
|
...
|
...
|
@@ -414,8 +406,14 @@ class Cars extends Api |
|
|
$where['id'] = ['in',$receive_s];
|
|
|
$where['end_time'] = ['>',$time];
|
|
|
|
|
|
$data = Common::selectWhereOrData('coupon',$where,$where1,$where2,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number,end_time','sort desc,id desc');
|
|
|
|
|
|
//包含品牌中的商品
|
|
|
if(!empty($b_id_s)){
|
|
|
$where2['bg_id'] = ['in',$b_id_s];
|
|
|
$where2['type'] = $type[1];
|
|
|
$data = Common::selectWhereOrData('coupon',$where,$where1,$where2,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number,end_time','sort desc,id desc');
|
|
|
}else{
|
|
|
$data = Common::selectWhereOrData1('coupon',$where,$where1,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number,end_time','sort desc,id desc');
|
|
|
}
|
|
|
$res = [];
|
|
|
$key = 0;
|
|
|
foreach($data as $value){
|
...
|
...
|
|