Browse Source

fix:验收格式

super-yimizi 1 month ago
parent
commit
2384f6856d

+ 1 - 1
application/api/controller/inspection/Order.php

@@ -97,7 +97,7 @@ class Order extends Base
       public function send()
       public function send()
       {
       {
           // 验证请求参数
           // 验证请求参数
-          $userId = $this->auth->id;
+          $userId = 0;
           $validate = new \app\api\validate\inspection\Order();
           $validate = new \app\api\validate\inspection\Order();
           $params = [
           $params = [
               'order_id' => $this->request->post('order_id'),
               'order_id' => $this->request->post('order_id'),

+ 6 - 2
application/common/Service/OrderService.php

@@ -537,11 +537,15 @@ class OrderService
      * @param $userId
      * @param $userId
      * @return array|false|\PDOStatement|string|Model
      * @return array|false|\PDOStatement|string|Model
      */
      */
-    public static function getDetail($orderId, $userId)
+    public static function getDetail($orderId = 0, $userId = 0)
     {
     {
         return Order::with(['orderGoods'])
         return Order::with(['orderGoods'])
         ->where('id', $orderId)
         ->where('id', $orderId)
-        ->where('user_id', $userId)
+        ->where(function($query) use ($userId){
+            if($userId > 0){
+                $query->where('user_id', $userId);
+            }
+        })
         ->find();
         ->find();
     }
     }
 
 

+ 6 - 2
application/common/service/OrderService.php

@@ -537,11 +537,15 @@ class OrderService
      * @param $userId
      * @param $userId
      * @return array|false|\PDOStatement|string|Model
      * @return array|false|\PDOStatement|string|Model
      */
      */
-    public static function getDetail($orderId, $userId)
+    public static function getDetail($orderId = 0, $userId = 0)
     {
     {
         return Order::with(['orderGoods'])
         return Order::with(['orderGoods'])
         ->where('id', $orderId)
         ->where('id', $orderId)
-        ->where('user_id', $userId)
+        ->where(function($query) use ($userId){
+            if($userId > 0){
+                $query->where('user_id', $userId);
+            }
+        })
         ->find();
         ->find();
     }
     }