Merge pull request 'dev' (#483) from dev into main

Reviewed-on: #483
This commit is contained in:
mkm 2025-01-23 17:13:02 +08:00
commit c244eaca0c
7 changed files with 26 additions and 11 deletions

View File

@ -154,9 +154,9 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa
return $item;
})?->toArray();
// if ($userShip > 0 && $userShip != 4) {
// $list = StoreProductGroupPrice::resetProductsPrice($list, $userShip);
// }
if ($userShip > 0 && $userShip != 4) {
$list = StoreProductGroupPrice::resetStoreProductsPrice($list, $userShip, $this->params['store_id'] ?? 0);
}
return $list;
}

View File

@ -413,9 +413,7 @@ class BeforehandOrderCartInfoLogic extends BaseLogic
if (!$offerResult) {
throw new BusinessException('入库失败,采购信息更新出错');
}
$putInCount = PurchaseProductOffer::where('order_id', $purchaseProductOffer['order_id'])->where('is_storage', 1)->count();
$offerCount = PurchaseProductOffer::where('order_id', $purchaseProductOffer['order_id'])->count();
if ($putInCount == $offerCount) {
if ($beforehandOrder['is_warehousing'] == 0) {
$attrs = ['warehousing_id' => $warehouseOrder['id'], 'is_warehousing' => 1];
if ($beforehandOrder['order_type'] == 7) {
$attrs['is_buying'] = 1;

View File

@ -330,7 +330,7 @@ class StoreProductLogic extends BaseLogic
if ($userShip == 4) {
$data['price'] = $data['cost'];
} else {
$data = StoreProductGroupPrice::resetProductPrice($data, $userShip);
$data = StoreProductGroupPrice::resetStoreProductPrice($data, $userShip, $params['store_id'] ?? 0);
}
}
if($data['is_show']==1){

View File

@ -42,9 +42,9 @@ class StoreProductGroupPrice extends BaseModel
return $product;
}
public static function resetStoreProductsPrice($productList, $userShip, $shopId)
public static function resetStoreProductsPrice($productList, $userShip, $storeId)
{
if ($shopId > 0 && SystemStore::isSelfOperate($shopId) && $userShip > 0) {
if ($storeId > 0 && SystemStore::isSelfOperate($storeId) && $userShip > 0) {
foreach ($productList as &$item) {
$item['price'] = $item['vip_price'] > 0 ? $item['vip_price'] : $item['price'];
}
@ -54,9 +54,9 @@ class StoreProductGroupPrice extends BaseModel
}
}
public static function resetStoreProductPrice($product, $userShip, $shopId)
public static function resetStoreProductPrice($product, $userShip, $storeId)
{
if ($shopId > 0 && SystemStore::isSelfOperate($shopId) && $userShip > 0) {
if ($storeId > 0 && SystemStore::isSelfOperate($storeId) && $userShip > 0) {
$product['price'] = $product['vip_price'] > 0 ? $product['vip_price'] : $product['price'];
return $product;
} else {

View File

@ -150,4 +150,14 @@ class ConfigController extends BaseAdminController
return $this->success('ok', $list);
}
/**
* @notes 根据类型获取字典数据
*/
public function dict()
{
$type = $this->request->get('type', '');
$data = ConfigLogic::getDictByType($type);
return $this->data($data);
}
}

View File

@ -315,12 +315,16 @@ class BeforehandOrderController extends BaseAdminController
public function productLists()
{
$params = $this->request->get();
$params['store_id'] = $this->request->adminInfo['store_id'] ?? 0;
$this->request->setGet($params);
return $this->dataLists(new StoreProductLists());
}
public function productDetail()
{
$params = (new StoreProductValidate())->goCheck('detail');
$params['store_id'] = $this->request->adminInfo['store_id'] ?? 0;
$result = StoreProductLogic::detail($params);
return $this->data($result);
}

View File

@ -146,6 +146,9 @@ class StoreProductController extends BaseAdminController
*/
public function adminLists()
{
$params = $this->request->get();
$params['store_id'] = $this->request->adminInfo['store_id'] ?? 0;
$this->request->setGet($params);
return $this->dataLists(new StoreProductLists());
}