修改活动下创建订单价格为商品的市场价
This commit is contained in:
parent
8299b9b428
commit
da2f12b219
@ -57,11 +57,15 @@ class OrderLogic extends BaseLogic
|
|||||||
try {
|
try {
|
||||||
self::$total = 0;
|
self::$total = 0;
|
||||||
/** 计算价格 */
|
/** 计算价格 */
|
||||||
|
$check = DictType::where('type','activities')->find();
|
||||||
foreach ($cart_select as $k => $v) {
|
foreach ($cart_select as $k => $v) {
|
||||||
$find = StoreBranchProduct::where(['id' => $v['goods']])->field('store_name,image,unit,price')->find();
|
$find = StoreBranchProduct::where(['id' => $v['goods']])->field('store_name,image,unit,price,product_id')->find();
|
||||||
if (!$find) {
|
if (!$find) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if(isset($check) && $check['status'] == 1){
|
||||||
|
$find['price'] = StoreProduct::where('product_id',$find['product_id'])->value('ot_price');
|
||||||
|
}
|
||||||
$cart_select[$k]['total'] = bcmul($v['cart_num'], $find['price'], 2);//钱
|
$cart_select[$k]['total'] = bcmul($v['cart_num'], $find['price'], 2);//钱
|
||||||
$cart_select[$k]['price'] = $find['price'];
|
$cart_select[$k]['price'] = $find['price'];
|
||||||
$cart_select[$k]['product_id'] = $v['goods'];
|
$cart_select[$k]['product_id'] = $v['goods'];
|
||||||
@ -87,7 +91,6 @@ class OrderLogic extends BaseLogic
|
|||||||
//TODO 收单打9.9折 会员按照比例打折 等级按照充值去升级
|
//TODO 收单打9.9折 会员按照比例打折 等级按照充值去升级
|
||||||
$pay_price = self::$total;
|
$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;
|
$vipPrice = 0;
|
||||||
if(isset($check) && $check['status'] == 1){
|
if(isset($check) && $check['status'] == 1){
|
||||||
// $discountRate = '0.99';//首单逻辑
|
// $discountRate = '0.99';//首单逻辑
|
||||||
|
Loading…
x
Reference in New Issue
Block a user