推广员充值统计新增官方渠道统计

master
chenzhi 5 years ago
parent 14fa967f00
commit 43774e9099

@ -699,6 +699,41 @@ class PlatformController extends ThinkController
$data[] = $v;
}
// dd($data);
unset($map['tp1.id']);
unset($map['tp1.chain']);
unset($tmap['tp1.chain']);
unset($tmap['tp1.chain']);
$map['s.promote_id'] = 0;
$tmap['s.promote_id'] = 0;
$authorityData['count'] = 0;
//如果有官方渠道权限
$user_auth_promote_ids = session('user_auth_promote_ids');
if ($user_auth_promote_ids == 'all' || in_array('0', explode(",", $user_auth_promote_ids))) {
//官方渠道数据添加
$authorityData = M('spend', 'tab_')->alias('s')
->field('floor(sum(pay_amount)*100) as count')
->where($map)
->find();
$tauthorityData = M('spend', 'tab_')->alias('s')
->field('
floor(sum(IF(s.pay_time ' . $today . ',pay_amount,0))*100) as today,
floor(sum(IF(s.pay_time ' . $week . ',pay_amount,0))*100) as week,
floor(sum(IF(s.pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
->where($tmap)
->find();
$authorityData['today'] = $tauthorityData['today'];
$authorityData['week'] = $tauthorityData['week'];
$authorityData['mounth'] = $tauthorityData['mounth'];
}
$authorityData['promote_account'] = "官方渠道";
$authorityData['id'] = "1";
if (isset($_REQUEST['promote_id'])||$authorityData['count']==0) {
$authorityData = [];
} else {
array_push($data, $authorityData);
}
$count = count($data);
foreach ($data as $key => $value) {

Loading…
Cancel
Save