优惠券判断抵扣和打折,处理bug

main
yanzai 1 year ago
parent fd110bbc0e
commit 165498951e

@ -483,7 +483,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
}
}
if($quanInfo['是否在有效内']===true and $quanInfo['TimeNuZTTextm']=="有效" and $quanInfo['ZT']==1){
if(!!$quanInfo and $quanInfo['是否在有效内']===true and $quanInfo['TimeNuZTTextm']=="有效" and $quanInfo['ZT']==1){
}else{
return \Yz::echoError1("此代金券不可用");
@ -502,9 +502,15 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
if($quanType===false or $quanInfo===false) return \Yz::echoError1("此代金券不可用");
if($quanType['TJXCXHX']!=1 ) return \Yz::echoError1("此代金券不可用");
if($quanType['MKJE']==0 or $quanType['MKJE']>=$true_price){
//抵扣代金券金额,折扣暂未实现
//抵扣代金券金额
if($quanType['YHLX']==1){//抵扣券
$true_price=($true_price-$quanInfo['JE'])>0 ? $true_price-$quanInfo['JE']:0;
}
if($quanType['YHLX']==2){//抵扣券
$true_price=number_format($true_price*$quanType['DZBL'],2, '.', '');
}
}
}
}

@ -54,6 +54,7 @@ class OrderController extends Controller
$order_info = DB::table('orders')->where(['id' => $id])->first();
if (!!$order_info) {
$order_info->buy_info = json_decode($order_info->buy_info, true);
$order_info->erxian_appointment_info = json_decode($order_info->erxian_appointment_info, true);
} else {
return \Yz::echoError1('未找到有效订单');
}
@ -376,8 +377,13 @@ class OrderController extends Controller
if ($quanType === false or $quanInfo === false) return \Yz::echoError1("此代金券不可用");
if ($quanType['TJXCXHX'] != 1) return \Yz::echoError1("此代金券不可用");
if ($quanType['MKJE'] == 0 or $quanType['MKJE'] >= $true_price) {
//抵扣代金券金额,折扣暂未实现
$true_price = ($true_price - $quanInfo['JE']) > 0 ? $true_price - $quanInfo['JE'] : 0;
//抵扣代金券金额
if($quanType['YHLX']==1){//抵扣券
$true_price=($true_price-$quanInfo['JE'])>0 ? $true_price-$quanInfo['JE']:0;
}
if($quanType['YHLX']==2){//抵扣券
$true_price=number_format($true_price*$quanType['DZBL'],2, '.', '');
}
}

@ -60,11 +60,15 @@
return false;
}
if(props.TjType=="tj"){
//console.log(props.NmrDTime)
//console.log(props.TjDTime)
const a = new Date(props.NmrDTime.substring(0,10));
if (!isNaN(a.getTime())){
if(!validateDates(props.TjDTime,props.NmrDTime)){
return false;
}
}
//console.log(props.NmrDTime)
//console.log(props.TjDTime)
}
emit('selectTime', timeInfo);

@ -120,8 +120,13 @@
//
if (orderInfo.value.buy_info.nmr_list && orderInfo.value.buy_info.nmr_list.length > 0) {
itemSelected.value = 'nmr'
selectedTime.value = '10:45' //
selectedDate.value = '2024-10-09' //
if(orderInfo.value.erxian_appointment_info.length>0){
selectedTime.value = orderInfo.value.erxian_appointment_info[0].time //
selectedDate.value = orderInfo.value.erxian_appointment_info[0].date //
nmr_date.value = orderInfo.value.erxian_appointment_info[0].date
nmr_time.value = orderInfo.value.erxian_appointment_info[0].time
}
NMRGetDayPlanListFunc()
} else {
@ -131,8 +136,7 @@
GetDayPlanListFunc()
}
nmr_date.value = '2024-10-09'
nmr_time.value = '10:45'
tj_date.value = orderInfo.value.appointment_date
tj_time.value = orderInfo.value.appointment_time
});

@ -281,7 +281,7 @@
</view>
</view>
</view>
<view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">10302015</view>
<view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">10302313</view>
</view>
</view>
</template>

Loading…
Cancel
Save