wugg 2 years ago
parent
commit
dbe463b537
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/command/NowReportHandle.php

+ 2 - 2
app/command/NowReportHandle.php

@@ -209,8 +209,8 @@ class NowReportHandle extends Command
             $value['当前库存金额'] = bcmul((string)$value['当前库存数量'] ?? '0', (string)$value['成本单价'] ?? '0', 2);
 //            $value['最近入库时间'] =Db::name("purchease_order")->alias("a")->leftJoin("purchease_in c","a.cgdNo=c.cgdNo")->where(["spuCode"=>$value['产品编号'],"order_type"=>1,"order_source"=>0,"c.status"=>[4,6]])->order("a.addtime desc")->value("c.addtime","");
             if (!empty($value['备库创建时间'])) {
-                $value['保质期时间'] = date('Y-m-d H:i:s', strtotime($value['最近入库时间']) + 31536000);//365天之后
-                $value['库存天数'] = bcdiv((string)(time() - strtotime($value['最近入库时间'])), (string)(24 * 3600));//365天之后
+                $value['保质期时间'] = date('Y-m-d H:i:s', strtotime($value['备库创建时间']) + 31536000);//365天之后
+                $value['库存天数'] = bcdiv((string)(time() - strtotime($value['备库创建时间'])), (string)(24 * 3600));//365天之后
             }
             yield $list[] = $value;
         }