root 2 vuotta sitten
vanhempi
sitoutus
c25bac2187

+ 14 - 0
app/Http/Controllers/Api/BoxController.php

@@ -44,4 +44,18 @@ class BoxController extends BaseController
         }
 
     }
+    public function boxProductList(Request $request)
+    {
+
+
+        $service = new BoxService();
+        list($status,$data) = $service->boxProductList($request->all());
+
+        if($status){
+            return $this->json_return(200,'',$data);
+        }else{
+            return $this->json_return(201,$data);
+        }
+
+    }
 }

+ 5 - 22
app/Service/Box/BoxHookService.php

@@ -153,28 +153,9 @@ class BoxHookService extends Service
     public function boxDetail($data){
         $box = new Box();
         if(!isset($data['id'])) return [false,'id not found'];
-        $model = OrdersProduct::where('del_time',0)->wherein('sale_orders_product_id',$data['id'])
-            ->select('id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','production_time','production_no','status','sale_orders_product_id')
-            ->orderBy('id','desc')->get()->toArray();
-
-        $data = [
-            [
-                'id' => 1,
-                'out_order_no' => '销售订单号',
-                'production_time' => '下生产时间时间戳',
-                'customer_no' => '客户编码',
-                'customer_name' => '客户名称',
-                'product_no' => '产品编码',
-                'product_title' => '产品名称',
-                'product_size' => '产品规格',
-                'type' => '1生产包装2备用包装',
-                'is_box_num' => '已包装数量',
-                'un_box_num' => '未包装',
-                'sale_num' => '销售数量',
-            ]
-        ];
-
-        return [true,$data];
+        $list = $box->where('top_id',$data['id'])->get()->toArray();
+
+        return [true,$list];
 
     }
 
@@ -197,4 +178,6 @@ class BoxHookService extends Service
 
 
 
+
+
 }

+ 28 - 0
app/Service/Box/BoxService.php

@@ -6,6 +6,7 @@ namespace App\Service\Box;
 use App\Model\Box;
 use App\Model\BoxDetail;
 use App\Model\Header_ext;
+use App\Model\OrdersProduct;
 use App\Model\SaleOrdersProduct;
 use App\Service\Service;
 use Illuminate\Support\Facades\DB;
@@ -145,5 +146,32 @@ class BoxService extends Service
         return [true, $data];
     }
 
+    public function boxProductList($data){
+        $box = new Box();
+        if(!isset($data['id'])) return [false,'id not found'];
+        $model = OrdersProduct::where('del_time',0)->wherein('sale_orders_product_id',$data['id'])
+            ->select('id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','production_time','production_no','status','sale_orders_product_id')
+            ->orderBy('id','desc')->get()->toArray();
+
+        $data = [
+            [
+                'id' => 1,
+                'out_order_no' => '销售订单号',
+                'production_time' => '下生产时间时间戳',
+                'customer_no' => '客户编码',
+                'customer_name' => '客户名称',
+                'product_no' => '产品编码',
+                'product_title' => '产品名称',
+                'product_size' => '产品规格',
+                'type' => '1生产包装2备用包装',
+                'is_box_num' => '已包装数量',
+                'un_box_num' => '未包装',
+                'sale_num' => '销售数量',
+            ]
+        ];
+
+        return [true,$data];
+    }
+
 
 }

+ 1 - 0
routes/api.php

@@ -157,5 +157,6 @@ Route::group(['middleware'=> ['checkLogin']],function ($route){
     $route->any('getHeaderWord', 'Api\HeaderWordController@getHeaderWord');
     //包装相关
     $route->any('boxDetail', 'Api\BoxController@boxDetail');
+    $route->any('boxProductList', 'Api\BoxController@boxProductList');
     $route->any('boxIn', 'Api\BoxController@boxIn');
 });