Kaynağa Gözat

退款问题

whitefang 1 yıl önce
ebeveyn
işleme
5b9c14c832
1 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  1. 3 2
      app/api/logic/ServiceOrderLogic.php

+ 3 - 2
app/api/logic/ServiceOrderLogic.php

@@ -862,17 +862,18 @@ class ServiceOrderLogic extends BaseLogic
             if($work->isEmpty()){
                 throw new Exception('工单不存在');
             }
+
             $work->refund_approval = 1;
             $work->save();
-
             //判断是否已下单时间过了两小时,并且师傅暂未上门,距离预约时间两小时以上
-            if(($order['pay_time']+7200)>time() and $work['work_status']<4 and ($work['appointment_time']-7200)>time()){
+            if(($order['pay_time']+7200)>time() and $work['work_status']<4 and (strtotime($work['appointment_time'])-7200)>time()){
                 //生成退款订单
                 \app\common\model\recharge\RechargeOrder::update([
                     'id' => $order['id'],
                     'refund_status' => YesNoEnum::YES,
                 ]);
 
+
                 // 生成退款记录
                 $recordSn = generate_sn(RefundRecord::class, 'sn');
                 $record = RefundRecord::create([