commit
c949a84cfa
@ -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) {
|
||||||
|
@ -106,13 +106,13 @@ class StoreOrderCartInfoLogic extends BaseLogic
|
|||||||
if($find['is_pay']==1){
|
if($find['is_pay']==1){
|
||||||
throw new BusinessException('已支付订单无法编辑');
|
throw new BusinessException('已支付订单无法编辑');
|
||||||
}
|
}
|
||||||
$value=DictData::where('type_value','vendors_store')->column('value');
|
// $value=DictData::where('type_value','vendors_store')->column('value');
|
||||||
if(!$value){
|
// if(!$value){
|
||||||
throw new BusinessException('请先配置店铺');
|
// throw new BusinessException('请先配置店铺');
|
||||||
}
|
// }
|
||||||
if(!in_array($find['store_id'],$value)){
|
// if(!in_array($find['store_id'],$value)){
|
||||||
throw new BusinessException('该订单不属于可设置店铺');
|
// throw new BusinessException('该订单不属于可设置店铺');
|
||||||
}
|
// }
|
||||||
$find->cart_num = $params['cart_num'];
|
$find->cart_num = $params['cart_num'];
|
||||||
$find->total_price = bcmul($params['cart_num'], $find->price, 2);
|
$find->total_price = bcmul($params['cart_num'], $find->price, 2);
|
||||||
$find->save();
|
$find->save();
|
||||||
@ -144,13 +144,13 @@ class StoreOrderCartInfoLogic extends BaseLogic
|
|||||||
if($find['is_pay']==1){
|
if($find['is_pay']==1){
|
||||||
throw new BusinessException('已支付订单无法删除');
|
throw new BusinessException('已支付订单无法删除');
|
||||||
}
|
}
|
||||||
$value=DictData::where('type_value','vendors_store')->column('value');
|
// $value=DictData::where('type_value','vendors_store')->column('value');
|
||||||
if(!$value){
|
// if(!$value){
|
||||||
throw new BusinessException('请先配置店铺');
|
// throw new BusinessException('请先配置店铺');
|
||||||
}
|
// }
|
||||||
if(!in_array($find['store_id'],$value)){
|
// if(!in_array($find['store_id'],$value)){
|
||||||
throw new BusinessException('该订单不属于可设置店铺');
|
// throw new BusinessException('该订单不属于可设置店铺');
|
||||||
}
|
// }
|
||||||
$find->delete_time=time();
|
$find->delete_time=time();
|
||||||
$find->save();
|
$find->save();
|
||||||
$total_price = StoreOrderCartInfo::where('oid', $find['oid'])->sum('total_price');
|
$total_price = StoreOrderCartInfo::where('oid', $find['oid'])->sum('total_price');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user