|
|
@@ -58,7 +58,7 @@ class MemberCouponService extends BaseService
|
|
|
*/
|
|
|
public function getDataList($params, $pageSize = 15)
|
|
|
{
|
|
|
- $where = ['a.marks' => 1,'a.status'=>1];
|
|
|
+ $where = ['a.mark' => 1,'a.status'=>1];
|
|
|
$status = isset($params['status']) ? $params['status'] : 0;
|
|
|
if ($status > 0) {
|
|
|
$where['a.status'] = $status;
|
|
|
@@ -68,14 +68,14 @@ class MemberCouponService extends BaseService
|
|
|
$where['a.user_id'] = $userId;
|
|
|
}
|
|
|
$list = $this->model->from('member_coupons as a')
|
|
|
- ->where($where)
|
|
|
->where(function($query) use($params){
|
|
|
$ids = isset($params['ids'])?$params['ids']:[];
|
|
|
if($ids){
|
|
|
$query->where(function($query) use($ids){
|
|
|
- $query->where('goods_ids','')
|
|
|
- ->orWhereRaw("FIND_IN_SET(?, goods_ids)",[implode(',', $ids)]);
|
|
|
-
|
|
|
+ $query->where('a.goods_ids','');
|
|
|
+ foreach ($ids as $id){
|
|
|
+ $query->orWhere('a.goods_ids','like', "%{$id},%");
|
|
|
+ }
|
|
|
});
|
|
|
}else{
|
|
|
$query->where('goods_ids','=','');
|
|
|
@@ -92,6 +92,7 @@ class MemberCouponService extends BaseService
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
+ ->where($where)
|
|
|
->select(['a.*'])
|
|
|
->orderBy('a.reduce_price', 'desc')
|
|
|
->orderBy('a.id', 'desc')
|