修改下单优惠逻辑
This commit is contained in:
parent
f591acf7ca
commit
0a67e0c090
@ -9,6 +9,8 @@ use app\common\enum\YesNoEnum;
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\logic\CapitalFlowLogic;
|
||||
use app\common\logic\StoreFinanceFlowLogic;
|
||||
use app\common\model\dict\DictData;
|
||||
use app\common\model\dict\DictType;
|
||||
use app\common\model\order\Cart;
|
||||
use app\common\model\store_branch_product\StoreBranchProduct;
|
||||
use app\common\model\store_order\StoreOrder;
|
||||
@ -76,10 +78,13 @@ class OrderLogic extends BaseLogic
|
||||
}
|
||||
//TODO 收单打9.9折 会员按照比例打折 等级按照充值去升级
|
||||
$pay_price = self::$total;
|
||||
$check = StoreOrder::where('uid',\request()->userId)->count();
|
||||
// $check = StoreOrder::where('uid',\request()->userId)->count();//首单逻辑
|
||||
$check = DictType::where('type','activities')->find();
|
||||
$vipPrice = 0;
|
||||
if(empty($check)){
|
||||
$discountRate = '0.99';
|
||||
if(isset($check) && $check['status'] == 1){
|
||||
// $discountRate = '0.99';//首单逻辑
|
||||
$discountRate = $check['remark'];
|
||||
$discountRate = bcdiv($discountRate, '100', 2);
|
||||
$pay_price = bcdiv(bcmul($pay_price, $discountRate, 4), '1', 2);
|
||||
}else{
|
||||
$userVip = User::where('id',\request()->userId)->value('user_ship');
|
||||
@ -103,6 +108,7 @@ class OrderLogic extends BaseLogic
|
||||
default:
|
||||
$discountRate = 1;
|
||||
}
|
||||
$discountRate = bcdiv($discountRate, '100', 2);
|
||||
$pay_price = bcdiv(bcmul($pay_price, $discountRate, 4), '1', 2);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user