liugc 1 年之前
父节点
当前提交
64c086ec3a
共有 2 个文件被更改,包括 10 次插入7 次删除
  1. 0 7
      app/api/controller/ServiceOrderController.php
  2. 10 0
      app/api/logic/ServiceOrderLogic.php

+ 0 - 7
app/api/controller/ServiceOrderController.php

@@ -116,13 +116,6 @@ class ServiceOrderController extends BaseApiController
         if (false === $result) {
             return $this->fail(ServiceOrderLogic::getError());
         }
-        // 订单取消通知【给用户】
-        $res = event('Notice',  [
-            'scene_id' => 122,
-            'params' => [
-                'user_id' => $params['user_id']
-            ]
-        ]);
         return $this->success('取消成功', [], 1, 1);
     }
 

+ 10 - 0
app/api/logic/ServiceOrderLogic.php

@@ -733,6 +733,16 @@ class ServiceOrderLogic extends BaseLogic
             }
 
             Db::commit();
+
+            if($cancel_order->pay_time){
+                // 订单取消通知【给用户】
+                event('Notice',  [
+                    'scene_id' => 122,
+                    'params' => [
+                        'user_id' => $params['user_id']
+                    ]
+                ]);
+            }
         }
         catch (\Exception $e) {
             self::setError($e->getMessage());