Browse Source

Merge remote-tracking branch 'origin/fyy' into fyy

gogs 2 years ago
parent
commit
c575ec8ab0

+ 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')];
+    }
 }

+ 3 - 2
app/Service/FyySqlServerService.php

@@ -501,9 +501,10 @@ class FyySqlServerService extends Service
             $model->where('a.dDate','>=',$data['time'][0]);
             $model->where('a.dDate','<=',$data['time'][1]);
         }
-        if(! empty($data['order_no'])) $model->where('a.cSOcode',$data['order_no']);
+        if(! empty($data['order_no'])) $model->where('b.cSOcode',$data['order_no']);
+        if(! empty($data['out_order_no'])) $model->where('b.cSOcode',$data['out_order_no']);
 
-        $message = $model->select('a.cDLCode as cdlcode','a.DLID as id','a.cDefine10 as customer_name','a.cSOCode as csocode','a.cDepCode as cdepcode','a.cCusCode as cuscode','b.iDLsID as idlsid','b.cWhCode as cwhcode','b.cInvCode as cinvcode','b.cInvName as product_title','b.cFree1 as cfree1','b.cFree2 as cfree2','b.cPosition as cposition','b.cBatch as cbatch','b.iQuantity as iquantity','b.iNum as inum','b.iInvExchRate as iinvexchrate','b.fOutQuantity as out_quantity','b.iUnitPrice as iunitcost','b.iMoney as imoney','b.cDefine28 as technology_material','b.cDefine30 as process_mark','c.cInvStd as product_size')
+        $message = $model->select('a.cDLCode as cdlcode','a.DLID as id','a.cDefine10 as customer_name','b.cSOCode as csocode','a.cDepCode as cdepcode','a.cCusCode as cuscode','b.iDLsID as idlsid','b.cWhCode as cwhcode','b.cInvCode as cinvcode','b.cInvName as product_title','b.cFree1 as cfree1','b.cFree2 as cfree2','b.cPosition as cposition','b.cBatch as cbatch','b.iQuantity as iquantity','b.iNum as inum','b.iInvExchRate as iinvexchrate','b.fOutQuantity as out_quantity','b.iUnitPrice as iunitcost','b.iMoney as imoney','b.cDefine28 as technology_material','b.cDefine30 as process_mark','c.cInvStd as product_size')
             ->get()->toArray();
 
         if(! empty($message)){

+ 1 - 0
routes/api.php

@@ -142,6 +142,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');