gogs 1 year ago
parent
commit
deff482af8
1 changed files with 6 additions and 4 deletions
  1. 6 4
      app/Http/Controllers/Api/DwyController.php

+ 6 - 4
app/Http/Controllers/Api/DwyController.php

@@ -856,8 +856,8 @@ class DwyController extends BaseController
             $v['use_qty'] = $v['qty'];
             if (!isset($v['send_qty'])) $v['send_qty'] = 0;
             foreach ($list as $kk => $vv) {
-
-                if ($vv['num'] == 0) continue;
+                if(!isset($vv['restock_qty'])) $vv['restock_qty'] = 0;
+                if ($vv['num'] == 0 && $vv['restock_qty'] == 0) continue;
                 if ($v['material_code_show'] === $vv['title']) {
                     $v['restore_qty'] = isset($vv['restock_qty']) && $vv['restock_qty'] > 0 ? $vv['restock_qty'] : 0;
                     if (($v['qty'] - $v['send_qty']) > $vv['num']) {
@@ -886,7 +886,7 @@ class DwyController extends BaseController
                     //"process_title_two": "",
                     ////花色2
                     //"color_two": "",
-                    if($p_total == 0) continue;
+                    if($p_total == 0 && $vv['restock_qty'] <= 0) continue;
                     $key_arr = [
                         'product_code' => $vv['product_code'] ?? '',
                         'product_code_show' => $vv['product_code_show'] ?? '',
@@ -912,14 +912,16 @@ class DwyController extends BaseController
 
             }
         }
+//        dd($data);die;
         foreach ($data as $k=>$d){
-            if($d['send_qty'] <= 0) unset($data[$k]);
+            if(empty($d['product_list'])) unset($data[$k]);
         }
         usort($data, function ($a,$b){
             return str_replace('CK','',$a['box_code']) - str_replace('CK','',$b['box_code']);
         });
 //        list($status,$msg) = DwyService::getInstance()->setLimitForBoxOut($param);
 //        if(! $status) return ['status' => '201', 'data' => [],'msg'=> $msg];
+        if(empty($data))  return ['status' => '201', 'data' => $data,'msg'=>'无商标需要申领'];
         return ['status' => '200', 'data' => $data];
     }