Browse Source

Merge branch 'version1.5' of wugg/phpstock into master-online

wugg 2 years ago
parent
commit
428d1a7887
2 changed files with 5 additions and 5 deletions
  1. 2 2
      app/command/NowReportHandle.php
  2. 3 3
      app/command/good.php

+ 2 - 2
app/command/NowReportHandle.php

@@ -546,7 +546,7 @@ class NowReportHandle extends Command
     public function  GetWlb($start,$end){
         $db =Db::connect("mysql_cxinv");
         $list =$db->name("cgd_info")
-          ->where(['name'=>'网络部采购单'])->whereBetweenTime('createdTime',$start,$end)->field(
+          ->where(['cgdSource'=>10,"is_del"=>0])->whereBetweenTime('createdTime',$start,$end)->field(
             "year(createdTime) AS `年`,
 					month(createdTime) AS `月`,
 					dayofmonth(createdTime) AS `日`,
@@ -887,7 +887,7 @@ class NowReportHandle extends Command
 		'' as '成本单价',
 		b.wait_in_stock '待入库数量',
 		b.wait_out_stock '待出库数量',
-		b.total_stock '当前库存数量',
+		(b.wait_out_stock+b.usable_stock)  '当前库存数量',
 		b.usable_stock '可用库存数量',
 		f.supplierNo '采购员',
 		'' as '供应商名称',

+ 3 - 3
app/command/good.php

@@ -89,11 +89,11 @@ class good extends Command
 	//网络部数据统计
     public function wlb(){
     	$Db=Db::connect("mysql_cxinv");
-    	$month_total =$Db->name("inter_order")->alias("a")->leftjoin("qrd_info b","a.orderCode=b.sequenceNo")
+    	$month_total =$Db->name("inter_order")->alias("a")->leftjoin("qrd_info b","a.orderCode=b.sequenceNo and b.qrdSource = 10 and  b.is_del = 0")
     	->whereMonth("a.addtime","this month")->where("b.companyNo","GS2203161855277894")->sum('totalPrice');
-    	$week_total =$Db->name("inter_order")->alias("a")->leftjoin("qrd_info b","a.orderCode=b.sequenceNo")
+    	$week_total =$Db->name("inter_order")->alias("a")->leftjoin("qrd_info b","a.orderCode=b.sequenceNo and b.qrdSource = 10 and  b.is_del = 0")
     	->whereWeek("a.addtime","this week")->where("b.companyNo","GS2203161855277894")->sum('totalPrice');
-    	$day_total =$Db->name("inter_order")->alias("a")->leftjoin("qrd_info b","a.orderCode=b.sequenceNo")
+    	$day_total =$Db->name("inter_order")->alias("a")->leftjoin("qrd_info b","a.orderCode=b.sequenceNo and b.qrdSource = 10 and  b.is_del = 0")
     	->whereDay("a.addtime","today")->where("b.companyNo","GS2203161855277894")->sum('totalPrice');
     	return ["month_total"=>$month_total,"week_total"=>$week_total,"day_total"=>$day_total] ;
     }