whitefang 1 سال پیش
والد
کامیت
cb22c20997
2فایلهای تغییر یافته به همراه35 افزوده شده و 0 حذف شده
  1. 12 0
      app/api/controller/ServiceOrderController.php
  2. 23 0
      app/api/logic/ServiceOrderLogic.php

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

@@ -40,6 +40,18 @@ class ServiceOrderController extends BaseApiController
         return $this->data($result);
         return $this->data($result);
     }
     }
 
 
+    public function getDetailStatus()
+    {
+        $params = (new ServiceOrderValidate())->goCheck('detail',[
+            'user_id' => $this->userId,
+        ]);
+        $result = ServiceOrderLogic::getDetailStatus($params);
+        if (false === $result) {
+            return $this->fail(ServiceOrderLogic::getError());
+        }
+        return $this->data($result);
+    }
+
     /**
     /**
      * 订单支付详情
      * 订单支付详情
      * @return \think\response\Json
      * @return \think\response\Json

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

@@ -523,6 +523,29 @@ class ServiceOrderLogic extends BaseLogic
             }
             }
     }
     }
 
 
+    public static function getDetailStatus($params)
+    {
+        try {
+            $order_info =  \app\common\model\recharge\RechargeOrder::with(['service_work'=>function ($query) {
+                $query->visible(['work_sn'])->append(['service_status_text','user_service_status','user_service_status_text']);
+            }])
+                ->visible(['id','sn'])
+                ->where([
+                    'order_type' => 0,
+                    'user_id' => $params['user_id'],
+                    'sn'=>$params['sn']
+                ])->findOrEmpty()->toArray();
+            if(empty($order_info)){
+                throw new Exception('订单不存在');
+            }
+            return $order_info;
+        }
+        catch (\Exception $e) {
+            self::setError($e->getMessage());
+            return false;
+        }
+    }
+
 
 
     /**
     /**
      * 获取订单支付详情
      * 获取订单支付详情