Browse Source

fix:待验收订单统计

super-yimizi 1 month ago
parent
commit
35bb0ed222

+ 4 - 1
application/common/Enum/OrderEnum.php

@@ -196,7 +196,10 @@ class OrderEnum
     // 验货端 前端传的参数
     // 验货端 前端传的参数
     const SHOW_INSPECTION_TYPE_STATUS_MAP = [   
     const SHOW_INSPECTION_TYPE_STATUS_MAP = [   
         self::SHOW_TYPE_WAIT_INSPECTION => [
         self::SHOW_TYPE_WAIT_INSPECTION => [
-            self::STATUS_PAY
+            self::STATUS_PAY,
+            self::STATUS_INSPECTION,
+            self::STATUS_INSPECTION_PASS,
+            self::STATUS_INSPECTION_FAIL,
         ],
         ],
         self::SHOW_TYPE_WAIT_INSPECTION_SHIP => [
         self::SHOW_TYPE_WAIT_INSPECTION_SHIP => [
             self::STATUS_INSPECTION_PASS
             self::STATUS_INSPECTION_PASS

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

@@ -607,6 +607,12 @@ class OrderService
         $info['unsend'] = Order::where('user_id', $userId)->where('order_status',OrderEnum::STATUS_PAY)->count();
         $info['unsend'] = Order::where('user_id', $userId)->where('order_status',OrderEnum::STATUS_PAY)->count();
         $info['unrec'] = Order::where('user_id', $userId)->where('order_status',OrderEnum::STATUS_SHIP)->count();
         $info['unrec'] = Order::where('user_id', $userId)->where('order_status',OrderEnum::STATUS_SHIP)->count();
         $info['uneva'] = Order::where('user_id', $userId)->where('order_status',OrderEnum::STATUS_CONFIRM)->count();
         $info['uneva'] = Order::where('user_id', $userId)->where('order_status',OrderEnum::STATUS_CONFIRM)->count();
+        $info['inspect'] = Order::where('user_id', $userId)
+        ->whereIn('order_status',[
+            OrderEnum::STATUS_INSPECTION,
+            OrderEnum::STATUS_INSPECTION_PASS,
+            OrderEnum::STATUS_INSPECTION_FAIL])
+            ->count();
        
        
         return $info;
         return $info;
     }
     }

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

@@ -607,6 +607,12 @@ class OrderService
         $info['unsend'] = Order::where('user_id', $userId)->where('order_status',OrderEnum::STATUS_PAY)->count();
         $info['unsend'] = Order::where('user_id', $userId)->where('order_status',OrderEnum::STATUS_PAY)->count();
         $info['unrec'] = Order::where('user_id', $userId)->where('order_status',OrderEnum::STATUS_SHIP)->count();
         $info['unrec'] = Order::where('user_id', $userId)->where('order_status',OrderEnum::STATUS_SHIP)->count();
         $info['uneva'] = Order::where('user_id', $userId)->where('order_status',OrderEnum::STATUS_CONFIRM)->count();
         $info['uneva'] = Order::where('user_id', $userId)->where('order_status',OrderEnum::STATUS_CONFIRM)->count();
+        $info['inspect'] = Order::where('user_id', $userId)
+        ->whereIn('order_status',[
+            OrderEnum::STATUS_INSPECTION,
+            OrderEnum::STATUS_INSPECTION_PASS,
+            OrderEnum::STATUS_INSPECTION_FAIL])
+            ->count();
        
        
         return $info;
         return $info;
     }
     }