调整店铺内云商品查询

This commit is contained in:
luofei 2023-05-25 11:04:01 +08:00
parent dbf8ab42f5
commit 5be47b6a30
2 changed files with 13 additions and 4 deletions

View File

@ -1325,6 +1325,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
'integral' => $cart['integral'] ? bcdiv($cart['integral']['use'], $cart['cart_num'], 0) : 0,
'integral_total' => $cart['integral'] ? $cart['integral']['use'] : 0,
'product_type' => $cart['product_type'],
'source_mer_id' => $cart['source'] == StoreCartDao::SOURCE_CLOUD ? $cart['source_id'] : 0,
'cart_info' => json_encode($order_cart)
];
}

View File

@ -90,12 +90,12 @@ class StoreSpu extends BaseController
/**
* TODO 镇云仓库商户的商品搜索列表
* @param $id
* @param int $id
* @return mixed
* @author Qinii
* @day 12/24/20
*/
public function cloudMerProductLst($id)
public function cloudMerProductLst(int $id)
{
[$page, $limit] = $this->getPage();
$where = $this->request->params([
@ -103,10 +103,18 @@ class StoreSpu extends BaseController
]);
if ($where['action']) unset($where['product_type']);
$category_id=Db::name('merchant')->where('mer_id',$id)->value('category_id');
$mer_id=Db::name('merchant')->where('mer_state',1)->where('status',1)->where('category_id',$category_id)->where('type_id',Merchant::TypeCloudWarehouse)->value('mer_id');
$streetId = Db::name('merchant_address')->where('mer_id', $id)->value('street_id');
$mer_id=Db::name('merchant')
->alias('m')
->leftJoin('merchant_address ma', 'm.mer_id=ma.mer_id')
->where('street_id',$streetId)
->where('mer_state',1)
->where('m.status',1)
->where('category_id',$category_id)
->where('type_id',Merchant::TypeCloudWarehouse)
->value('m.mer_id');
if (!$mer_id){
return app('json')->success(['count'=>0,'list'=>[]]);
}
$where['mer_id'] = $mer_id;
$where['entry_mer_id'] = $id;