推广员统计修改

master
zhengyongxing 5 years ago
parent 8e18e8faac
commit ae18f1fb24

@ -387,19 +387,24 @@ class PlatformController extends ThinkController
->group('tp1.id') ->group('tp1.id')
->order('count desc, register_time') ->order('count desc, register_time')
->select(); ->select();
unset($map['tp1.id']);
unset($map['tp1.chain']);
$map['promote_id'] = 0;
//官方渠道数据添加 //官方渠道数据添加
$authorityData = M('user', 'tab_')->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(id) as count, $authorityData = M('user', 'tab_')->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(id) as count,
count(IF(register_time ' . $today . ',1,null)) as today, count(IF(register_time ' . $today . ',1,null)) as today,
count(IF(register_time ' . $week . ',1,null)) as week, count(IF(register_time ' . $week . ',1,null)) as week,
count(IF(register_time ' . $mounth . ',1,null)) as mounth') count(IF(register_time ' . $mounth . ',1,null)) as mounth')
->where(['promote_id'=>0]) ->where($map)
->find(); ->find();
$authorityData['promote_account'] = "官方渠道"; $authorityData['promote_account'] = "官方渠道";
$authorityData['id'] = "1"; $authorityData['id'] = "1";
// $authorityData = []; if (isset($_REQUEST['promote_id'])||$authorityData['count']==0) {
$authorityData = [];
} else {
array_push($data, $authorityData); array_push($data, $authorityData);
}
//数据排序 //数据排序
$last_names = array_column($data,'count'); $last_names = array_column($data,'count');
array_multisort($last_names,SORT_DESC,$data); array_multisort($last_names,SORT_DESC,$data);

Loading…
Cancel
Save