@ -130,6 +130,7 @@ class PromoteController extends BaseController
}
$today=total(1);
$yesterdays = total(5);
$week=total(2);
$mounth=total(3);
//计算今日的统计数据
@ -168,7 +169,7 @@ class PromoteController extends BaseController
$yesterdayData = M('User','tab_')
->field('promote_account,promote_id,date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(tab_user.id) as count,
IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,promote_id)) as promote_id1 ,
count(IF(register_time '.$today.',1,null)) as today,
count(IF(register_time '.$yesterdays.',1,null)) as today,
count(IF(register_time '.$week.',1,null)) as week,
count(IF(register_time '.$mounth.',1,null)) as mounth')
->join('tab_promote on promote_id = tab_promote.id','left')