feat: 更新了商品相关的查询逻辑

This commit is contained in:
mkm 2024-06-11 11:59:43 +08:00
parent 3ac9061e28
commit 046f830394
3 changed files with 4 additions and 4 deletions

View File

@ -45,9 +45,9 @@ class StoreOrderCartInfoLists extends BaseAdminDataLists implements ListsSearchI
public function lists(): array
{
return StoreOrderCartInfo::where($this->searchWhere)
->field('cart_info,product_id')->limit($this->limitOffset, $this->limitLength)
->field('cart_info,product_id,store_id')->limit($this->limitOffset, $this->limitLength)
->select()->each(function ($item) {
$find=StoreBranchProduct::where('id',$item['product_id'])->field('image,store_name')->find();
$find=StoreBranchProduct::where('product_id',$item['product_id'])->where('store_id',$item['store_id'])->field('image,store_name')->find();
if($find){
$item['image']=$find['image'];//商品图片
$item['store_name']=$find['store_name'];//商品名称

View File

@ -292,7 +292,7 @@ class OrderLogic extends BaseLogic
return [];
}
$goods_arr = array_unique($goods_id);
$select = StoreBranchProduct::where('id', 'in', $goods_arr)->with('unitName')->field('id,store_name,price,image,unit')->select();
$select = StoreBranchProduct::where('product_id', 'in', $goods_arr)->with('unitName')->field('id,store_name,price,image,unit')->select();
return $select->toArray();
} catch (\Exception $e) {
self::setError($e->getMessage());

View File

@ -114,7 +114,7 @@ class PayNotifyLogic extends BaseLogic
//活动期间消费
$check = DictType::where('type', 'activities')->find();
if (isset($check) && $check['status'] == 1 && $user['user_ship'] == 0) {
if (isset($check) && $check['status'] == 1 && in_array($order->pay_type,[9,17])==false && $user['user_ship'] == 0) {
self::dealChange($order['uid']);
}