|
|
|
@ -594,20 +594,18 @@ class PlatformController extends ThinkController
|
|
|
|
|
$map1['promote_id'] = $map['promote_id'] = array('egt', 0);
|
|
|
|
|
$spend = M('Spend', 'tab_');
|
|
|
|
|
if (!empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) {
|
|
|
|
|
$map['create_time'] = ['between', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 86399)];
|
|
|
|
|
$pay_time = " between " . strtotime($_REQUEST['timestart']) . " and " . (strtotime($_REQUEST['timeend']) + 86399) . " ";
|
|
|
|
|
$map['pay_time'] = ['between', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 86399)];
|
|
|
|
|
unset($_REQUEST['timestart']);
|
|
|
|
|
unset($_REQUEST['timeend']);
|
|
|
|
|
} elseif (!empty($_REQUEST['timestart']) && empty($_REQUEST['timeend'])) {
|
|
|
|
|
$map['create_time'] = ['between', array(strtotime($_REQUEST['timestart']), time())];
|
|
|
|
|
$pay_time = " between " . strtotime($_REQUEST['timestart']) . " and " . time() . " ";
|
|
|
|
|
$map['pay_time'] = ['between', array(strtotime($_REQUEST['timestart']), time())];
|
|
|
|
|
unset($_REQUEST['timestart']);
|
|
|
|
|
} elseif (empty($_REQUEST['timestart']) && !empty($_REQUEST['timeend'])) {
|
|
|
|
|
$map['create_time'] = ['elt', strtotime($_REQUEST['timeend']) + 86399];
|
|
|
|
|
$pay_time = " between 0 and " . (strtotime($_REQUEST['timeend']) + 86399) . " ";
|
|
|
|
|
$map['pay_time'] = ['elt', strtotime($_REQUEST['timeend']) + 86399];
|
|
|
|
|
unset($_REQUEST['timeend']);
|
|
|
|
|
} else {
|
|
|
|
|
$pay_time = " between 0 and " . time();
|
|
|
|
|
$map['pay_time'] = ['between', array(0, time())];
|
|
|
|
|
// $pay_time = " between 0 and " . time();
|
|
|
|
|
}
|
|
|
|
|
$map1['pay_status'] = $map['pay_status'] = 1;
|
|
|
|
|
$today = total(1);
|
|
|
|
@ -628,6 +626,17 @@ class PlatformController extends ThinkController
|
|
|
|
|
$pcount = M("promote","tab_")->field("count(*) acount")->where($promote_map)->where($promote_map2)->find()['acount'];
|
|
|
|
|
|
|
|
|
|
// var_dump( $promote);
|
|
|
|
|
$tweek = total(2,false);
|
|
|
|
|
$tmonth = total(3,false);
|
|
|
|
|
//获取最小
|
|
|
|
|
$tmin = 0;
|
|
|
|
|
if($tweek[1][0] < $tmonth[1][0]){
|
|
|
|
|
$tmin = $tweek[1][0];
|
|
|
|
|
}else{
|
|
|
|
|
$tmin = $tmonth[1][0];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$data =array();
|
|
|
|
|
for ($i=0; $i < count($promote); $i++) {
|
|
|
|
|
# code...
|
|
|
|
@ -645,30 +654,29 @@ class PlatformController extends ThinkController
|
|
|
|
|
$map['server_name'] = $_REQUEST['server_id'];
|
|
|
|
|
unset($_REQUEST['server_id']);
|
|
|
|
|
}
|
|
|
|
|
$dbdata = $spend
|
|
|
|
|
->field('
|
|
|
|
|
floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as count,
|
|
|
|
|
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
|
|
|
|
|
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
|
|
|
|
|
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
|
|
|
|
|
->where($map)
|
|
|
|
|
->where("pay_time".$pay_time)
|
|
|
|
|
->find();
|
|
|
|
|
$dbdata['promote_account'] = $promote[$i]['account'];
|
|
|
|
|
$dbdata['promote_id'] = $promote[$i]['id'];
|
|
|
|
|
} else {
|
|
|
|
|
$dbdata = $spend
|
|
|
|
|
->field('
|
|
|
|
|
floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as count,
|
|
|
|
|
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
|
|
|
|
|
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
|
|
|
|
|
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
|
|
|
|
|
->where($map)
|
|
|
|
|
->where("pay_time".$pay_time)
|
|
|
|
|
->find();
|
|
|
|
|
$dbdata['promote_account'] = $promote[$i]['account'];
|
|
|
|
|
$dbdata['promote_id'] = $promote[$i]['id'];
|
|
|
|
|
}
|
|
|
|
|
$dbdata = $spend
|
|
|
|
|
->field('floor(sum(IF(pay_time ' . $pay_time . ',pay_amount,0))*100) as count')
|
|
|
|
|
->where($map)
|
|
|
|
|
->find();
|
|
|
|
|
$tmap = $map;
|
|
|
|
|
if(isset($map['pay_time'])){
|
|
|
|
|
$tmap['pay_time'] = ['between', array($tmin,$tmonth[1][1])];
|
|
|
|
|
}
|
|
|
|
|
$tdbdata = $spend
|
|
|
|
|
->field('
|
|
|
|
|
floor(sum(IF(pay_time ' . $today . ',pay_amount,0))*100) as today,
|
|
|
|
|
floor(sum(IF(pay_time ' . $week . ',pay_amount,0))*100) as week,
|
|
|
|
|
floor(sum(IF(pay_time ' . $mounth . ',pay_amount,0))*100) as mounth')
|
|
|
|
|
->where($tmap)
|
|
|
|
|
->find();
|
|
|
|
|
$dbdata['today']= $tdbdata['today'];
|
|
|
|
|
$dbdata['week']= $tdbdata['week'];
|
|
|
|
|
$dbdata['mounth']= $tdbdata['mounth'];
|
|
|
|
|
|
|
|
|
|
$dbdata['promote_account'] = $promote[$i]['account'];
|
|
|
|
|
$dbdata['promote_id'] = $promote[$i]['id'];
|
|
|
|
|
|
|
|
|
|
$data[] = $dbdata;
|
|
|
|
|
}
|
|
|
|
|
$count = count($data);
|
|
|
|
@ -812,10 +820,10 @@ class PlatformController extends ThinkController
|
|
|
|
|
$data[$key]['today']=$adata['today']==''?0:$adata['today'];
|
|
|
|
|
$data[$key]['week']=$adata['week']==''?0:$adata['week'];
|
|
|
|
|
$data[$key]['mounth']=$adata['mounth']==''?0:$adata['mounth']; */
|
|
|
|
|
// if ($data[$key]['promote_id'] == '0') {
|
|
|
|
|
// unset($data[$key]);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
// if ($data[$key]['promote_id'] == '0') {
|
|
|
|
|
// unset($data[$key]);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
$total = $this->data_total($data);
|
|
|
|
|
$this->assign('total', $total);
|
|
|
|
|
if ($_REQUEST['data_order'] != '') {
|
|
|
|
|