优化推广员统计

master
chenzhi 4 years ago
parent 7c460cdb47
commit c91206c176

@ -256,7 +256,12 @@ class PlatformController extends ThinkController
"pay_status"=>1
];
D("Spend")->addSubsiteWhere($map);
$Payamount = M("Spend","tab_")->field("sum(IF(is_check=1,pay_amount,0)) pay_amount,IFNULL(sum(IF(is_check=2,pay_amount,0)),0) unpay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select();
if(IS_SUBSITE){
$SpendModel = M("Spend","tab_",SUBSITE_DB);
}else{
$SpendModel = M("Spend","tab_");
}
$Payamount = $SpendModel->field("sum(IF(is_check=1,pay_amount,0)) pay_amount,IFNULL(sum(IF(is_check=2,pay_amount,0)),0) unpay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select();
if(empty($Payamount)) return ;
foreach ($Payamount as $v) {
$list[$v['paytime']]['payamount'] = $v['pay_amount'];
@ -271,7 +276,12 @@ class PlatformController extends ThinkController
"pay_time"=>["between",$yearMap],
"pay_status"=>1
];
$Payamount = M("Spend","tab_")->field("sum(IF(is_check=2,pay_amount,0)) pay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select();
if(IS_SUBSITE){
$SpendModel = M("Spend","tab_",SUBSITE_DB);
}else{
$SpendModel = M("Spend","tab_");
}
$Payamount = $SpendModel->field("sum(IF(is_check=2,pay_amount,0)) pay_amount,FROM_UNIXTIME(`pay_time`, '%Y-%m') paytime")->where($map)->group("paytime")->select();
if(empty($Payamount)) return ;
foreach ($Payamount as $v) {
$list[$v['paytime']]['unpayamount'] = $v['pay_amount'];

@ -40,7 +40,7 @@
<a class="" href="{:U('Platform/promotepay_statistics')}">推广员充值统计</a>
</div>
<h3 class="page_title">推广员汇总</h3>
<p class="description_text">说明:统计各工会每月注册及充值总额(注册数:以玩家最后归属的公会为准,非去重)</p>
<p class="description_text">说明:统计各工会每月注册及充值总额(注册数:以玩家最后归属的公会为准,非去重)<if condition="IS_SUBSITE">/ <span style="color: red;">支付信息仅统计已固定的订单数据</span></if></p>
</div>
<div class="cf top_nav_list">

Loading…
Cancel
Save