处理红包使用后未扣除的问题
This commit is contained in:
parent
641f53ec6e
commit
742310d811
@ -40,7 +40,7 @@ class StoreActivityOrderDao extends BaseDao
|
||||
if (!empty($consumptionDetail['amount'])) {
|
||||
// 当前订单使用现金抵扣红包 或 使用通用红包后实付金额不足红包金额的1.5倍,视为无效订单
|
||||
$redPackType = StoreConsumptionUser::where('coupon_user_id', $consumptionDetail['coupon_user_id'])->value('type');
|
||||
if ($redPackType == StoreConsumptionUser::TYPE_TWO || $consumptionDetail['pay_price'] < $consumptionDetail['amount'] * 1.5) {
|
||||
if ($redPackType == StoreConsumptionUser::TYPE_TWO || ($redPackType == StoreConsumptionUser::TYPE_TWO && $consumptionDetail['pay_price'] < $consumptionDetail['amount'] * 1.5)) {
|
||||
$model->status = StoreActivityOrder::STATUS_INVALID;
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ class StoreConsumptionUserDao extends BaseDao
|
||||
$isFirstOrder = $this->isFirstOrder($userId, $consumption['start_time'], date('Y-m-d H:i:s', $endTime));
|
||||
$storeActivityOrderDao = new StoreActivityOrderDao();
|
||||
$storeActivityOrder = $storeActivityOrderDao->save($groupOrder, $spreadUserId, $isFirstOrder);
|
||||
if ($consumption['type'] == StoreConsumption::TYPE_OWNER_CONSUMPTION && $storeActivityOrder['status'] == StoreActivityOrder::STATUS_VALID) {
|
||||
if ($consumption['type'] == StoreConsumption::TYPE_OWNER_CONSUMPTION && $storeActivityOrder['status'] == StoreActivityOrder::STATUS_VALID && $storeActivityOrder['red_pack'] == 0) {
|
||||
$this->send($consumption, $scope['rate'], $userId, $groupOrder['group_order_id'], $orderValidAmount, StoreConsumptionUser::STATUS_UNUSED);
|
||||
$this->send($consumption, $scope['rate_two'], $userId, $groupOrder['group_order_id'], $orderValidAmount, StoreConsumptionUser::STATUS_UNUSED, StoreConsumptionUser::TYPE_TWO);
|
||||
$storeActivityOrderDao->repeal($groupOrder['group_order_id']);
|
||||
|
@ -37,7 +37,7 @@ class paySuccess
|
||||
$orderList = $event['groupOrder']['orderList'];
|
||||
$storeConsumptionUserDao = new StoreConsumptionUserDao();
|
||||
$storeConsumptionUserDao->check($event['groupOrder']['uid'], $event['groupOrder']['group_order_id']);
|
||||
$storeConsumptionUserDao->reduce($event['groupOrder']['consumption_id'], $event['groupOrder']['consumption_money']);
|
||||
// $storeConsumptionUserDao->reduce($event['groupOrder']['consumption_id'], $event['groupOrder']['consumption_money']);
|
||||
foreach ($orderList as $k => $order) {
|
||||
//
|
||||
$StoreProcessing->AutomaticallyCreateOrders($order);
|
||||
|
Loading…
x
Reference in New Issue
Block a user