Merge branch 'dev' of 47.111.118.107:/srv/git/platform into dev
commit
2c24a9740b
@ -1,120 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace Admin\Controller;
|
||||
|
||||
use User\Api\UserApi as UserApi;
|
||||
|
||||
/**
|
||||
* 后台首页控制器
|
||||
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
|
||||
*/
|
||||
class SpendController extends ThinkController {
|
||||
const model_name = 'Spend';
|
||||
public function lists(){
|
||||
if(isset($_REQUEST['user_account'])){
|
||||
$map['tab_spend.user_account']=array('like','%'.trim($_REQUEST['user_account']).'%');
|
||||
unset($_REQUEST['user_account']);
|
||||
}
|
||||
if(isset($_REQUEST['spend_ip'])){
|
||||
$map['tab_spend.spend_ip']=array('like','%'.trim($_REQUEST['spend_ip']).'%');
|
||||
unset($_REQUEST['spend_ip']);
|
||||
}
|
||||
if(isset($_REQUEST['time-start'])&&isset($_REQUEST['time-end'])){
|
||||
$map['tab_spend.pay_time'] =array('BETWEEN',array(strtotime($_REQUEST['time-start']),strtotime($_REQUEST['time-end'])+24*60*60-1));
|
||||
unset($_REQUEST['time-start']);unset($_REQUEST['time-end']);
|
||||
}elseif(isset($_REQUEST['time-start'])){
|
||||
$map['tab_spend.pay_time'] = ['GT',strtotime(I('time-start'))];
|
||||
unset($_REQUEST['time-start']);
|
||||
}elseif(isset($_REQUEST['time-end'])){
|
||||
$map['tab_spend.pay_time'] = ['LT',strtotime(I('time-end'))+86399];
|
||||
unset($_REQUEST['time-end']);
|
||||
class SpendController extends ThinkController
|
||||
{
|
||||
const model_name = 'Spend';
|
||||
|
||||
public function lists()
|
||||
{
|
||||
$startDate = empty($_REQUEST['time-start']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['time-start'];
|
||||
$endDate = empty($_REQUEST['time-end']) ? date('Y-m-d') : $_REQUEST['time-end'];
|
||||
$startTime = strtotime($startDate);
|
||||
$endTime = strtotime($endDate) + 86399;
|
||||
$map['pay_time'] = array('BETWEEN', array($startTime, $endTime));
|
||||
unset($_REQUEST['time-start']);
|
||||
unset($_REQUEST['time-end']);
|
||||
if (isset($_REQUEST['user_account'])) {
|
||||
$map['user_account'] = array('like', trim($_REQUEST['user_account']));
|
||||
unset($_REQUEST['user_account']);
|
||||
}
|
||||
if(isset($_REQUEST['start'])&&isset($_REQUEST['end'])){
|
||||
$map['tab_spend.pay_time'] =array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1));
|
||||
unset($_REQUEST['start']);unset($_REQUEST['end']);
|
||||
}elseif(isset($_REQUEST['start'])){
|
||||
$map['tab_spend.pay_time'] = ['GT',strtotime(I('start'))];
|
||||
unset($_REQUEST['start']);
|
||||
}elseif(isset($_REQUEST['end'])){
|
||||
$map['tab_spend.pay_time'] = ['LT',strtotime(I('end'))+86399];
|
||||
unset($_REQUEST['end']);
|
||||
if (isset($_REQUEST['spend_ip'])) {
|
||||
$map['spend_ip'] = array('like', trim($_REQUEST['spend_ip']) . '%');
|
||||
unset($_REQUEST['spend_ip']);
|
||||
}
|
||||
if(isset($_REQUEST['game_name'])){
|
||||
if($_REQUEST['game_name']=='全部'){
|
||||
if (isset($_REQUEST['game_name'])) {
|
||||
if ($_REQUEST['game_name'] == '全部') {
|
||||
unset($_REQUEST['game_name']);
|
||||
} else {
|
||||
$map['game_id'] = ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')];
|
||||
unset($_REQUEST['game_name']);
|
||||
}else{
|
||||
$map['tab_spend.game_id']= ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')];
|
||||
unset($_REQUEST['game_name']);
|
||||
}
|
||||
}
|
||||
if(isset($_REQUEST['server_name'])){
|
||||
$map['tab_spend.server_name']=$_REQUEST['server_name'];
|
||||
if (isset($_REQUEST['server_name'])) {
|
||||
$map['server_name'] = $_REQUEST['server_name'];
|
||||
unset($_REQUEST['server_name']);
|
||||
}
|
||||
if(isset($_REQUEST['pay_order_number'])){
|
||||
$map['tab_spend.pay_order_number']=array('like','%'.trim($_REQUEST['pay_order_number']).'%');
|
||||
unset($_REQUEST['pay_order_number']);
|
||||
if (isset($_REQUEST['pay_order_number'])) {
|
||||
$map['pay_order_number'] = array('like', trim($_REQUEST['pay_order_number']) . '%');
|
||||
unset($_REQUEST['pay_order_number']);
|
||||
}
|
||||
if(isset($_REQUEST['pay_status'])){
|
||||
$map['tab_spend.pay_status']=$_REQUEST['pay_status'];
|
||||
if (isset($_REQUEST['pay_status'])) {
|
||||
$map['pay_status'] = $_REQUEST['pay_status'];
|
||||
unset($_REQUEST['pay_status']);
|
||||
}
|
||||
if(isset($_REQUEST['pay_way'])){
|
||||
if($_REQUEST['pay_way']==2){
|
||||
$map['tab_spend.pay_way']=['in','2,3,4'];
|
||||
}else{
|
||||
$map['tab_spend.pay_way']=$_REQUEST['pay_way'];
|
||||
if (isset($_REQUEST['pay_way'])) {
|
||||
if ($_REQUEST['pay_way'] == 2) {
|
||||
$map['pay_way'] = ['in', '2,3,4'];
|
||||
} else {
|
||||
$map['pay_way'] = $_REQUEST['pay_way'];
|
||||
}
|
||||
unset($_REQUEST['pay_way']);
|
||||
}
|
||||
if(isset($_REQUEST['pay_game_status'])){
|
||||
$map['tab_spend.pay_game_status']=$_REQUEST['pay_game_status'];
|
||||
if (isset($_REQUEST['pay_game_status'])) {
|
||||
$map['pay_game_status'] = $_REQUEST['pay_game_status'];
|
||||
unset($_REQUEST['pay_game_status']);
|
||||
}
|
||||
if(isset($_REQUEST['promote_id'])) {
|
||||
if ($_REQUEST['promote_id'] == 0) {
|
||||
if (isset($_REQUEST['promote_id'])) {
|
||||
$promoteId = intval($_REQUEST['promote_id']);
|
||||
if ($promoteId == 0) {
|
||||
$map['promote_id'] = 0;
|
||||
} else {
|
||||
$map['_complex'] = ['tp.chain'=>['like', "%/{$_REQUEST['promote_id']}/%"], 'tp.id'=>$_REQUEST['promote_id'], '_logic' => 'or'];
|
||||
$promoteMap['chain'] = ['like', "%/$promoteId/%"];
|
||||
$promoteIds = M('Promote', 'tab_')->where($promoteMap)->getField('id', true);
|
||||
$promoteIds[] = $promoteId;
|
||||
$map['promote_id'] = ['in', $promoteIds];
|
||||
}
|
||||
$tab_promote_join = "left join tab_promote as tp on tp.id = tab_spend.promote_id";
|
||||
//unset($_REQUEST['promote_id']);
|
||||
} else {
|
||||
$tab_promote_join = false;
|
||||
}
|
||||
|
||||
if($_REQUEST['data_order']!=''){
|
||||
$data_order=reset(explode(',',$_REQUEST['data_order']));
|
||||
$data_order_type=end(explode(',',$_REQUEST['data_order']));
|
||||
$this->assign('userarpu_order',$data_order);
|
||||
$this->assign('userarpu_order_type',$data_order_type);
|
||||
$sort = $data_order==3?'desc':'asc';
|
||||
$order = $data_order_type.' '.$sort;
|
||||
if ($_REQUEST['data_order'] != '') {
|
||||
$data_order = reset(explode(',', $_REQUEST['data_order']));
|
||||
$data_order_type = end(explode(',', $_REQUEST['data_order']));
|
||||
$this->assign('userarpu_order', $data_order);
|
||||
$this->assign('userarpu_order_type', $data_order_type);
|
||||
$sort = $data_order == 3 ? 'desc' : 'asc';
|
||||
$order = $data_order_type . ' ' . $sort;
|
||||
} else {
|
||||
$order = ' pay_time desc ';
|
||||
}
|
||||
|
||||
$map1=$map;
|
||||
$map1['pay_status']=1;
|
||||
$total=null_to_0(D(self::model_name)->where($map1)->join($tab_promote_join)->sum('pay_amount'));
|
||||
$ttotal=null_to_0(D(self::model_name)->where('pay_time'.total(1))->where(array('pay_status'=>1))->join($tab_promote_join)->sum('pay_amount'));
|
||||
$ytotal=null_to_0(D(self::model_name)->where('pay_time'.total(5))->where(array('pay_status'=>1))->join($tab_promote_join)->sum('pay_amount'));
|
||||
$this->assign('total',$total);
|
||||
$this->assign('ttotal',$ttotal);
|
||||
$this->assign('ytotal',$ytotal);
|
||||
if (intval(($endTime + 1) - $startTime) / (24 * 3600) <= 31) {
|
||||
$map1 = $map;
|
||||
$map1['pay_status'] = 1;
|
||||
} else {
|
||||
$map = '1 = 2';
|
||||
$map1 = $map;
|
||||
}
|
||||
|
||||
$total = null_to_0(D(self::model_name)->where($map1)->sum('pay_amount'));
|
||||
$ttotal = null_to_0(D(self::model_name)->where('pay_time' . total(1))->where(array('pay_status' => 1))->sum('pay_amount'));
|
||||
$ytotal = null_to_0(D(self::model_name)->where('pay_time' . total(5))->where(array('pay_status' => 1))->sum('pay_amount'));
|
||||
$this->assign('total', $total);
|
||||
$this->assign('ttotal', $ttotal);
|
||||
$this->assign('ytotal', $ytotal);
|
||||
$this->meta_title = $this->m_title = '游戏充值';
|
||||
$this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Spend/lists','status'=>1])->find());
|
||||
|
||||
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Spend/lists', 'status' => 1])->find());
|
||||
|
||||
/*parent::lists(self::model_name,$_GET["p"],$map);*/
|
||||
|
||||
$data = D(self::model_name)->lists($_GET["p"], $map, $order);
|
||||
|
||||
|
||||
$this->assign('list_data',$data['data']);
|
||||
$this->assign('_page',$data['page']);
|
||||
$data = D(self::model_name)->lists($_GET["p"], $map, $order);
|
||||
|
||||
$this->assign('startDate', $startDate);
|
||||
$this->assign('endDate', $endDate);
|
||||
$this->assign('list_data', $data['data']);
|
||||
$this->assign('_page', $data['page']);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":0,"active":0,"player":0,"money":0},"active":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}]}
|
||||
{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":3},{"time":"11:00","count":1},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":2},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":1},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":7,"active":17,"player":3,"money":0.080000000000000002},"active":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":4},{"time":"10:00","count":6},{"time":"11:00","count":1},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":4},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":2},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":1},{"time":"16:00","count":2},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":"0.04"},{"time":"16:00","count":"0.04"},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue