diff --git a/app/common/dao/store/product/SpuDao.php b/app/common/dao/store/product/SpuDao.php index 0c43114a..45a1dfb5 100644 --- a/app/common/dao/store/product/SpuDao.php +++ b/app/common/dao/store/product/SpuDao.php @@ -200,11 +200,12 @@ class SpuDao extends BaseDao ->when(isset($where['svip']) && $where['svip'] !== '',function($query)use($where){ $query->where('svip_price_type','>',0)->where('mer_svip_status',1); }) - ->when(isset($where['exchange_rate']) && $where['exchange_rate'] !== '',function($query)use($where){ - $productIds = ProductAttrValue::where('profit_rate', $where['exchange_rate'])->column('product_id'); - if (!empty($productIds)) { - $query->whereIn('product_id', $productIds); + ->when(isset($where['deduction_rate']) && $where['deduction_rate'] !== '',function($query)use($where){ + $productIds = ProductAttrValue::where('profit_rate', $where['deduction_rate'])->column('product_id'); + if (empty($productIds)) { + $productIds = [0]; } + $query->whereIn('S.product_id', $productIds); }) ; return $query->order($order); diff --git a/app/controller/api/store/product/StoreSpu.php b/app/controller/api/store/product/StoreSpu.php index 0a9dfc83..4f895b9c 100644 --- a/app/controller/api/store/product/StoreSpu.php +++ b/app/controller/api/store/product/StoreSpu.php @@ -60,7 +60,7 @@ class StoreSpu extends BaseController 'mer_id', 'filter_params', 'mer_type_id', - 'exchange_rate' + 'deduction_rate' ]); $where['is_gift_bag'] = 0; $where['product_type'] = 0; diff --git a/crmeb/listens/SetProductProfitRateListen.php b/crmeb/listens/SetProductProfitRateListen.php index d8ea62ad..be2c597c 100644 --- a/crmeb/listens/SetProductProfitRateListen.php +++ b/crmeb/listens/SetProductProfitRateListen.php @@ -21,7 +21,7 @@ class SetProductProfitRateListen extends TimerService implements ListenerInterfa $storeProducts = ProductAttrValue::where('profit_rate', 0) ->where('procure_price', '>', 0) ->whereRaw('price>procure_price') - ->limit(50) + ->limit(100) ->select(); foreach ($storeProducts as $storeProduct) { $storeProduct->profit_rate = bcdiv($storeProduct->procure_price, $storeProduct->price, 2) * 100;