修改订单金额匹配商品

This commit is contained in:
luofei 2024-03-15 17:47:03 +08:00
parent eefde6451a
commit b2ea8b4a5e
2 changed files with 3 additions and 5 deletions

View File

@ -2574,14 +2574,13 @@ class StoreOrderRepository extends BaseRepository
public function dealGoodsList($where,$money) public function dealGoodsList($where,$money)
{ {
$data = ProductAttrValue::getDB()->alias('a') $data = ProductAttrValue::alias('a')
->leftJoin('store_product p', 'a.product_id = p.product_id') ->leftJoin('store_product p', 'a.product_id = p.product_id')
->where($where) ->where($where)
->where('a.stock', '>', 0)
->field('a.value_id,a.product_id,a.mer_id,a.sku,a.stock,a.image,a.price, ->field('a.value_id,a.product_id,a.mer_id,a.sku,a.stock,a.image,a.price,
a.svip_price, a.svip_price,
a.unique,p.store_name,p.store_info'); a.unique,p.store_name,p.store_info');
$list = $data->select(); $list = $data->limit(100)->select();
$count = $data->count(); $count = $data->count();
$minMoney = bcsub($money, 600, 2); $minMoney = bcsub($money, 600, 2);

View File

@ -314,12 +314,11 @@ class StoreOrder extends BaseController
return app('json')->fail('参数缺失'); return app('json')->fail('参数缺失');
} }
$where = [ $where = [
"a.mer_id" => $merId,
"p.is_show" => 1, "p.is_show" => 1,
"p.status" => 1, "p.status" => 1,
"p.product_type" => 0,
"p.is_gift_bag" => 0 "p.is_gift_bag" => 0
]; ];
$where['a.mer_id'] = $merId;
return app('json')->success($this->repository->dealGoodsList($where,$money)); return app('json')->success($this->repository->dealGoodsList($where,$money));