wugg 1 year ago
parent
commit
e9905e2307
1 changed files with 7 additions and 4 deletions
  1. 7 4
      app/admin/controller/Stat.php

+ 7 - 4
app/admin/controller/Stat.php

@@ -126,12 +126,12 @@ class Stat extends BaseController{
 				$temp["dayinfo"] =Db::name("depart_company")
 				                    ->where("day_time",date("Y-m-d",strtotime($post["daytime"])))
 				                    ->where(["companyNo"=>$value])
-				                    ->column("sale_total,th_total,type,companyNo");;
+				                    ->column("sale_total,th_total,type,cgd_total,cgd_th_total,companyNo");;
 				$temp["monthinfo"] =Db::name("depart_company")
 				                      ->whereBetween("day_time",[date("Y-m-01",strtotime($post["daytime"])),date("Y-m-t",  strtotime($post["daytime"]))])
 				                      ->where(["companyNo"=>$value])
 				                      ->group("companyNo,type")
-				                      ->column("sum(sale_total) as msale_total,sum(th_total) as mth_total,companyNo,type");
+				                      ->column("sum(sale_total) as msale_total,sum(th_total) as mth_total,sum(cgd_total) as mcgd_total,sum(cgd_th_total) as mcgd_th_total,companyNo,type");
 				$return[]=$temp;
 			}
 
@@ -152,7 +152,10 @@ class Stat extends BaseController{
 		foreach ($depart_tips as $key=>$value){
 			$info = Db::name("depart_everyday")
 			->whereMonth("day_time",$post['year']."-".$key)
-			->field("sum(sale_total)  sum_sale_total,sum(th_total) sum_th_total,sum(cgd_total)  sum_cgd_total,sum(cgd_th_total) sum_cgd_th_total")
+			->field("sum(sale_total)  sum_sale_total,
+			sum(th_total) sum_th_total,
+			sum(cgd_total)  sum_cgd_total,
+			sum(cgd_th_total) sum_cgd_th_total")
 			->findOrEmpty();
 			$temp=[
 				"month"=>$key,
@@ -171,7 +174,7 @@ class Stat extends BaseController{
 
 		//月统计销售额
 	public function companyEvery(){
-		$post = $this->request->only(["year"=>date("Y"),"compamyNo"=>""],"post","trim");
+		$post = $this->request->only(["year"=>date("Y"),"companyNo"=>""],"post","trim");
 		$where=[];
 		if($post['companyNo']!='') $where=["companyNo"=>$post['companyNo']];
 		$depart_tips = Db::name("depart_tips")