Commit d2279de7 authored by jianghaiming's avatar jianghaiming

update:SEt

parent 65a3c3fa
......@@ -64,5 +64,6 @@ class GoodsException extends BaseException
45 => '还没有try,就去执行confirm',
46 => '已经执行过cancel',
47 => 'sku rollback error',
48 => '商户结算价不能大于分润价加支付价',
];
}
\ No newline at end of file
......@@ -473,23 +473,26 @@ class MarketingService
}
$colums = [];
$goodCount = !empty($goodsSkuId) ? count($goodsSkuId) : 0;
$goodsSkuList = GoodsSku::select('*', ['goods_sku_id' => $goodsSkuId]);
foreach ($goodsSkuList as $key => $value) {
$clearPrice = !empty($value["clear_price"]) ? $value["clear_price"]*100 : 0;
$price = !empty($value["price"]) ? $value["price"]*100 : 0;
// if ($commissionMode == Marketing::COMMISSION_MODE_RATE) {
// $commissionTotal = ($firstCommissionRate + $secondCommissionRate) / 1000 * $price;
// if ($price - $commissionTotal < $clearPrice) {
// throw new GoodsException(['cus' => 36]);
// }
// }
//
// if ($commissionMode == Marketing::COMMISSION_MODE_FIXED) {
// $commissionTotal = ($firstCommissionRate + $secondCommissionRate);
// if ($price - $commissionTotal < $clearPrice) {
// throw new GoodsException(['cus' => 36]);
// }
// }
$clearPrice = !empty($value["clear_price"]) ? $value["clear_price"] : 0;
$price = !empty($value["price"]) ? $value["price"] : 0;
if (!empty($clearPrice) && $clearPrice > 0) {
if ($commissionMode == Marketing::COMMISSION_MODE_RATE) {
$commissionTotal = ($firstCommissionRate + $secondCommissionRate) / 1000 * $price;
if ($price - $commissionTotal < $clearPrice) {
throw new GoodsException(['cus' => 48]);
}
}
if ($commissionMode == Marketing::COMMISSION_MODE_FIXED) {
$commissionTotal = ($firstCommissionRate + $secondCommissionRate);
if ($price - $commissionTotal < $clearPrice) {
throw new GoodsException(['cus' => 48]);
}
}
}
$colums[$key]['marketing_id'] = $marketingId;
$colums[$key]['goods_spu_id'] = $value['goods_spu_id'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment