...
|
...
|
@@ -368,18 +368,21 @@ class User extends Api |
|
|
//查询商品所属品牌id
|
|
|
$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 = [];
|
|
|
}
|
|
|
//包含品牌中的商品
|
|
|
$time = time();
|
|
|
$where2['id'] = ['in',$receive_s];
|
|
|
$where2['end_time'] = ['>',$time];
|
|
|
$where2['bg_id'] = ['in',$b_id_s];
|
|
|
$where2['type'] = $type[1];
|
|
|
$where['id'] = ['in',$receive_s];
|
|
|
$where['end_time'] = ['>',$time];
|
|
|
|
|
|
//普通商品
|
|
|
$where1['id'] = ['in',$receive_s];
|
|
|
$where1['end_time'] = ['>',$time];
|
|
|
$where1['bg_id'] = ['in',$goods_id_s];
|
|
|
$where1['type'] = $type[2];
|
|
|
$data = Common::selectWhereOrData('coupon',$where1,$where2,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number,end_time','c_type asc,coupon_type desc');
|
|
|
$data = Common::selectWhereOrData('coupon',$where,$where1,$where2,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number,end_time','c_type asc,coupon_type desc');
|
|
|
}else{
|
|
|
$where['id'] = ['in',$receive_s];
|
|
|
$data = Common::selectWhereData('coupon',$where,'id,type,coupon_name,c_type,coupon_type,full_reduce,reduce,discount,coupon_number,end_time','c_type asc,coupon_type desc');
|
...
|
...
|
|