From a1a5d487c375f29b2b3bca4a13a5ab737797c63a Mon Sep 17 00:00:00 2001 From: elf <360197197@qq.com> Date: Tue, 9 Apr 2024 23:17:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/function.php | 2 +- .../Controller/AdminController.class.php | 11 - .../Controller/SpendController.class.php | 173 ---- Application/Admin/View/Spend/listsMime.html | 881 ------------------ Application/Home/Common/function.php | 2 +- .../Home/Controller/BaseController.class.php | 19 - .../Controller/DownloadController.class.php | 226 +---- .../Home/Controller/QueryController.class.php | 217 ----- .../View/default/Public/promote_base.html | 10 - .../Home/View/default/Query/rechargeMine.html | 472 ---------- 10 files changed, 3 insertions(+), 2010 deletions(-) delete mode 100644 Application/Admin/View/Spend/listsMime.html delete mode 100644 Application/Home/View/default/Query/rechargeMine.html diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php index a9d078d..46d3bcd 100644 --- a/Application/Admin/Common/function.php +++ b/Application/Admin/Common/function.php @@ -1108,6 +1108,6 @@ function getMarketLevel() } function isOutPaySite() { - return $_SERVER['HTTP_HOST'] == 'outermg.jianghuifa.cn'; + return false; } diff --git a/Application/Admin/Controller/AdminController.class.php b/Application/Admin/Controller/AdminController.class.php index ef868d7..2ef9df1 100644 --- a/Application/Admin/Controller/AdminController.class.php +++ b/Application/Admin/Controller/AdminController.class.php @@ -44,17 +44,6 @@ class AdminController extends Controller { } } $rule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME); - $outPayRules = [ - 'admin/spend/listsmime', - 'admin/repair/repairedit', - ]; - if (in_array($rule, $outPayRules) && !isOutPaySite()) { - die('地址错误'); - } - if (isOutPaySite() && !in_array($rule, $outPayRules)) { - redirect(U("Admin/Spend/listsMime")); - die(); - } // 检测系统权限 if(!IS_ROOT){ $access = $this->accessControl(); diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index 74cbcf3..76e07f4 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -194,179 +194,6 @@ class SpendController extends ThinkController $this->display(); } - public function listsMime() - { - $startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart']; - $endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend']; - $payStatus = isset($_REQUEST['pay_real_status']) ? $_REQUEST['pay_real_status'] : 1; - - $startTime = strtotime($startDate); - $endTime = strtotime($endDate) + 86399; - - if($payStatus > 0){ - $map['pay_time'] = array('BETWEEN', array($startTime, $endTime)); - }else{ - $map['spend_time'] = array('BETWEEN', array($startTime, $endTime)); - } - - $map['pay_real_status'] = $payStatus; - - unset($_REQUEST['timestart']); - unset($_REQUEST['timeend']); - - if (isset($_REQUEST['is_check'])) { - $map['is_check'] = (int)($_REQUEST['is_check']); - } - - if (isset($_REQUEST['is_refund'])) { - $map['is_refund'] = (int)($_REQUEST['is_refund']); - } - - if (isset($_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']) . '%'); - unset($_REQUEST['spend_ip']); - } - 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']); - } - } - 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'])); - unset($_REQUEST['pay_order_number']); - } - if (isset($_REQUEST['extend'])) { - $map['extend'] = array('like', trim($_REQUEST['extend'])); - unset($_REQUEST['extend']); - } - - $map['pay_way'] = ['in', '41']; - - if (isset($_REQUEST['pay_game_status'])) { - $map['pay_game_status'] = $_REQUEST['pay_game_status']; - unset($_REQUEST['pay_game_status']); - } - - if ($_REQUEST['merchant_id']) { - $map['merchant_id'] = $_REQUEST['merchant_id']; - unset($_REQUEST['merchant_id']); - } - - if (isset($_REQUEST['promote_id'])) { - $promoteId = intval($_REQUEST['promote_id']); - if ($promoteId == 0) { - $map['promote_id'] = 0; - } else { - $promoteMap['chain'] = ['like', "%/$promoteId/%"]; - $promoteIds = M('Promote', 'tab_')->where($promoteMap)->getField('id', true); - $promoteIds[] = $promoteId; - $map['promote_id'] = ['in', $promoteIds]; - } - } - - $isMarketAdmin = isMarketAdmin(); - $isMarketLeader = isMarketLeader(); - $marketAdminIds = getSearchAdminIds('market_admin_id'); - - if (is_array($marketAdminIds)) { - $map['market_admin_id'] = ['in', $marketAdminIds]; - } - setPowerPromoteIds($map,'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 { - $order = ' pay_time desc '; - } - if (I('platform_type', 0) != 0) { - $sy = I('platform_type', 0) == 1 ? '=' : '<>'; - $game_id = M("Game","tab_")->where('unique_code ' . $sy . ' ""')->getField("id",true); - $map['game_id'] = ['in',$game_id]; - } - - // if (intval(($endTime + 1) - $startTime) / (24 * 3600) <= 31) { - // $map1 = $map; - // $map1['pay_status'] = 1; - // } else { - // $map = '1 = 2'; - // $map1 = $map; - // } - $this->checkListOrCountAuthRestMap($map,["extend", "pay_order_number", "user_account"]); - D("Spend")->addSubsiteWhere($map); - if ($payStatus > 0) { - $map1 = $map; - $map1['pay_status'] = 1; - $total = null_to_0(M(self::model_name, "tab_")->where($map1)->sum('pay_amount')); - } - $total=$total?$total:0; - $this->assign('total', $total); - - $this->meta_title = $this->m_title = '游戏充值'; - $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Spend/lists', 'status' => 1])->find()); - - $data = D(self::model_name)->lists($_GET["p"], $map, $order); - // dd($data); - if (!empty($data['data'])) { - $adminIds = array_column($data['data'], 'market_admin_id'); - $adminUsernameList = getAdminUsernameList($adminIds); - $adminDepartments = getAdminDepartmentList($adminIds); - foreach ($data['data'] as $key=>&$value) { - ($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):''; - $value['market_admin_username'] = $adminUsernameList[$value['market_admin_id']] ?? '无'; - $value['admin_department'] = $adminDepartments[$value['market_admin_id']] ?? '无'; - $value['is_check_str'] = D(self::model_name)::IsCheckStr[$value['is_check']]; - $value['is_refund_str'] = D(self::model_name)::IsRefundStr[$value['is_refund']]; - //拆分游戏名称和设备类型 - $game_arr = explode("(", rtrim($value['game_name'], ")")); - $value['game_name'] = $game_arr[0]; - $value['sdk_version_name'] = $game_arr[1]; - if(!$value['pay_time']) $value['pay_time'] = $value['spend_time']; - } - } - - $departments = M('department', 'sys_')->select(); - - $this->assign('departments', $departments); - $this->assign('isMarketLeader', $isMarketLeader); - $this->assign('showMarketAdmin', session('user_auth')['show_market_admin']); - $this->assign('showPromote', session('user_auth')['show_promote']); - $this->assign('isMarketAdmin', $isMarketAdmin); - $this->assign('marketAdmins', getMarketAdmins()); - $this->assign('startDate', $startDate); - $this->assign('endDate', $endDate); - $this->assign('payStatus', $payStatus); - $this->assign('list_data', $data['data']); - $this->assign('_page', $data['page']); - $show_data_power = (is_administrator()|| session('user_auth')['show_data']); - $this->assign('show_data_power', $show_data_power); - - if(!IS_ROOT){ - $this->OpAuthList= getModuleControllerAuth(); - } - - $this->assign('menubtn',$this->menuAuth()); - $this->display(); - } - protected function menuAuth() { $mentBtn = [ diff --git a/Application/Admin/View/Spend/listsMime.html b/Application/Admin/View/Spend/listsMime.html deleted file mode 100644 index 16c0095..0000000 --- a/Application/Admin/View/Spend/listsMime.html +++ /dev/null @@ -1,881 +0,0 @@ - - - - - - - - - - - -
- -
-
- -
- -
- -
-
- -
-
- -
-
- - - -
- - -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- - -
- - - -
-
- -
- - - -
- -
- - - -
- -
- - -
- -
- -
- -
-
- - -
- -
- -
- -
- - - -
- 搜索 -
-
- -
- - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
支付订单号CP订单号 - - 充值时间 - 支付时间玩家账号游戏名称设备类型所属推广员所属市场部所属市场专员所属商户充值ip区服ID游戏区服角色ID角色名称订单金额折扣 - - 实付金额 - 充值方式订单状态退款状态游戏通知状态是否参与结算操作
aOh! 暂时还没有内容!
- - {$data.pay_order_number} - - {$data.pay_order_number|encryptStr} - - - - {$data.extend} - - {$data.extend|encryptStr} - - {:set_show_time($data['pay_time'])} - - {:set_show_time($data['payed_time'])} - - ------ - - - - {$data.user_account} - - {$data.user_account|encryptStr} - - ({$data.small_account}){$data.game_name}{$data.sdk_version_name} - C('OFFICIEL_CHANNEL') - - {$data['promote_account']} - - - {$data.admin_department}{$data.market_admin_username}{:getMerchantName($data['merchant_id'])}{$data.spend_ip}— —— —{$data.server_id}{$data.server_name}— —— —{$data.game_player_id}{$data.game_player_name}{$data.cost|default=0.00}{$data.discount_amount|default=0.00}{$data.pay_amount}{:get_pay_way($data['pay_way'])} - {:get_info_status($data['pay_real_status'],9)} - - {:get_info_status($data['pay_real_status'],9)} - - {$data.is_refund_str} - {:get_info_status($data['pay_game_status'],14)} - - — — - - {:get_info_status($data['pay_game_status'],14)} - - {$data.is_check_str} - - - - 补单 - - - -
- - - 通知到账 - - -
汇总 - 当页充值:{:null_to_0(array_sum(array_column(array_status2value('pay_real_status','',$list_data),'pay_amount')))} - - 累计充值:{$total}(此处只汇总充值成功的订单) -
-
-
-
- - 导出 - - {$_page|default=''} -
- - - -
- - - - if(C('COLOR_STYLE')=='blue_color') echo ' - - '; - - - - - - - - diff --git a/Application/Home/Common/function.php b/Application/Home/Common/function.php index 6108c52..1e0af09 100644 --- a/Application/Home/Common/function.php +++ b/Application/Home/Common/function.php @@ -1423,5 +1423,5 @@ function is_active_class(array $controllers, array $actions, \Closure $otherCond function isOutPaySite() { - return $_SERVER['HTTP_HOST'] == 'outertg.jianghuifa.cn'; + return false; } diff --git a/Application/Home/Controller/BaseController.class.php b/Application/Home/Controller/BaseController.class.php index 4e07d13..8a97f4b 100644 --- a/Application/Home/Controller/BaseController.class.php +++ b/Application/Home/Controller/BaseController.class.php @@ -33,25 +33,6 @@ class BaseController extends HomeController $loginer = $this->getLoginPromote(); - $url = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME); - if (!in_array($url, [ - 'home/query/getsubpromotes' - ])) { - $outPayRules = [ - 'home/query/rechargemine', - 'home/download/recharge_data_export_new', - 'home/download/listsindexnew', - 'home/download/export', - ]; - if (in_array($url, $outPayRules) && !isOutPaySite()) { - die('地址错误'); - } - if (isOutPaySite() && !in_array($url, $outPayRules)) { - $this->redirect('Query/rechargeMine'); - die(); - } - } - $this->accessLimit($loginer); // $this->certifiCation(); diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index c1403aa..9467d93 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -180,103 +180,7 @@ class DownloadController extends BaseController $this->assign('promoteNameArr', $promoteNameArr); return $this->display(); - } - - public function listsIndexNew($p = 0) - { - $nowTime = date('Y-m-d'); - $initBegTime = empty(I('begtime')) ? '' : I('begtime'); - $initEndTime = $nowTime; - $initEndTime = empty(I('endtime')) ? '' : I('endtime'); - $this->assign('begtime', $initBegTime); - $this->assign('endtime', $initEndTime); - $map1['chain'] = ['like', '%' . '/' . PID . '/' . '%']; - $res = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select(); - $childPromoteIds = ''; - if (empty($res)) { - $map['tab_downloadlog.promote_id'] = PID; - } else { - foreach ($res as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id . ','; - } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['tab_downloadlog.promote_id'] = ['in', $childPromoteIds]; - } - $levelPromote = $this->getLevelPromote(); - $queryPromote = $this->getQueryPromote($levelPromote); - $map2[] = [ - '_logic' => 'or', - 'id' => $queryPromote['id'], - 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] - ]; - $childPromoteIds = M('promote', 'tab_')->where($map2)->getField('id', true); - - $map = []; - if (count($childPromoteIds) > 0) { - $map = ['promote_id' => ['in', $childPromoteIds]]; - } else { - $map['_string'] = '1<>1'; - } - if (!empty($_REQUEST['dataname'])) { - $map['dataname'] = ['like', '%' . $_REQUEST['dataname'] . '%']; - } - if (!empty($_REQUEST['logid'])) { - $map['logid'] = $_REQUEST['logid']; - } - if (!empty($_REQUEST['begtime']) && !empty($_REQUEST['endtime'])) { - if (strtotime($_REQUEST['begtime']) == strtotime($_REQUEST['endtime'])) { - $endtime = strtotime($_REQUEST['endtime']) + 24 * 60 * 60; - } else { - $endtime = strtotime($_REQUEST['endtime']); - } - $map['addtime'] = array('BETWEEN', array(strtotime($_REQUEST['begtime']), $endtime)); - } - $map['type'] = '/Home/Query/rechargeMine'; - $page = intval(I('get.p', 1)); - $page = $page ? $page : 1; //默认显示第一页数据arraypage - $row = 10; - $rs = M('downloadlog', 'tab_')->where($map)->order('tab_downloadlog.addtime desc') - ->page($page, $row)->select(); - foreach ($rs as $key => $value) { - $pid = intval($value['promote_id']); - $getNameRs = M('promote', 'tab_')->field("real_name")->where(['id' => $pid])->find(); - $rs[$key]['actor'] = $getNameRs['real_name']; - } - - $promoteArr = explode(',', $childPromoteIds); - $promoteNameArr = []; - foreach ($promoteArr as $key1 => $value1) { - $promoteName = M('promote', 'tab_')->field("real_name")->where(['id' => intval($value1)])->find(); - $promoteNameArr[$key1]['name'] = $promoteName['real_name']; - $promoteNameArr[$key1]['promote_id'] = $value1; - } - /* 查询记录总数 */ - $count = M("downloadlog", "tab_") - ->field('tab_downloadlog.id') - ->where($map) - ->select(); - $count = count($count); - //分页 - $parameter['p'] = I('get.p', 1); - $parameter['row'] = I('get.row'); - $parameter['dataname'] = $_REQUEST['dataname']; - $parameter['logid'] = $_REQUEST['logid']; - $parameter['begtime'] = I('begtime'); - $parameter['endtime'] = I('endtime'); - $parameter['level_promote_2'] = $levelPromote[0]; - $parameter['level_promote_3'] = $levelPromote[1]; - $parameter['level_promote_4'] = $levelPromote[2]; - $page = set_pagination($count, $row, $parameter); - if ($page) { - $this->assign('_page', $page); - } - $this->assign('data', $rs); - - $this->assign('promoteNameArr', $promoteNameArr); - return $this->display(); - } + } /** * IOS详细下载数统计 @@ -1603,134 +1507,6 @@ class DownloadController extends BaseController $this->success('添加下载成功,导出数据不包含当天', U('listsIndex')); } - /** - * 充值明细添加下载 - * @author sunke - */ - public function recharge_data_export_new() - { - // 支付到账时间 - $payedBegTime = I("payed_begtime", ''); - if ($payedBegTime) { - $payedBegTime = strtotime($payedBegTime); - $payedEndTime = I("payed_endtime", ''); - if ($payedEndTime) { - $payedEndTime = strtotime($payedEndTime) + 86400; - } - } - if ($payedBegTime && !$payedEndTime) { - $this->error('到账时间有误,请检查。'); - } - if (($payedEndTime - $payedBegTime) > 31 * 24 * 3600) { - $this->error('到账时间范围不能超过31天'); - } - - // 下单时间 - $beginTime = strtotime(I('begtime') . ' 00:00:00'); - $endtime = strtotime(I('endtime') . ' 23:59:59'); - if (($endtime - $beginTime) > 31 * 24 * 3600) { - $this->error('下单时间范围不能超过31天'); - } - $map1['chain'] = ['like', '%' . '/' . PID . '/' . '%']; - $rs = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select(); - $childPromoteIds = ''; - if (empty($rs)) { - $map['tab_spend.promote_id'] = PID; - } else { - foreach ($rs as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id . ','; - } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['tab_spend.promote_id'] = ['in', $childPromoteIds]; - } - - $levelPromote = $this->getLevelPromote(); - $queryPromote = $this->getQueryPromote($levelPromote); - - $map2[] = [ - '_logic' => 'or', - 'id' => $queryPromote['id'], - 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] - ]; - $ids = M('promote', 'tab_')->where($map2)->getField('id', true); - if (empty($ids)) { - $ids = array(); - } - if (empty($levelPromote)) { - array_push($ids, PID); - } - array_push($ids, $queryPromote['id']); - if (!empty($ids)) { - $map['tab_spend.promote_id'] = ['in', $ids]; - } else { - $map['_string'] = '1<>1'; - } - - if (!empty(I('own_id'))) { - $map['tab_spend.promote_id'] = $queryPromote['id']; //本账号 - } - - - - if (!empty(I('begtime')) && empty(I('endtime'))) { - $map['tab_spend.spend_time'] = ['egt', strtotime(I('begtime'))]; - } elseif (empty(I('begtime')) && !empty(I('endtime'))) { - $map['tab_spend.spend_time'] = ['elt', strtotime(I('endtime')) + 86399]; - } elseif (!empty(I('begtime')) && !empty(I('endtime'))) { - $map['tab_spend.spend_time'] = ['between', [strtotime(I('begtime')), strtotime(I('endtime')) + 86399]]; - } else { - // $nowTime = date('Y-m-d'); - // $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); - // $initEndTime = date('Y-m-d'); - // $initBegTime = strtotime($initBegTime); - // $initEndTime = strtotime($initEndTime); - // $map['tab_spend.spend_time'] = ['between',[$initBegTime,$initEndTime]]; - } - - if ($payedBegTime) { - $map['tab_spend.payed_time'] = ['between', [$payedBegTime, $payedEndTime - 1]]; - } - - empty(I('relation_game_id')) || $map['tab_game.relation_game_id'] = I('relation_game_id'); - empty(I('sdk_version')) || $map['tab_game.sdk_version'] = I('sdk_version'); - empty(I('server_id')) || $map['tab_spend.server_id'] = I('server_id'); - empty(I('game_player_name')) || $map['tab_spend.game_player_name'] = ['like', '%' . I('game_player_name') . '%']; - 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'); - if (isset($_REQUEST['pay_real_status']) && $_REQUEST['pay_real_status'] !== '') { - $payStatus = intval(I('pay_real_status')); - - if (in_array($payStatus, array_keys(self::$payStatus))) { - $map['tab_spend.pay_real_status'] = $payStatus + 2; - } - } - - $map['tab_spend.pay_way'] = 41; - $map = $this->spendRepository->withIsCheck($map, 'tab_spend.is_check'); - - $conditions = json_encode($map, true); - $addtime = time(); - $data = [ - 'logid' => 'cz_' . time(), - 'promote_id' => PID, - 'type' => '/Home/Query/rechargeMine', - 'dataname' => '充值明细数据(新)', - 'status' => 0, - 'addtime' => $addtime, - 'begintime' => 0, - 'content' => '', - 'conditions' => $conditions - ]; - $res = M('downloadlog', 'tab_')->add($data); - if (!$res) { - // $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res)); - $this->error('添加下载失败'); - } - $this->success('添加下载成功,导出数据不包含当天', U('listsIndexNew')); - } - public function userRecharge_data_export() { $gameId = I('relation_game_id', 0); diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 4c6ebc7..b3ae657 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -269,223 +269,6 @@ class QueryController extends BaseController $this->display(); } - public function rechargeMine($p = 0) - { - $page = intval(I('p', 1)); - $row = intval(I('row', 10)); - $ownId = intval(I('own_id'), 0); //本账号 - $relationGameId = intval(I('relation_game_id', 0)); - $sdkVersion = intval(I('sdk_version', 0)); - $serverId = trim(I('server_id', '')); - $gamePlayerName = trim(I('game_player_name', '')); - $userAccount = trim(I('user_account', '')); - $payOrderNumber = trim(I('pay_order_number', '')); - $nowTime = date('Y-m-d'); - - $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); - $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); - $initEndTime = $nowTime; - $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime'); - - $begTime = strtotime($initBegTime); - $endTime = strtotime($initEndTime); - $endTime += 3600 * 24; - - $payedBegTime = I("payed_begtime", ''); - if ($payedBegTime) $payedBegTime = strtotime($payedBegTime); - $payedEndTime = I("payed_endtime", ''); - if ($payedEndTime) { - $payedEndTime = strtotime($payedEndTime) + 3600 * 24; - } - if ($payedBegTime && $payedEndTime) { - if (!I('begtime', '') && !I('endtime', '')) { - $initBegTime = ''; - $initEndTime = ''; - $begTime = 0; - $endTime = 0; - } - } - - $levelPromote = $this->getLevelPromote(); - $queryPromote = $this->getQueryPromote($levelPromote); - $loginPromote = $this->getLoginPromote(); - - $map = []; - if ($ownId) { - $map['tab_spend.promote_id'] = $queryPromote['id']; - } else { - $map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']; - $ids = M('promote', 'tab_')->where($map)->getField('id', true); - $ids[] = $queryPromote['id']; - - $map = []; - $map['tab_spend.promote_id'] = ['in', $ids]; - } - if (!empty($relationGameId)) { - $map['tab_game.relation_game_id'] = $relationGameId; - } - if (!empty($sdkVersion)) { - $map['tab_game.sdk_version'] = $sdkVersion; - } - if (!empty($serverId)) { - $map['tab_spend.server_id'] = $serverId; - } - if (!empty($gamePlayerName)) { - $map['tab_spend.game_player_name'] = $gamePlayerName; - } - if (!empty($userAccount)) { - $map['tab_spend.user_account'] = $userAccount; - } - if (!empty($payOrderNumber)) { - $map['tab_spend.pay_order_number'] = $payOrderNumber; - } - $map['tab_spend.pay_way'] = ['in', [41]]; - if (isset($_REQUEST['pay_real_status']) && $_REQUEST['pay_real_status'] !== '') { - $payStatus = intval(I('pay_real_status')); - - if (in_array($payStatus, array_keys(QueryController::$payStatus))) { - $map['tab_spend.pay_real_status'] = $payStatus; - } - } - if ($begTime && $endTime) { - $map['tab_spend.spend_time'] = ['between', [$begTime, $endTime - 1]]; - } - if ($payedBegTime && $payedEndTime) { - $map['tab_spend.payed_time'] = ['between', [$payedBegTime, $payedEndTime - 1]]; - } - - $map = $this->spendRepository->withIsCheck($map, 'tab_spend.is_check'); - - $data = []; - $count = 0; - $aggregation = [ - 'cost' => '0.00', - 'pay_amount' => '0.00', - 'discount_amount' => '0.00', - ]; - if ( - intval($endTime - $begTime) / (24 * 3600) <= 31 - || intval($payedEndTime - $payedBegTime) / (24 * 3600) <= 31 - ) { - $data = M('Spend', 'tab_') - ->field('tab_spend.*,tab_promote.account as pro_account,tab_promote.real_name as pro_real_name,tab_promote.chain as chain,tab_promote.level,tab_promote.parent_id') - ->join('tab_game on tab_spend.game_id = tab_game.id') - ->join('left join tab_promote on tab_spend.promote_id = tab_promote.id') - ->where($map) - ->order('tab_spend.id desc') - ->page($page, $row) - ->select(); - - $count = M('Spend', 'tab_') - ->join('tab_game on tab_spend.game_id = tab_game.id') - ->where($map) - ->count(); - - $aggregation = M('Spend', 'tab_') - ->field('sum(tab_spend.cost) as cost, sum(tab_spend.pay_amount) as pay_amount, sum(tab_spend.discount_amount) as discount_amount') - ->join('tab_game on tab_spend.game_id = tab_game.id') - ->join('left join tab_promote on tab_spend.promote_id = tab_promote.id') - ->where($map) - ->order('tab_spend.id desc') - ->find(); - } - if (!empty($data)) { - $promoteIdData = []; - foreach ($data as $list) { - switch ($list['level']) { - case 3: - $promoteIdData[] = $list['parent_id']; - break; - case 4: - $promoteIdData[] = $list['parent_id']; - $chain = trim($list['chain'], '/'); - $chainArr = explode('/', $chain); - $promoteIdData[] = $chainArr[1]; - break; - } - } - $promoteData = []; - if (!empty($promoteIdData)) { - $promoteIdData = array_unique($promoteIdData); - $promoteData = M('promote', 'tab_')->where(array('id' => ['in', $promoteIdData]))->getField('id,account,real_name,group_remark'); - } - foreach ($data as &$list) { - switch ($list['level']) { - case 1: - case 2: - $list['p_p_pro_account'] = $list['pro_account']; - $list['p_p_pro_real_name'] = $list['pro_real_name']; - $list['p_pro_account'] = $list['pro_account']; - $list['p_pro_real_name'] = $list['pro_real_name']; - break; - case 3: - $list['p_p_pro_account'] = $promoteData[$list['parent_id']]['account']; - $list['p_p_pro_real_name'] = $promoteData[$list['parent_id']]['real_name']; - $list['p_pro_account'] = $list['pro_account']; - $list['p_pro_real_name'] = $list['pro_real_name']; - break; - case 4: - $promoteIdData[] = $list['parent_id']; - $chain = trim($list['chain'], '/'); - $chainArr = explode('/', $chain); - $list['p_p_pro_account'] = $promoteData[$chainArr[1]]['account']; - $list['p_p_pro_real_name'] = $promoteData[$chainArr[1]]['real_name']; - $list['p_p_pro_group_remark'] = $promoteData[$chainArr[1]]['group_remark']; - $list['p_pro_account'] = $promoteData[$list['parent_id']]['account']; - $list['p_pro_real_name'] = $promoteData[$list['parent_id']]['real_name']; - $list['p_pro_group_remark'] = $promoteData[$list['parent_id']]['group_remark']; - break; - } - $list['user_account'] = getUserAccountOfPromote($list['user_account'], $loginPromote); - $list['spend_time'] = date('Y-m-d H:i:s', $list['spend_time']); - $list['pay_time'] = ($list['pay_real_status'] == 1) ? date('Y-m-d H:i:s', $list['pay_time']) : '--'; - $list['pay_status'] = isset(QueryController::$payStatus[$list['pay_real_status']]) ? QueryController::$payStatus[$list['pay_real_status']] : '未知状态'; - $list['sdk_version'] = getSDKTypeName($list['sdk_version']); - $list['pay_order_number'] = hideOrderNumber($list['pay_order_number']); - } - } - - //分页 - $parameter['p'] = $page; - $parameter['row'] = $row; - $parameter['begtime'] = $initBegTime; - $parameter['endtime'] = $initEndTime; - $parameter['payed_begtime'] = I("payed_begtime", ''); - $parameter['payed_endtime'] = I("payed_endtime", ''); - $parameter['relation_game_id'] = $relationGameId; - $parameter['sdk_version'] = $sdkVersion; - $parameter['server_id'] = $serverId; - $parameter['game_player_name'] = $gamePlayerName; - $parameter['user_account'] = $userAccount; - $parameter['pay_order_number'] = $payOrderNumber; - $parameter['own_id'] = $ownId; - $parameter['level_promote_2'] = $levelPromote[0]; - $parameter['level_promote_3'] = $levelPromote[1]; - $parameter['level_promote_4'] = $levelPromote[2]; - !isset($_REQUEST['pay_way']) || $parameter['pay_way'] = I('pay_way'); - !isset($_REQUEST['pay_real_status']) || $parameter['pay_real_status'] = I('pay_real_Zstatus', -1); - - $serverData = $this->getServer(I('relation_game_id'), I('sdk_version')); - $page = set_pagination($count, $row, $parameter); - if ($page) { - $this->assign('_page', $page); - } - $this->assign('listData', $data); - $this->assign('count', $count); - $this->assign('aggregation', $aggregation); - $this->assign('initBegTime', $initBegTime); - $this->assign('initEndTime', $initEndTime); - $this->assign('payedBegTime', I("payed_begtime", '')); - $this->assign('payedEndTime', I("payed_endtime", '')); - $this->assign('setdate', date("Y-m-d")); - $this->assign('serverData', $serverData['data']); - $this->assign('ownId', $ownId); - $this->assign('payWayData', QueryController::$payWay); - $this->assign('payStatusData', QueryController::$payStatus); - $this->meta_title = "订单查询"; - $this->display(); - } - public function register($p = 0) { $page = intval(I('p', 1)); diff --git a/Application/Home/View/default/Public/promote_base.html b/Application/Home/View/default/Public/promote_base.html index f5c4f40..6ac452d 100644 --- a/Application/Home/View/default/Public/promote_base.html +++ b/Application/Home/View/default/Public/promote_base.html @@ -36,16 +36,6 @@ -