Merge branch 'release' into feature/admin_optimize

master
liuweiwen 5 years ago
commit e6cbcd86d3

@ -1054,52 +1054,58 @@ class ExportController extends Controller
break;
case 7:
$startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart'];
$endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend'];
$startTime = strtotime($startDate);
$endTime = strtotime($endDate) + 86399;
$map['pay_time'] = array('BETWEEN', array($startTime, $endTime));
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
if (isset($_REQUEST['user_account'])) {
$map['user_account'] = array('like', '%' . trim($_REQUEST['user_account']) . '%');
$map['user_account'] = array('like', trim($_REQUEST['user_account']));
unset($_REQUEST['user_account']);
}
if (isset($_REQUEST['spend_ip'])) {
$map['spend_ip'] = array('like', '%' . trim($_REQUEST['spend_ip']) . '%');
$map['spend_ip'] = array('like', trim($_REQUEST['spend_ip']) . '%');
unset($_REQUEST['spend_ip']);
}
if (isset($_REQUEST['time-start']) && isset($_REQUEST['time-end'])) {
$map['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']);
}
if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) {
$map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 24 * 60 * 60 - 1));
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
}
if (isset($_REQUEST['start']) && isset($_REQUEST['end'])) {
$map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['start']), strtotime($_REQUEST['end']) + 24 * 60 * 60 - 1));
unset($_REQUEST['start']);
unset($_REQUEST['end']);
}
if (isset($_REQUEST['game_name'])) {
if ($_REQUEST['game_name'] == '全部') {
unset($_REQUEST['game_name']);
} else {
$map['tab_spend.game_id']= ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')];
$map['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'];
unset($_REQUEST['server_name']);
if (isset($_REQUEST['game_type']) && $_REQUEST['game_type']) {
$map['sdk_version'] = $_REQUEST['game_type'];
}
if (isset($_REQUEST['server_id'])) {
$map['server_id'] = $_REQUEST['server_id'];
unset($_REQUEST['server_id']);
}
if (isset($_REQUEST['pay_order_number'])) {
$map['pay_order_number'] = array('like', '%' . trim($_REQUEST['pay_order_number']) . '%');
$map['pay_order_number'] = array('like', trim($_REQUEST['pay_order_number']));
unset($_REQUEST['pay_order_number']);
}
if (isset($_REQUEST['extend'])) {
$map['extend'] = array('like', trim($_REQUEST['extend']));
unset($_REQUEST['extend']);
}
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['pay_way'] = ['in', '2,3,4'];
} else {
$map['pay_way'] = $_REQUEST['pay_way'];
unset($_REQUEST['pay_status']);
}
unset($_REQUEST['pay_way']);
}
if (isset($_REQUEST['pay_game_status'])) {
$map['pay_game_status'] = $_REQUEST['pay_game_status'];
@ -1117,24 +1123,39 @@ class ExportController extends Controller
setPowerPromoteIds($map,'promote_id');
if (isset($_REQUEST['promote_id'])) {
if ($_REQUEST['promote_id'] == 0) {
$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']);
}
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 {
$tab_promote_join = false;
$order = ' pay_time desc ';
}
// if (intval(($endTime + 1) - $startTime) / (24 * 3600) <= 31) {
// $map1 = $map;
// $map1['pay_status'] = 1;
// } else {
// $map = '1 = 2';
// $map1 = $map;
// }
$map1 = $map;
$map1['pay_status'] = 1;
$total = D('Spend')->where($map1)->join($tab_promote_join)->sum('pay_amount');
if (isset($map['pay_status']) && $map['pay_status'] == 0) {
$total = sprintf("%.2f", 0);
} else {
$total = sprintf("%.2f", $total);
}
$total = M('Spend','tab_')->where($map1)->sum('pay_amount');
// var_dump($total);die();
$total=$total?$total:0;
$xlsCell = array(
@ -1155,10 +1176,7 @@ class ExportController extends Controller
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
$accessNum = D('Spend')
->field('pay_order_number,pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status')
->where($map)
->join($tab_promote_join)
->order('pay_time DESC')
->count();
$perSize = 10000;//每次查询的条数
@ -1167,15 +1185,21 @@ class ExportController extends Controller
// var_dump($count);die();
for($i = 1; $i <= $pages; $i++) {
$xlsData = D('Spend')
// ->field('pay_order_number,extend,pay_time,user_account,game_name,promote_account,spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status')
// ->where($map)
// ->limit(($i-1)*$perSize ,$perSize)
// ->join($tab_promote_join)
// ->order('pay_time DESC')
// ->select();
->field('pay_order_number,extend,pay_time,user_account,game_name,promote_account,spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status')
->where($map)
->limit(($i-1)*$perSize ,$perSize)
->join($tab_promote_join)
->order('pay_time DESC')
->order($order ? $order : 'pay_time desc')
->select();
foreach($xlsData as $value) {
$value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']);
$value['extend'] = $value['extend'].'`';
$value['pay_way'] = get_pay_way($value['pay_way']);
$value['pay_status'] = get_info_status($value['pay_status'],9);
$value['pay_game_status'] = get_info_status($value['pay_game_status'],14);
@ -7139,7 +7163,7 @@ class ExportController extends Controller
if (!empty(I('timestart'))) {
$timestart = strtotime(I('timestart'));
$map['_string'] = "s.pay_time > {$timestart}";
$map['_string'] = "s.pay_time >= {$timestart}";
}
if (!empty(I('timeend'))) {

@ -1304,7 +1304,7 @@ class DownloadController extends BaseController {
empty(I('user_account')) || $map['tab_spend.user_account'] = ['like', '%' . I('user_account') . '%'];
empty(I('pay_order_number')) || $map['tab_spend.pay_order_number'] = I('pay_order_number');
// $map['tab_spend.pay_status'] = 1;
$map['tab_spend.is_check'] = ['neq', 2];
// $map['tab_spend.is_check'] = ['neq', 2];
if (isset($_REQUEST['pay_status']) && $_REQUEST['pay_status'] !== '') {
$payStatus = intval(I('pay_status'));

@ -99,12 +99,10 @@ class IndexController extends HomeController
}
}
public function register()
/* public function register()
{
if (IS_POST) {
if (!C('USER_ALLOW_REGISTER')) {
$this->ajaxReturn(array('status' => 0, 'info' => '已关闭用户注册!'));
}
// unset($_POST['remember']);
$Promote = new PromoteApi();
@ -120,7 +118,7 @@ class IndexController extends HomeController
} else {
$this->display();
}
}
} */
public function rule()
{

@ -100,7 +100,6 @@ class QueryController extends BaseController
}
}
$map['tab_spend.pay_time'] = ['between', [$begTime, $endTime - 1]];
$map['tab_spend.is_check'] = ['neq', 2];
$data = [];
$count = 0;

Loading…
Cancel
Save