From 6c1f9b4a733fea327e9100683621fa20059b5571 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Wed, 27 Nov 2019 17:56:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=8E=A9=E5=AE=B6=E5=85=85=E5=80=BC=E8=84=9A?= =?UTF-8?q?=E6=9C=AC--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/AutoController.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php index 21da2b965..a3a75f42a 100644 --- a/Application/Admin/Controller/AutoController.class.php +++ b/Application/Admin/Controller/AutoController.class.php @@ -891,9 +891,13 @@ public function auto_rrdae(){ } //根据时间统计玩家充值 - public function userPlayDataCount() + public function userPlayDataCount($time = '') { - $time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24))); + if ($time == '') { + $time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24))); + } else { + $time = strtotime(date('Y-m-d 00:00:00', strtotime($time))); + } $res = M('user_play_data_count', 'tab_')->where(array('create_time' => $time))->find(); if (empty($res)) { $map['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]]; From 9df85a49d48f0f92afcf67c33132832496358e4e Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Wed, 27 Nov 2019 18:12:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/DownloadController.class.php | 68 ++++++------------- 1 file changed, 19 insertions(+), 49 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 66598be29..1c3407f51 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -481,17 +481,7 @@ class DownloadController extends BaseController { $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); $childPromoteIds = ''; - if(empty($rs)) { - $map['tab_test_resource.promote_id'] = PID; - }else { - foreach ($rs as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id.','; - } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['tab_test_resource.promote_id'] = ['in', $childPromoteIds]; - } + $map['tab_test_resource.promote_id'] = PID; if(!empty(I('role_name'))){ $map['role_name']=['like','%'.I('role_name').'%']; @@ -547,17 +537,7 @@ class DownloadController extends BaseController { $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); $childPromoteIds = ''; - if(empty($rs)) { - $map['tab_test_resource.promote_id'] = PID; - }else { - foreach ($rs as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id.','; - } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['tab_test_resource.promote_id'] = ['in', $childPromoteIds]; - } + $map['tab_test_resource.promote_id'] = PID; if(!empty(I('type'))||I('type')==='0'){ $map['apply_status']=I('type'); @@ -617,33 +597,23 @@ class DownloadController extends BaseController { $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); $childPromoteIds = ''; - if(empty($rs)) { - $map['tab_test_resource.promote_id'] = PID; - }else { - foreach ($rs as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id.','; - } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['tab_test_resource.promote_id'] = ['in', $childPromoteIds]; - } + $map['tab_test_resource.promote_id'] = PID; - if(!empty(I('server_name'))){ - $map['tab_test_resource.server_name']=I('server_name'); - } - if(!empty(I('game_name'))){ - $map['tab_test_resource.game_name']=I('game_name'); - } - if(!empty(I('role_name'))){ - $map['tab_test_resource.role_name']=['like','%'.I('role_name').'%']; - } - if(!empty(I('user_account'))){ - $map['tab_test_resource.user_account']=['like','%'.I('user_account').'%']; - } - if(!empty(I('promote_id'))){ - $map['tab_test_resource.promote_id']=I('promote_id'); - } + if(!empty(I('server_name'))){ + $map['tab_test_resource.server_name']=I('server_name'); + } + if(!empty(I('game_name'))){ + $map['tab_test_resource.game_name']=I('game_name'); + } + if(!empty(I('role_name'))){ + $map['tab_test_resource.role_name']=['like','%'.I('role_name').'%']; + } + if(!empty(I('user_account'))){ + $map['tab_test_resource.user_account']=['like','%'.I('user_account').'%']; + } + if(!empty(I('promote_id'))){ + $map['tab_test_resource.promote_id']=I('promote_id'); + } $conditions = json_encode($map,TRUE); $addtime = time(); @@ -852,7 +822,7 @@ class DownloadController extends BaseController { } $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); - + $map2[] = [ '_logic' => 'or', 'id' => $queryPromote['id'],