|
|
@@ -299,6 +299,12 @@ class ServiceOrderLogic extends BaseLogic
|
|
|
$service_work = ServiceWork::find($work_id);
|
|
|
$service_work->service_status = 4;
|
|
|
$service_work->save();
|
|
|
+ //判断如果存在优惠券,返还优惠券
|
|
|
+ if(!empty($payed_order->coupon_id)){
|
|
|
+ $user_coupon = UserCoupon::where(['user_id'=>$payed_order->user_id,'id'=>$payed_order->coupon_id])->findOrEmpty();
|
|
|
+ $user_coupon->voucher_status = 0;
|
|
|
+ $user_coupon->save();
|
|
|
+ }
|
|
|
|
|
|
Db::commit();
|
|
|
}
|