diff --git a/Addons/SiteStat/info.html b/Addons/SiteStat/info.html
index 9b92ecb22..840ef2248 100644
--- a/Addons/SiteStat/info.html
+++ b/Addons/SiteStat/info.html
@@ -96,7 +96,7 @@ $(document).ready(function () {
【游戏充值】 |
游戏充值待补单数 |
- {$daiban['spenc']} |
+ {$daiban['spenc']} |
【APP安卓分包】 |
diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php
index 55602bbcb..21da2b965 100644
--- a/Application/Admin/Controller/AutoController.class.php
+++ b/Application/Admin/Controller/AutoController.class.php
@@ -907,6 +907,7 @@ public function auto_rrdae(){
{
$res = M('user_play_data_count', 'tab_')->order('id asc')->find();
if (empty($res)) {
+ ini_set('memory_limit','500M');
$time = strtotime(date('Y-m-d 00:00:00', time()));
$map['pay_time'] = ['lt', $time];
@@ -923,6 +924,7 @@ public function auto_rrdae(){
$map['pay_status'] = 1;
$map['pay_game_status'] = 1;
$map['game_player_id'] = ['gt', 0];
+ $map['server_id'] = ['gt', 0];
$field = 'FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,promote_id,user_id,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count';
$spendData = M('spend', 'tab_')->field($field)
->where($map)
@@ -931,17 +933,20 @@ public function auto_rrdae(){
if (!empty($spendData)) {
$data = [];
- foreach ($spendData as $list) {
- $save['promote_id'] = $list['promote_id'];
- $save['user_id'] = $list['user_id'];
- $save['game_id'] = $list['game_id'];
- $save['server_id'] = $list['server_id'];
- $save['role_id'] = $list['game_player_id'];
- $save['recharge_cost'] = $list['recharge_cost'];
- $save['recharge_count'] = $list['recharge_count'];
- $save['create_time'] = strtotime($list['day']);
- $data[] = $save;
+ foreach ($spendData as &$list) {
+ $data[] = [
+ 'promote_id' => $list['promote_id'],
+ 'user_id' => $list['user_id'],
+ 'game_id' => $list['game_id'],
+ 'server_id' => $list['server_id'],
+ 'role_id' => $list['game_player_id'],
+ 'recharge_cost' => $list['recharge_cost'],
+ 'recharge_count' => $list['recharge_count'],
+ 'create_time' => strtotime($list['day']),
+ ];
+ unset($list);
}
+ unset($spendData);
M('user_play_data_count', 'tab_')->addAll($data);
}
}
diff --git a/Application/Admin/Controller/ConsoleController.class.php b/Application/Admin/Controller/ConsoleController.class.php
index 9238a73b4..71ff3486e 100644
--- a/Application/Admin/Controller/ConsoleController.class.php
+++ b/Application/Admin/Controller/ConsoleController.class.php
@@ -89,12 +89,22 @@ class ConsoleController extends Think {
}
}
+ public function modifyLoginRepair()
+ {
+ $this->modifyLogin(1569686400);
+ }
+
+ public function modifyLoginGenerate()
+ {
+ $this->modifyLogin(strtotime(date("Y-m-d"))-86400);
+ }
+
/**
* 登录校验
*/
- public function modifyLogin()
+ private function modifyLogin($start_time=0)
{
- $start_time = $current_time = strtotime(date("Y-m-d"))-86400;
+ $current_time = strtotime(date("Y-m-d"))-86400;
for ($i=$start_time; $i<=$current_time; $i+=86400) {
$end_time = $i+86400;
$result = M()->query("SELECT
diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php
index cc38b611b..a68b8924e 100644
--- a/Application/Admin/Controller/ExportController.class.php
+++ b/Application/Admin/Controller/ExportController.class.php
@@ -532,15 +532,17 @@ class ExportController extends Controller
}
unset($xlsData[$k]['age_status']);
unset($xlsData[$k]['register_way']);
+ mb_convert_variables('GBK', 'UTF-8', $v);
+ fputcsv($fp, $v);
}
}
- foreach($xlsData as $value) {
- mb_convert_variables('GBK', 'UTF-8', $value);
- fputcsv($fp, $value);
- $lastId = $value['id'];
- }
+// foreach($xlsData as $value) {
+// mb_convert_variables('GBK', 'UTF-8', $value);
+// fputcsv($fp, $value);
+// $lastId = $value['id'];
+// }
unset($xlsData);//释放变量的内存
//刷新输出缓冲到浏览器
ob_flush();
diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php
index a20bc258a..7d0a4cb7e 100644
--- a/Application/Admin/Controller/MemberController.class.php
+++ b/Application/Admin/Controller/MemberController.class.php
@@ -123,18 +123,13 @@ class MemberController extends ThinkController
unset($_REQUEST['status']);
}
- $game_map = "";
- if (!empty($_REQUEST['game_name']) || !empty($_REQUEST['game_type'])) {
- $game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")";
- }
-
- $spendprom .= " and ss.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")";
- if (isset($_REQUEST['server_name'])) {
- $spendprom .= " and ss.server_name like '{$_REQUEST['server_name']}%' ";
- }
- $game_play_map = '';
+
+ // if (isset($_REQUEST['game_name'])) {
+ // //$game_map .= " and tab_user_play.game_id in (" . implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) . ")";
+ // }
+ $spendprom = " and ss.game_id in (".implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')).")";
if (isset($_REQUEST['server_name'])) {
- $game_play_map .= " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' ";
+ $map['server_name'] = ['like', "{$_REQUEST['server_name']}%"];
}
if (isset($_REQUEST['viplevel'])) {
@@ -193,8 +188,6 @@ class MemberController extends ThinkController
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
$data = $usermodel->table('(' . $sql1 . ') as a ')->field('a.id,a.device_number,a.age_status,a.account,a.balance,a.gold_coin,a.alipay,a.promote_id,a.register_type,a.promote_account,a.register_time,a.lock_status,a.register_way,a.register_type,a.register_ip,a.login_time,IFNULL(sum(ss.pay_amount),0) as recharge_total,check_status')
->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1'.$spendprom)
- ->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false)
- ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false)
->page($page, $row)
->having($havs)
->group('a.id')
@@ -204,8 +197,6 @@ class MemberController extends ThinkController
}else{
$data = $usermodel->table('(' . $sql1 . ') as a ')->field('a.id,a.device_number,a.age_status,a.account,a.balance,a.gold_coin,a.alipay,a.promote_id,a.register_type,a.promote_account,a.register_time,a.lock_status,a.register_way,a.register_type,a.register_ip,a.login_time,IFNULL(sum(ss.pay_amount),0) as recharge_total,check_status')
->join('left join tab_spend as ss on ss.user_id=a.id AND ss.pay_status = 1')
- ->join($game_map ? "tab_user_play on tab_user_play.user_id = a.id $game_map" : false)
- ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = a.id $game_play_map" : false)
->page($page, $row)
->having($havs)
->group('a.id')
@@ -217,22 +208,20 @@ class MemberController extends ThinkController
//计数
$sql = M('user', 'tab_')->field('tab_user.id,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1'.$spendprom)
- ->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
- ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
->where($map)
->group('tab_user.id')
->where($hav)
->having($havs)->select(false);
+
+ $allcountsql = str_replace("tab_user.promote_id","ss.promote_id",$sql);
//获取总额
- $allcount = M()->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $sql . ') as a')->select();
- $this->assign('history_count', $allcount[0]['recharge_total']);
+ $allcount = M()->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $allcountsql . ') as a')->select();
+ $this->assign('history_count', $allcount[0]['recharge_total']?:0);
//替换为新表
if($_REQUEST['promote_id'] && $_REQUEST['promote_id'] > -1){
$sql = M('user', 'tab_')->field('tab_user.id,IFNULL(sum(ss.pay_amount),0) AS recharge_total')
->join('left join tab_spend as ss on ss.user_id=tab_user.id AND ss.pay_status = 1'.$spendprom)
- ->join($game_map ? "tab_user_play on tab_user_play.user_id = tab_user.id $game_map" : false)
- ->join($game_play_map ? "tab_user_play_info on tab_user_play_info.user_id = tab_user.id $game_play_map" : false)
->where($map)
->group('tab_user.id')
->where($hav)
@@ -240,10 +229,10 @@ class MemberController extends ThinkController
}
$jcount = M('User', 'tab_')->field('count(a.id) as count,sum(a.recharge_total) recharge_total')->table('(' . $sql . ') as a')->select();
- $count = $jcount[0]['count'];
- //var_dump(M('User', 'tab_')->getLastSql());die();
+ $count = $jcount[0]['count'] ?:0 ;
$this->assign('user_count', $count);
- $this->assign('now_count', $jcount[0]['recharge_total']);
+ // var_dump($jcount);die();
+ $this->assign('now_count', $jcount[0]['recharge_total']?:0);
$model = M('Model')->getByName('user');
@@ -791,7 +780,6 @@ class MemberController extends ThinkController
}
// $map['type'] = 1;
// $map['login_time'] = ['exp', 'login_time<>0'];
-// $map['login_time'] = ['gt',0];
$extend = array();
$extend['map'] = $map;
@@ -1253,8 +1241,6 @@ class MemberController extends ThinkController
}
if ($type == 2 && !preg_match("/(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/i", $tag)) {
return $this->error("请填写正确的ip信息,如127.0.0.1");
- } else if ($type == 1 && preg_match("/(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/i", $tag)) {
- return $this->error("请填写正确的设备号信息");
}
$map['type'] = $type;
$map['tag'] = $tag;
diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php
index c5e82e793..22d8a87ac 100644
--- a/Application/Home/Controller/DownloadController.class.php
+++ b/Application/Home/Controller/DownloadController.class.php
@@ -1163,9 +1163,6 @@ class DownloadController extends BaseController {
* @author sunke
*/
public function recharge_data_export() {
- if (empty(I('begtime')) || empty(I('endtime'))) {
- $this->error('请选择起止时间');
- }
$beginTime = strtotime(I('begtime') . ' 00:00:00');
$endtime = strtotime(I('endtime') . ' 23:59:59');
if (($endtime - $beginTime) > 31 * 24 * 3600) {
@@ -2439,7 +2436,7 @@ class DownloadController extends BaseController {
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
- for($i = 1; $i <= $pages - 1; $i++) {
+ for($i = 1; $i <= $pages; $i++) {
foreach($data as $value) {
mb_convert_variables('GBK', 'UTF-8', $value);
fputcsv($fp, $value);
@@ -2952,7 +2949,7 @@ class DownloadController extends BaseController {
->where($map)
->order('tab_spend.id desc')
->select();
-
+
$csvFileName = $xlsName.'.csv';
//设置好告诉浏览器要下载excel文件的headers
header('Content-Description: File Transfer');
@@ -2967,6 +2964,7 @@ class DownloadController extends BaseController {
$accessNum = count($data1)?:0 ;
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
+
for($i = 1; $i <= $pages; $i++) {
$model = M('spend','tab_');
$data = $model
@@ -3017,12 +3015,10 @@ class DownloadController extends BaseController {
$csvData["p_proinfo"] = $value1["p_proinfo"];
$csvData["proinfo"] = $value1["proinfo"];
$csvData["pay_time"] = $value1["pay_time"];
+ mb_convert_variables('GBK', 'UTF-8', $csvData);
+ fputcsv($fp, $csvData);
$xlsData[] = $csvData;
}
- foreach($xlsData as $value) {
- mb_convert_variables('GBK', 'UTF-8', $value);
- fputcsv($fp, $value);
- }
unset($xlsData);
ob_flush();
flush();