cqpCow 2 年 前
コミット
77e9a9c780

+ 12 - 0
app/Http/Controllers/Api/FyyOrderController.php

@@ -140,4 +140,16 @@ class FyyOrderController extends BaseController
             return $this->json_return(201,$data);
         }
     }
+
+    public function getOutOrderNum(Request $request){
+        $service = new FyyOrderService();
+        $userData = $request->userData->toArray();
+        list($status,$data) = $service->getOutOrderNum($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+    }
 }

+ 9 - 1
app/Service/FyyOrderService.php

@@ -106,7 +106,7 @@ class FyyOrderService extends Service
             ->orderBy('id','asc');
 
         if(! empty($data['order_no'])) $model->where('order_no', 'LIKE', '%'.$data['order_no'].'%');
-        if(! empty($data['out_order_no'])) $model->where('out_order_no', 'LIKE', '%'.$data['out_order_no'].'%');
+        if(! empty($data['out_order_no'])) $model->whereIn('out_order_no', $data['out_order_no']);
         if(! empty($data['customer_name'])) $model->where('customer_name', 'LIKE', '%'.$data['customer_name'].'%');
         if(! empty($data['product_no'])) $model->where('product_no', 'LIKE', '%'.$data['product_no'].'%');
         if(! empty($data['product_title'])) $model->where('product_title', 'LIKE', '%'.$data['product_title'].'%');
@@ -394,4 +394,12 @@ class FyyOrderService extends Service
 
         return [true,['shipment_code'=>array_values($shipment_code), 'show'=>array_values($return), 'post'=>$result]];
     }
+
+    public function getOutOrderNum($data){
+        $order = Orders::where('del_time',0)
+            ->select('out_order_no')
+            ->get()->toArray();
+
+        return [true, array_column($order,'out_order_no')];
+    }
 }

+ 1 - 0
routes/api.php

@@ -141,6 +141,7 @@ Route::group(['middleware'=> ['checkLogin']],function ($route){
     $route->any('fyyList', 'Api\FyyOrderController@orderList');
     $route->any('fyyRefreshOnHandQuantity', 'Api\FyyOrderController@fyyRefreshOnHandQuantity');
     $route->any('fyyMobileList', 'Api\FyyOrderController@orderMobileList');
+    $route->any('getOutOrderNum','Api\FyyOrderController@getOutOrderNum');
 
     //获取发货单
     $route->any('getShipmentOrder', 'Api\FyyOrderController@getShipmentOrder');