处理分组价格设置的错误
This commit is contained in:
parent
4a06cb516f
commit
b110e042d8
@ -307,12 +307,6 @@ class PurchaseProductOfferLogic extends BaseLogic
|
|||||||
|
|
||||||
public static function setProductGroupPrice($params, $product)
|
public static function setProductGroupPrice($params, $product)
|
||||||
{
|
{
|
||||||
$productCatePriceRate = StoreCategory::where('id', $product['top_cate_id'])->value('price_rate');
|
|
||||||
if (empty($productCatePriceRate)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$storeProductGroupPrice = StoreProductGroupPrice::where('product_id', $product['id'])->select()->toArray();
|
|
||||||
$storeProductGroupPrice = reset_index($storeProductGroupPrice, 'group_id');
|
|
||||||
$priceConfig = [];
|
$priceConfig = [];
|
||||||
$data = [
|
$data = [
|
||||||
'bhoid' => $params['bhoid'],
|
'bhoid' => $params['bhoid'],
|
||||||
@ -323,6 +317,10 @@ class PurchaseProductOfferLogic extends BaseLogic
|
|||||||
'update_time' => time(),
|
'update_time' => time(),
|
||||||
'status' => 0,
|
'status' => 0,
|
||||||
];
|
];
|
||||||
|
$productCatePriceRate = StoreCategory::where('id', $product['top_cate_id'])->value('price_rate');
|
||||||
|
if (!empty($productCatePriceRate)) {
|
||||||
|
$storeProductGroupPrice = StoreProductGroupPrice::where('product_id', $product['id'])->select()->toArray();
|
||||||
|
$storeProductGroupPrice = reset_index($storeProductGroupPrice, 'group_id');
|
||||||
foreach ($productCatePriceRate as $k => $v) {
|
foreach ($productCatePriceRate as $k => $v) {
|
||||||
if ($v['id'] == 4) {
|
if ($v['id'] == 4) {
|
||||||
$data['cost_lv'] = bcdiv($v['rate'], 100, 2);
|
$data['cost_lv'] = bcdiv($v['rate'], 100, 2);
|
||||||
@ -363,6 +361,7 @@ class PurchaseProductOfferLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
$priceConfig[] = $item;
|
$priceConfig[] = $item;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$data['price_config'] = $priceConfig;
|
$data['price_config'] = $priceConfig;
|
||||||
$find = StoreProductPrice::where(['offer_id' => $params['id']])->find();
|
$find = StoreProductPrice::where(['offer_id' => $params['id']])->find();
|
||||||
if ($find) {
|
if ($find) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user