From 5343ef216288e4b66807600542cf6668eb8cf977 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Thu, 2 Jan 2020 14:15:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BC=9A=E7=BB=9F=E8=AE=A1=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=86=85=E5=A4=96=E5=9B=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinancePromoteController.class.php | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index 1ed9d4007..c73b551ce 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -45,6 +45,7 @@ class FinancePromoteController extends AdminController $senddata[$v['p_id']] = $v; } +// dump($cash);die(); //内冲 $inside = self::getJoinPromoteData([],$istimeselect,"promote_coin"); foreach($inside as $k=>$v){ @@ -103,9 +104,13 @@ class FinancePromoteController extends AdminController "bind_coin_count"=>0, "inside_cash_count"=>0, ); +// dump($senddata);die(); foreach($senddata as $k=>$v){ - - $v['company_belong']?$v['company_belong']='外团':$v['company_belong']='内团'; + if ($v['company_belong']==1) { + $v['company_belong']='外团'; + } else { + $v['company_belong']='内团'; + } if(empty($v['company_name'])) $v['company_name']= "万盟天下科技"; if(empty($v['p_id'])) $v['p_id']= "0"; if(!array_key_exists('cash_count',$v)) $v['cash_count']=0; @@ -142,10 +147,10 @@ class FinancePromoteController extends AdminController $outBelong = 0; $insideBelong = 0; - +// dump($data);die(); foreach ($data as $key => $value) { - if ($value['company_belong']) { + if ($value['company_belong']=='外团') { $outBelong+=$value['allcount']; } else { $insideBelong+=$value['allcount']; @@ -154,9 +159,9 @@ class FinancePromoteController extends AdminController } //外团占比 - $this->assign('outBelong',$outBelong/$count['all_count']*100); + $this->assign('outBelong',number_format($outBelong/$count['all_count']*100,2,'.','')); //内团占比 - $this->assign('insideBelong',$insideBelong/$count['all_count']*100); + $this->assign('insideBelong',number_format($insideBelong/$count['all_count']*100,2,'.','')); $size = $row; $data = array_slice($data, ($arraypage - 1) * $size, $size); @@ -196,7 +201,7 @@ class FinancePromoteController extends AdminController SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count, SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as bind_coin_count, IFNULL(if(substring_index(substring_index(promote.`chain`,'/',2),'/',-1)='',s.promote_id,substring_index(substring_index(promote.`chain`,'/',2),'/',-1)),0) p_id, - IFNULL(company_id,0) company_id,company_name,promote.company_belong"; + IFNULL(company_id,0) company_id,company_name,company_belong"; return M() ->table("tab_spend s") ->field($field) @@ -213,7 +218,7 @@ class FinancePromoteController extends AdminController $map['s.source_id']=0; $field= "SUM(CASE WHEN s.type = 1 THEN num ELSE 0 END) as pay_amount,SUM(CASE WHEN s.type = 2 THEN num ELSE 0 END) as back_amount,IFNULL(if(substring_index(substring_index(`chain`,'/',2),'/',-1)='', s.promote_id,substring_index(substring_index(`chain`,'/',2),'/',-1)),0) p_id, - IFNULL(company_id,0) company_id,company_name,promote.company_belong"; + IFNULL(company_id,0) company_id,company_name,company_belong"; return M("promote_coin s","tab_") ->field($field) ->where($map) @@ -363,7 +368,7 @@ class FinancePromoteController extends AdminController $field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count, SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count, SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as bind_coin_count, - IFNULL(company_id,0) company_id,company_name,promote_id,promote.account promote_account,promote.company_belong"; + IFNULL(company_id,0) company_id,company_name,promote_id,promote.account promote_account,company_belong"; return M() ->table("tab_spend s") ->field($field) @@ -379,7 +384,7 @@ class FinancePromoteController extends AdminController $map['s.status']=1; $map['s.source_id']=0; $field= "SUM(CASE WHEN s.type = 1 THEN num ELSE 0 END) as pay_amount,SUM(CASE WHEN s.type = 2 THEN num ELSE 0 END) as back_amount, - IFNULL(company_id,0) company_id,company_name,promote_id,promote.account promote_account,promote.company_belong"; + IFNULL(company_id,0) company_id,company_name,promote_id,promote.account promote_account,company_belong"; return M("promote_coin s","tab_") ->field($field) ->where($map)