|
@@ -27,8 +27,8 @@ class good extends Command
|
|
|
$temp=["p"=>"总计","thtotal"=>0,"mtotal"=>0,"mthfee"=>0,"wtotal"=>0,"wthfee"=>0,"dtotal"=>0,"thfee"=>0,"tips"=>0,"rate"=>0,"thrate"=>0];
|
|
|
$data=[];
|
|
|
$uidArr =Db::name("depart_user")->where(['itemid'=>$daprtid])->column("uid","itemid");
|
|
|
- foreach ($uidArr as $key=>$uid){
|
|
|
- $data[]=$this->GetData($uid,$key);
|
|
|
+ foreach ($daprtid as $itmeid){
|
|
|
+ $data[]=$this->GetData($uidArr[$itmeid]??[],$itmeid);
|
|
|
}
|
|
|
$temp['thtotal'] = sprintf( "%.2f",array_sum(array_column($data,'thtotal')));
|
|
|
$temp['mtotal'] = sprintf( "%.2f",array_sum(array_column($data,'mtotal')));
|
|
@@ -52,8 +52,9 @@ class good extends Command
|
|
|
public function GetData($uid,$departid=0){
|
|
|
$temp=["p"=>"","thtotal"=>0,"mtotal"=>0,"mthfee"=>0,"wtotal"=>0,"wthfee"=>0,"dtotal"=>0,"thfee"=>0,"tips"=>0,"rate"=>0,"thrate"=>0];
|
|
|
$tips = Db::name("depart_tips")->where(['year'=>date("Y") ,"month"=>date("m"),"depart_id"=>$departid])
|
|
|
- ->column("department,total_tips");
|
|
|
- $temp['p']= $tips['department']??"";
|
|
|
+ ->field("depart_item,total_tips")->findOrEmpty();
|
|
|
+ var_dump($tips);
|
|
|
+ $temp['p']= $tips['depart_item']??"";
|
|
|
$temp['tips']= sprintf( "%.2f",$tips['total_tips']??0);
|
|
|
$month_total =Db::name("sale")->where([["apply_id","in",$uid],["is_del","=",0]])->whereMonth("addtime","this month")
|
|
|
->sum('total_price');
|
|
@@ -88,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")
|
|
|
- ->whereMonth("addtime","this month")->sum('totalPrice');
|
|
|
+ ->whereMonth("a.addtime","this month")->sum('totalPrice');
|
|
|
$week_total =$Db->name("inter_order")->alias("a")->leftjoin("qrd_info b","a.orderCode=b.sequenceNo")
|
|
|
- ->whereWeek("addtime","this week")->sum('totalPrice');
|
|
|
+ ->whereWeek("a.addtime","this week")->sum('totalPrice');
|
|
|
$day_total =$Db->name("inter_order")->alias("a")->leftjoin("qrd_info b","a.orderCode=b.sequenceNo")
|
|
|
- ->whereDay("addtime","today")->sum('totalPrice');
|
|
|
+ ->whereDay("a.addtime","today")->sum('totalPrice');
|
|
|
return ["month_total"=>$month_total,"week_total"=>$week_total,"day_total"=>$day_total] ;
|
|
|
}
|
|
|
}
|