diff --git a/app/common/model/Goods.php b/app/common/model/Goods.php index 1ab759c5..383947a9 100644 --- a/app/common/model/Goods.php +++ b/app/common/model/Goods.php @@ -473,17 +473,17 @@ class Goods extends BaseModel !empty($params['goodsNo']) && $filter[] = ['goods_no', 'like', "%{$params['goodsNo']}%"]; //wmc - if (!empty($param['is_brand'])) { - $filter[] = ['is_brand', '=', intval($param['is_brand'])]; - } - if (!empty($param['is_new'])) { - $filter[] = ['is_new', '=', intval($param['is_new'])]; - } + // if (!empty($param['is_brand'])) { + // $filter[] = ['is_brand', '=', intval($param['is_brand'])]; + // } + // if (!empty($param['is_new'])) { + // $filter[] = ['is_new', '=', intval($param['is_new'])]; + // } - if (!empty($param['paihang'])) { - $filter[] = ['paihang', '>', 0]; - $query->order('paihang asc'); - } + // if (!empty($param['paihang'])) { + // $filter[] = ['paihang', '>', 0]; + // $query->order('paihang asc'); + // } if (isset($param['spec_type']) && $param['spec_type'] !== '') { $filter[] = ['spec_type', '=', $params['spec_type']]; } @@ -497,9 +497,9 @@ class Goods extends BaseModel } //是否店内 //if (isset($param['is_in_store']) && $param['is_in_store'] !== '') { - if (isset($param['is_in_store']) && $param['is_in_store']) { - $filter[] = ['is_in_store', '=', $params['is_in_store']]; - } + // if (isset($param['is_in_store']) && $param['is_in_store']) { + // $filter[] = ['is_in_store', '=', $params['is_in_store']]; + // } if (isset($param['store_id']) && $param['store_id'] !== '') { $filter[] = ['goods.store_id', '=', $params['store_id']]; @@ -527,6 +527,23 @@ class Goods extends BaseModel if (isset($param['is_jingpin']) && $param['is_jingpin'] !== '') { $filter[] = ['goods.is_jingpin', '=', $params['is_jingpin']]; } + if (isset($param['is_brand']) && $param['is_brand'] !== '') { + $filter[] = ['goods.is_brand', '=', $params['is_brand']]; + } + if (isset($param['is_new']) && $param['is_new'] !== '') { + $filter[] = ['goods.is_new', '=', $params['is_new']]; + } + if (isset($param['is_in_store']) && $param['is_in_store'] !== '') { + $filter[] = ['goods.is_in_store', '=', $params['is_in_store']]; + } + if (isset($param['is_paihang']) && $param['is_paihang'] !== '') { + if ($param['is_paihang'] > 0 ) { + $filter[] = ['goods.paihang', '>', 0]; + } else { + $filter[] = ['goods.paihang', '=', 0]; + } + + } if (isset($param['start_time']) && $param['start_time'] !== '') { $filter[] = ['goods.create_time', '>=', strtotime($params['start_time'])]; } @@ -566,9 +583,6 @@ class Goods extends BaseModel if (isset($param['is_has_detail']) && $param['is_has_detail'] !== '') { $filter[] = ['goods.is_has_detail', '=', $params['is_has_detail']]; } - // if (isset($param['merchantId']) && $param['merchantId'] !== '') { - // $filter[] = ['goods.merchant_id', '=', $params['merchantId']]; - // } if (isset($param['is_jd_remove']) && $param['is_jd_remove'] !== '') { $filter[] = ['goods.is_jd_remove', '=', $params['is_jd_remove']]; }