wugg 2 years ago
parent
commit
1afc7b508a
2 changed files with 4 additions and 4 deletions
  1. 1 1
      app/abutment/controller/Order.php
  2. 3 3
      app/command/NowReportHandle.php

+ 1 - 1
app/abutment/controller/Order.php

@@ -632,7 +632,7 @@ class Order extends HomeBaseController
                         if ($cgdinfo[$cgdNo]['send_status'] == 1 && $cgdinfo[$cgdNo]['order_type'] != 1) {
                             $send = Db::name("order_send")->where(["cgdNo" => $cgdNo, "status" => 1])->column("outCode");
                             if (!empty($send)) {
-                                $out = Db::name("order_out")->where(["outCode" => $send, "status" => 0])->select()->toArray();
+                                $out = Db::name("order_out")->where(["outCode" => $send, "status" => 0,"is_del"=>0])->select()->toArray();
                                 if (!empty($out)) {
                                     $up = Db::name("order_out")->where(["outCode" => $send, "status" => 0])->update(["status" => 1, 'wsm_code' => $cgdinfo[$cgdNo]['wsm_code'], "updatetime" => date('Y-m-d H:i:s')]);
                                     if ($up == false) throw new Exception('出库单出库失败');

+ 3 - 3
app/command/NowReportHandle.php

@@ -496,7 +496,7 @@ class NowReportHandle extends Command
             ->leftJoin("order_num won","won.orderCode=a.orderCode")
             ->leftJoin("order_back wor","wor.outCode=woo.outCode and wor.status=4 and wor.is_del=0")
             ->leftJoin("purchease_order wpo","wpo.cgdNo=won.cgdNo")
-            ->leftJoin("good_basic wgb","wgb.spuCode=wpo.spuCode and wgb.is_del=0")
+            ->leftJoin("good_basic wgb","wgb.spuCode=a.good_code and wgb.is_del=0")
             ->leftJoin("supplier ws","ws.code=wpo.supplierNo")
             ->leftJoin("warehouse_info wwi","wwi.wsm_code = wpo.wsm_code")
             ->where([['woo.status',">=", 2],['woo.is_del',"=",0],['a.order_type',"=", 1],['woo.sendtime',"between",[$start, $end]]])
@@ -505,12 +505,12 @@ class NowReportHandle extends Command
                             woo.orderCode '销售单号',
                             woo.outCode '出库单号',
                             wpo.cgdNo '采购单号',
-                            wpo.spuCode '商品编号',
+                            wgb.spuCode '商品编号',
                             '' as '一级分类',
                             '' as '二级分类',
                             wgb.cat_id as '三级分类',
                             wgb.cat_id as '财务核算编号',
-                            wpo.good_name as '商品名称',
+                            wgb.good_name as '商品名称',
                             woo.send_num'出库数量',
                             round( woo.send_num* wpo.good_price,2) '出库金额',
                             woo.sendtime '本次出库时间',