coupon_id <= 0) return; $couponInfo = $this->userCouponModel->where('coupon_id', $orderInfo->coupon_id)->where('user_id',$orderInfo->user_id)->first(); if (empty($couponInfo)) return; $couponInfo->status = CouponCode::COUPON_STATUS_UNUSED; if (date('Y-m-d H:i:s') > $couponInfo->validity_end_time) $couponInfo->status = CouponCode::COUPON_STATUS_EXPIRE; if (!$couponInfo->save()) throw new Exception('CancelOrderConsumer:error:couponStatusUpdateError:'.json_encode($orderInfo->toArray())); } }