Parcourir la source

大王椰出入库

cqpCow il y a 1 an
Parent
commit
cdf8583db9

+ 1 - 1
app/Http/Controllers/Api/InOutOptionController.php

@@ -17,7 +17,7 @@ class InOutOptionController extends BaseController
 
     public function getOrderNumber(Request $request){
         $service = new InOutOptionService();
-        list($status,$data) = $service->getOrderNumber($request->all());
+        list($status,$data) = $service->getOrderNumber($request->all(),$request->header('Site'));
 
         if($status){
             return $this->json_return(200,'',$data);

+ 3 - 1
app/Service/InOutOptionService.php

@@ -16,7 +16,8 @@ class InOutOptionService extends Service
         }
     }
 
-    public function getOrderNumber($data){
+    public function getOrderNumber($data,$site){
+        //获取某个站点的数据
         $data = [];
         $tmp = [];
         while ($item = Redis::lpop(self::OrderKeyQueue)) {
@@ -24,6 +25,7 @@ class InOutOptionService extends Service
             $order_it = $order['epc'] . $order['direction'];
             if(! in_array($order_it, $tmp)){
                 $order['epc'] = hex2bin($order['epc']);
+                $order['site'] = $site;
                 $data[] = $order;
                 $tmp[] = $order_it;
             }