cqpCow 2 anni fa
parent
commit
6a76b3b130

+ 2 - 2
app/Http/Controllers/Api/ScreenController.php

@@ -135,7 +135,7 @@ class ScreenController extends BaseController
      * @param Request $request
      * @return array
      */
-    public function output_value_efficiency(Request $request){
+    public function output_value_efficiency1(Request $request){
         // 获取当前时间戳
         $currentTimestamp = time();
         // 输出过去两周的起止时间(包括当前日期)
@@ -176,7 +176,7 @@ class ScreenController extends BaseController
     }
 
     //产量趋势图(完工)
-    public function output_value_efficiency1(Request $request){
+    public function output_value_efficiency(Request $request){
         // 获取当前时间
         $date = date('Ymd',time());
         $model = new OrdersProductProcess(['channel' => $date]);//当前季度的数据

+ 7 - 0
app/Service/DispatchService.php

@@ -243,6 +243,13 @@ class DispatchService extends Service
         if(! empty($data['out_checker_time'][0]) && ! empty($data['out_checker_time'][1])) $model->whereBetween('out_checker_time',[$data['out_checker_time'][0],$data['out_checker_time'][1]]);
         if(! empty($data['production_time'][0]) && ! empty($data['production_time'][1])) $model->whereBetween('production_time',[$data['production_time'][0],$data['production_time'][1]]);
         if(isset($data['status'])) $model->where('status',$data['status']);
+        if(isset($data['is_create'])) {
+            if($data['is_create']){
+                $model->whereColumn('dispatch_complete_quantity', '>=', 'production_quantity');
+            }else{
+                $model->whereColumn('production_quantity', '>', 'dispatch_complete_quantity');
+            }
+        }
 
         $list = $this->limit($model,'',$data);
         $list = $this->fillData($list);

+ 7 - 0
app/Service/FyyOrderService.php

@@ -122,6 +122,13 @@ class FyyOrderService extends Service
         if(! empty($data['out_checker_time'][0]) && ! empty($data['out_checker_time'][1])) $model->whereBetween('out_checker_time',[$data['out_checker_time'][0],$data['out_checker_time'][1]]);
         if(! empty($data['out_order_no_time'][0]) && ! empty($data['out_order_no_time'][1])) $model->whereBetween('out_order_no_time',[$data['out_order_no_time'][0],$data['out_order_no_time'][1]]);
         if(isset($data['status'])) $model->where('status',$data['status']);
+        if(isset($data['is_create'])) {
+            if($data['is_create']){
+                $model->whereColumn('production_quantity', '>=', 'order_quantity');
+            }else{
+                $model->whereColumn('order_quantity', '>', 'production_quantity');
+            }
+        }
 
         $list = $this->limit($model,'',$data);
         $list = $this->fillData($list);

+ 7 - 0
app/Service/ProductionOrderService.php

@@ -172,6 +172,13 @@ class ProductionOrderService extends Service
         if(! empty($data['out_order_no_time'][0]) && ! empty($data['out_order_no_time'][1])) $model->whereBetween('out_order_no_time',[$data['out_order_no_time'][0],$data['out_order_no_time'][1]]);
         if(! empty($data['production_time'][0]) && ! empty($data['production_time'][1])) $model->whereBetween('production_time',[$data['production_time'][0],$data['production_time'][1]]);
         if(isset($data['status'])) $model->where('status',$data['status']);
+        if(isset($data['is_create'])) {
+            if($data['is_create']){
+                $model->whereColumn('dispatch_complete_quantity', '>=', 'production_quantity');
+            }else{
+                $model->whereColumn('production_quantity', '>', 'dispatch_complete_quantity');
+            }
+        }
 
         $list = $this->limit($model,'',$data);
         $list = $this->fillData($list);