diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index b8821443d..19e3f3b73 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -1,23 +1,12 @@ >>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a use Base\Repository\PromoteRepository; use Base\Repository\SpendRepository; use Base\Repository\UserRepository; use Base\Service\PromoteService; use Base\Service\PromoteGradeService; -<<<<<<< HEAD -======= -use Base\Facade\Request; -use Base\Service\ApplyService; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a use Base\Service\PromoteCoinRecordService; use Base\Service\PromoteCoinTransferLogService; use GuzzleHttp\Client; @@ -41,13 +30,8 @@ class DownloadController extends BaseController 15 => '双乾支付-快捷', 17 => '易宝支付' ]; -<<<<<<< HEAD //提现状态 -======= - - //提现状态 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a public static $withdrawStatus = [ -1 => '审核未通过', 0 => '待审核', @@ -67,7 +51,6 @@ class DownloadController extends BaseController parent::_initialize(); $this->spendRepository = new SpendRepository(); } -<<<<<<< HEAD /** * excel @@ -84,31 +67,12 @@ class DownloadController extends BaseController $objPHPExcel = new \PHPExcel(); $cellName = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ'); $objPHPExcel->getActiveSheet(0)->mergeCells('A1:' . $cellName[$cellNum - 1] . '1'); //合并单元格 -======= - - /** - * excel - */ - public function exportExcel($expTitle, $expCellName, $expTableData,$id) - { - $xlsTitle = iconv('utf-8', 'gb2312', $expTitle);//文件名称 -// $fileName = session('user_auth.username').date('_YmdHis');//or $xlsTitle 文件名称可根据自己情况设定 - $fileName = $expTitle.'_'.date('YmdHis'); - $cellNum = count($expCellName); - $dataNum = count($expTableData); - Vendor("PHPExcel.PHPExcel"); - - $objPHPExcel = new \PHPExcel(); - $cellName = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ'); - $objPHPExcel->getActiveSheet(0)->mergeCells('A1:' . $cellName[$cellNum - 1] . '1');//合并单元格 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', $expTitle); $objPHPExcel->setActiveSheetIndex(0)->getStyle('A1')->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER); for ($i = 0; $i < $cellNum; $i++) { $objPHPExcel->setActiveSheetIndex(0)->setCellValue($cellName[$i] . '2', $expCellName[$i][1]); } for ($i = 0; $i < $dataNum; $i++) { -<<<<<<< HEAD for ($j = 0; $j < $cellNum; $j++) { $objPHPExcel->getActiveSheet(0)->setCellValue($cellName[$j] . ($i + 3), $expTableData[$i][$expCellName[$j][0]]); } @@ -118,35 +82,18 @@ class DownloadController extends BaseController header('pragma:public'); header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $xlsTitle . '.xls"'); header("Content-Disposition:attachment;filename=$fileName.xls"); //attachment新窗口打印inline本窗口打印 -======= - for ($j = 0; $j < $cellNum; $j++) { - $objPHPExcel->getActiveSheet(0)->setCellValue($cellName[$j] . ($i + 3), $expTableData[$i][$expCellName[$j][0]]); - } - } - - ob_end_clean();//清除缓冲区,避免乱码 - header('pragma:public'); - header('Content-type:application/vnd.ms-excel;charset=utf-8;name="' . $xlsTitle . '.xls"'); - header("Content-Disposition:attachment;filename=$fileName.xls");//attachment新窗口打印inline本窗口打印 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $objWriter = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); $this->backSuccessExport($id); exit; } -<<<<<<< HEAD public function listsIndex($p = 0) { -======= - - public function listsIndex($p = 0) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $nowTime = date('Y-m-d'); $initBegTime = empty(I('begtime')) ? '' : I('begtime'); $initEndTime = $nowTime; $initEndTime = empty(I('endtime')) ? '' : I('endtime'); -<<<<<<< HEAD $this->assign('begtime', $initBegTime); $this->assign('endtime', $initEndTime); $map1['chain'] = ['like', '%' . '/' . PID . '/' . '%']; @@ -162,23 +109,6 @@ class DownloadController extends BaseController $childPromoteIds = rtrim($childPromoteIds, ','); $childPromoteIds .= ',' . PID; $map['tab_downloadlog.promote_id'] = ['in', $childPromoteIds]; -======= - $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]; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); @@ -195,7 +125,6 @@ class DownloadController extends BaseController } else { $map['_string'] = '1<>1'; } -<<<<<<< HEAD if (!empty($_REQUEST['dataname'])) { $map['dataname'] = ['like', '%' . $_REQUEST['dataname'] . '%']; } @@ -227,40 +156,6 @@ class DownloadController extends BaseController $promoteName = M('promote', 'tab_')->field("real_name")->where(['id' => intval($value1)])->find(); $promoteNameArr[$key1]['name'] = $promoteName['real_name']; $promoteNameArr[$key1]['promote_id'] = $value1; -======= - 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)); - - } - $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; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } /* 查询记录总数 */ $count = M("downloadlog", "tab_") @@ -268,11 +163,7 @@ class DownloadController extends BaseController ->where($map) ->select(); $count = count($count); -<<<<<<< HEAD //分页 -======= - //分页 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $parameter['p'] = I('get.p', 1); $parameter['row'] = I('get.row'); $parameter['dataname'] = $_REQUEST['dataname']; @@ -286,7 +177,6 @@ class DownloadController extends BaseController if ($page) { $this->assign('_page', $page); } -<<<<<<< HEAD $this->assign('data', $rs); $this->assign('promoteNameArr', $promoteNameArr); @@ -320,46 +210,6 @@ class DownloadController extends BaseController } if ($type) { $map['type'] = $type; -======= - $this->assign('data',$rs); - - $this->assign('promoteNameArr',$promoteNameArr); - $this->meta_title = "下载管理"; - return $this->display(); - } - - /** - * IOS详细下载数统计 - * @author sunke - */ - public function iosdetail_data_export() { - $promote_id = $_REQUEST['promote_id']; - $belongs_president = $_REQUEST['belongs_president']; - $belongs_department = $_REQUEST['belongs_department']; - $belongs_group = $_REQUEST['belongs_group']; - $user_account = $_REQUEST['user_account']; - $type = $_REQUEST['type']; - $createTime = I('create_time', ''); - if(!empty($_REQUEST['promote_id'])) { - $map['promote_id'] = $_REQUEST['promote_id']; - } - if(!empty($_REQUEST['belongs_president'])) { - $map['belongs_president'] = $_REQUEST['belongs_president']; - } - if(!empty($_REQUEST['belongs_department'])) { - $map['belongs_department'] = $_REQUEST['belongs_department']; - } - if(!empty($_REQUEST['belongs_group'])) { - $map['belongs_group'] = $_REQUEST['belongs_group']; - } - if($user_account) { - $user_id = M('user', 'tab_')->where(['account'=>$user_account])->getField('id'); - $map['user_id'] = $user_id; - } - if($type) { - $map['type'] = $type; - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $nowTime = date('Y-m-d'); $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); @@ -370,17 +220,10 @@ class DownloadController extends BaseController $endTime = strtotime($initEndTime); $endTime += 3600 * 24; $map['create_time'] = ['between', [$begTime, $endTime]]; -<<<<<<< HEAD $conditions = json_encode($map, TRUE); $addtime = time(); $data = [ 'logid' => 'IOSdetail_' . time(), -======= - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'IOSdetail_'.time(), ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'promote_id' => PID, 'type' => '/Home/Query/iosDownLoadDetail', 'dataname' => 'IOS玩家详情下载统计', @@ -388,7 +231,6 @@ class DownloadController extends BaseController 'addtime' => $addtime, 'begintime' => 0, 'content' => '', -<<<<<<< HEAD 'conditions' => $conditions ]; $res = M('downloadlog', 'tab_')->add($data); @@ -404,35 +246,13 @@ class DownloadController extends BaseController public function ios_data_export() { -======= - 'conditions' =>$conditions - ]; - $res = M('downloadlog','tab_')->add($data); - if (!$res) { - // $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res)); - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); - - } - /** - * IOS下载数统计 - * @author sunke - */ - - public function ios_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); $localId = $queryPromote['id']; $map = []; if ($queryPromote['level'] == 4) { $map['id'] = $queryPromote['id']; -<<<<<<< HEAD } else { -======= - }else { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']; } $createTime = I('create_time', ''); @@ -447,21 +267,12 @@ class DownloadController extends BaseController $map['create_time'] = ['between', [$begTime, $endTime]]; $map['pid'] = PID; if ($localId !== PID) { -<<<<<<< HEAD $map['localId'] = $localId; } $conditions = json_encode($map, TRUE); $addtime = time(); $data = [ 'logid' => 'IOS_' . time(), -======= - $map['localId'] = $localId; - } - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'IOS_'.time(), ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'promote_id' => PID, 'type' => '/Home/Query/iosDownLoadData', 'dataname' => 'IOS下载统计', @@ -469,7 +280,6 @@ class DownloadController extends BaseController 'addtime' => $addtime, 'begintime' => 0, 'content' => '', -<<<<<<< HEAD 'conditions' => $conditions ]; $res = M('downloadlog', 'tab_')->add($data); @@ -486,24 +296,6 @@ class DownloadController extends BaseController public function dailysummary_data_export() { $relationGameId = intval(I('relation_game_id', 0)); -======= - 'conditions' =>$conditions - ]; - $res = M('downloadlog','tab_')->add($data); - if (!$res) { - // $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res)); - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); - } - - /** - * 每日概况 - * @author sunke - */ - public function dailysummary_data_export() { - $relationGameId = intval(I('relation_game_id', 0)); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $sdkVersion = intval(I('sdk_version', 0)); $serverId = intval(I('server_id'), 0); $nowTime = date('Y-m-d'); @@ -518,7 +310,6 @@ class DownloadController extends BaseController $queryPromote = $this->getQueryPromote($levelPromote); $loginPromote = $this->getLoginPromote(); -<<<<<<< HEAD $map1['chain'] = ['like', '%' . '/' . PID . '/' . '%']; $rs = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select(); $childPromoteIds = ''; @@ -536,25 +327,6 @@ class DownloadController extends BaseController $ownId = intval(I('own_id'), 0); //本账号 if ($ownId) { -======= - $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['promote_id'] = ['in', $childPromoteIds]; - } - - $ownId = intval(I('own_id'), 0);//本账号 - if ($ownId) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map['promote_id'] = $queryPromote['id']; } else { $map2['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']; @@ -563,40 +335,25 @@ class DownloadController extends BaseController $ids = implode(',', $ids); $map['promote_id'] = $ids; } -<<<<<<< HEAD if ($serverId > 0) { $map['server_id'] = $serverId; } if ($relationGameId > 0 || $sdkVersion > 0) { -======= - if ($serverId > 0) { - $map['server_id'] = $serverId; - } - if ($relationGameId > 0 || $sdkVersion > 0) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($sdkVersion > 0) { $map['sdk_version'] = $sdkVersion; } if ($relationGameId > 0) { $map['relation_game_id'] = $relationGameId; } -<<<<<<< HEAD $gameIds = M('Game', 'tab_')->where($map)->getField('id', true); $map['gameIds'] = $gameIds; } -======= - $gameIds = M('Game', 'tab_')->where($map)->getField('id', true); - $map['gameIds'] = $gameIds; - } - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map['begin_time'] = $begTime; $map['end_time'] = $endTime; $dayList = $this->getDayList($begTime, $endTime); $map['dayList'] = $dayList; -<<<<<<< HEAD $conditions = json_encode($map, TRUE); $addtime = time(); $data = [ @@ -623,36 +380,6 @@ class DownloadController extends BaseController */ public function withdrawRecord_data_export() { -======= - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'dy_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Query/dailySummary', - '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('listsIndex')); - - - } - - /** - * 提现记录 - * @author sunke - */ - public function withdrawRecord_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $withdrawNumber = I('widthdraw_number', ''); $initBegTime = I('begtime', ''); $initEndTime = I('endtime', ''); @@ -662,24 +389,15 @@ class DownloadController extends BaseController $map['promote_id'] = $this->loginPromote['id']; if (!empty($withdrawNumber)) { $map['widthdraw_number'] = $withdrawNumber; -<<<<<<< HEAD } if (!empty($initBegTime) && empty($initEndTime)) { -======= - } - if (!empty($initBegTime) && empty($initEndTime)) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map['create_time'] = ['egt', $begTime]; } elseif (empty($initBegTime) && !empty($initEndTime)) { $map['create_time'] = ['lt', $endTime]; } elseif (!empty($initBegTime) && !empty($initEndTime)) { $map['create_time'] = ['between', [$begTime, $endTime - 1]]; } -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if (isset($_GET['status']) && $_GET['status'] !== '') { $status = intval($_GET['status']); if (!isset(FinanceController::$withdrawStatus[$status])) { @@ -688,7 +406,6 @@ class DownloadController extends BaseController $map['status'] = $status; } -<<<<<<< HEAD $conditions = json_encode($map, TRUE); $addtime = time(); @@ -715,34 +432,6 @@ class DownloadController extends BaseController */ public function withdrawDtl_data_export() { -======= - - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'withdrawRecord'.time(), - 'promote_id' => PID, - 'type' => '/Home/Finance/withdrawRecord', - '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('listsIndex')); - } - /** - * 提现明细 - * @author sunke - */ - public function withdrawDtl_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $withdrawId = intval(I('get.id', 0)); if ($withdrawId == 0) { $this->error('参数异常'); @@ -754,11 +443,7 @@ class DownloadController extends BaseController $gameId = intval(I('game_id', 0)); $userAccount = I('user_account', ''); $payOrderNumber = I('pay_order_number', ''); -<<<<<<< HEAD $map['withdraw_id'] = $withdrawId; -======= - $map['withdraw_id'] = $withdrawId; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if (!empty($gameId)) { $map['game_id'] = $gameId; } @@ -768,7 +453,6 @@ class DownloadController extends BaseController if (!empty($payOrderNumber)) { $map['pay_order_number'] = $payOrderNumber; } -<<<<<<< HEAD $conditions = json_encode($map, TRUE); $addtime = time(); @@ -796,35 +480,6 @@ class DownloadController extends BaseController */ public function financeindex_data_export() { -======= - - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'withdrawDtl_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Finance/withdrawDtl', - '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('listsIndex')); - } - - /** - * 结算中心 - * @author sunke - */ - public function financeindex_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $thisDay = strtotime(date('Y-m-d')); $thisMonth = strtotime(date('Y-m')); $yesterday = strtotime(date('Y-m-d', strtotime('-1 day', time()))); @@ -844,7 +499,6 @@ class DownloadController extends BaseController $map['pay_status'] = 1; $map['promote_id'] = ['in', $promoteIds]; $map['pay_time'] = ['between', [$begTime, $endTime]]; -<<<<<<< HEAD $conditions = json_encode($map, TRUE); $addtime = time(); @@ -872,35 +526,6 @@ class DownloadController extends BaseController */ public function settlementDtl_data_export() { -======= - - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'finance_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Finance/index', - '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('listsIndex')); - } - - /** - * 结算明细 - * @author sunke - */ - public function settlementDtl_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $payOrderNumber = I('pay_order_number', ''); $nowTime = date('Y-m-d'); $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); @@ -947,7 +572,6 @@ class DownloadController extends BaseController } } } -<<<<<<< HEAD $conditions = json_encode($map, TRUE); $addtime = time(); $data = [ @@ -1151,211 +775,6 @@ class DownloadController extends BaseController $childPromoteIds = rtrim($childPromoteIds, ','); $childPromoteIds .= ',' . PID; $map['tab_coin_pay_order.promote_id'] = ['in', $childPromoteIds]; -======= - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'settlementDtl_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Finance/settlementDtl', - '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('listsIndex')); - - } - /** - * 测试资源 - * @author sunke - */ - public function testresource_data_export() { - $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; - $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); - $childPromoteIds = ''; - $map['tab_test_resource.promote_id'] = PID; - - if(!empty(I('role_name'))){ - $map['role_name']=['like','%'.I('role_name').'%']; - } - if(!empty(I('server_name'))){ - $map['server_name']=I('server_name'); - } - if(!empty(I('game_name'))){ - $map['game_name']=I('game_name'); - } - if(!empty(I('user_account'))){ - $map['user_account']=['like','%'.I('user_account').'%']; - } - if(!empty($_REQUEST['start'])&&empty($_REQUEST['end'])){ - $map['create_time'] = array('GT',strtotime($_REQUEST['start'])); - unset($_REQUEST['start']); - } - if(empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){ - $map['create_time'] = array('LT',strtotime($_REQUEST['end'])+24*60*60-1); - unset($_REQUEST['end']); - } - if(!empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){ - $map['create_time'] = array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1)); - unset($_REQUEST['start']);unset($_REQUEST['end']); - } - - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'test_'.time(), - 'promote_id' => PID, - 'type' => '/Home/TestResource/index', - '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('listsIndex')); - } - - /** - * 测试资源申请记录 - * @author sunke - */ - public function testresourcelists_data_export() { - $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; - $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); - $childPromoteIds = ''; - $map['tab_test_resource.promote_id'] = PID; - - if(!empty(I('type'))||I('type')==='0'){ - $map['apply_status']=I('type'); - } - - if(!empty(I('role_name'))){ - $map['role_name']=['like','%'.I('role_name').'%']; - } - if(!empty(I('server_name'))){ - $map['server_name']=I('server_name'); - } - if(!empty(I('game_name'))){ - $map['game_name']=I('game_name'); - } - if(!empty(I('user_account'))){ - $map['user_account']=['like','%'.I('user_account').'%']; - } - if(!empty($_REQUEST['start'])&&empty($_REQUEST['end'])){ - $map['create_time'] = array('GT',strtotime($_REQUEST['start'])); - unset($_REQUEST['start']); - } - if(empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){ - $map['create_time'] = array('LT',strtotime($_REQUEST['end'])+24*60*60-1); - unset($_REQUEST['end']); - } - if(!empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){ - $map['create_time'] = array('BETWEEN',array(strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1)); - unset($_REQUEST['start']);unset($_REQUEST['end']); - } - //$data=M('test_resource','tab_')->where($map)->order('id desc')->select(); - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'test_'.time(), - 'promote_id' => PID, - 'type' => '/Home/TestResource/lists', - '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('listsIndex')); - } - - /** - * 扶持号管理 - * @author sunke - */ - public function supportNumberList_data_export() { - $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; - $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); - $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'); - } - - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'test_'.time(), - 'promote_id' => PID, - 'type' => '/Home/TestResource/supportNumberList', - '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('listsIndex')); - - } - /** - * 平台币充值 - * @author sunke - */ - - public function orderlist_data_export() { - $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; - $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); - $childPromoteIds = ''; - if(empty($rs)) { - $map['tab_coin_pay_order.promote_id'] = PID; - }else { - foreach ($rs as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id.','; - } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['tab_coin_pay_order.promote_id'] = ['in', $childPromoteIds]; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $map['is_del'] = 0; $start_time = strtotime(I('time_start')); @@ -1364,7 +783,6 @@ class DownloadController extends BaseController $order_status = I("order_status"); $pay_type = I("pay_type"); if (!empty($start_time) && !empty($end_time)) { -<<<<<<< HEAD $map['create_time'] = ['BETWEEN', [$start_time, $end_time + 24 * 60 * 60 - 1]]; } else if (!empty($start_time)) { $map['create_time'] = array('gt', $start_time); @@ -1406,50 +824,6 @@ class DownloadController extends BaseController public function arpu_data_export() { $defaultTime = date('Y-m-d', time() - 6 * 24 * 3600) . ' 至 ' . date('Y-m-d'); -======= - $map['create_time'] = ['BETWEEN', [$start_time, $end_time + 24 * 60 * 60 - 1]]; - } else if (!empty($start_time)) { - $map['create_time'] = array('gt', $start_time); - } else if (!empty($end_time)) { - $map['create_time'] = array('lt', $end_time + 24 * 60 * 60 - 1); - } - if(!empty($order_number)){ - $map['order_number'] = $order_number; - } - if(!empty($order_status) || $order_status=='0'){ - $map['order_status'] = $order_status; - } - if(!empty($pay_type)){ - $map['pay_type'] = $pay_type; - } - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'orderlist_'.time(), - 'promote_id' => PID, - 'type' => '/Home/CoinOrder/order_list', - '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('listsIndex')); - - } - /** - * arpu统计 - * @author sunke - */ - public function arpu_data_export() { - $defaultTime = date('Y-m-d', time() - 6 * 24 * 3600) . ' 至 ' . date('Y-m-d'); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $time = I('time', ''); $time = $time == '' ? $defaultTime : $time; @@ -1457,7 +831,6 @@ class DownloadController extends BaseController // $gameId = I('game_id', 0); $relationGameId = I('relation_game_id', 0); $serverId = I('server_id', 0); -<<<<<<< HEAD $map1['chain'] = ['like', '%' . '/' . PID . '/' . '%']; $rs = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select(); @@ -1476,33 +849,12 @@ class DownloadController extends BaseController $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); -======= - - $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; - $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); - $childPromoteIds = ''; - if(empty($rs)) { - $map['promote_id'] = PID; - }else { - foreach ($rs as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id.','; - } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['promote_id'] = ['in', $childPromoteIds]; - } - $levelPromote = $this->getLevelPromote(); - $queryPromote = $this->getQueryPromote($levelPromote); - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map2[] = [ '_logic' => 'or', 'id' => $queryPromote['id'], 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] ]; $ids = M('promote', 'tab_')->where($map2)->getField('id', true); -<<<<<<< HEAD if (empty($ids)) { $ids = array(); } @@ -1510,21 +862,10 @@ class DownloadController extends BaseController array_push($ids, PID); } array_push($ids, $queryPromote['id']); -======= - if(empty($ids)) { - $ids = array(); - } - if(empty($levelPromote)) { - array_push($ids,PID); - - } - array_push($ids,$queryPromote['id']); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if (!empty($ids)) { $pro = ""; foreach ($ids as $value1) { $pid = $value1; -<<<<<<< HEAD $pro .= $pid . ','; } $pro = rtrim($pro, ','); @@ -1533,17 +874,6 @@ class DownloadController extends BaseController $map['_string'] = '1<>1'; } -======= - $pro .= $pid.','; - } - $pro = rtrim($pro,','); - $map['promote_id'] = ['in',$pro]; - - }else { - $map['_string'] = '1<>1'; - } - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $searchGameName = ''; $searchServerName = ''; if ($relationGameId > 0) { @@ -1561,7 +891,6 @@ class DownloadController extends BaseController } if ($sdkVersion > 0) { $map['sdk_version'] = $sdkVersion; -<<<<<<< HEAD } list($beginTime, $endTime) = $this->getBetweenTime($time); $map['begin_time'] = $beginTime; @@ -1594,41 +923,6 @@ class DownloadController extends BaseController */ public function regist_data_export() { -======= - } - list($beginTime, $endTime) = $this->getBetweenTime($time); - $map['begin_time'] = $beginTime; - $map['end_time'] = $endTime; - - $dayList = $this->getDayList($beginTime, $endTime); - $map['dayList'] = $dayList; - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'zc_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Query/arpu', - 'dataname' => 'ARPU统计', - '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('listsIndex')); - - } - /** - * 注册数据添加下载 - * @author sunke - */ - public function regist_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if (empty(I('begtime')) || empty(I('endtime'))) { $this->error('请选择起止时间'); } @@ -1637,7 +931,6 @@ class DownloadController extends BaseController if (($endtime - $beginTime) > 31 * 24 * 3600) { $this->error('时间范围不能超过31天'); } -<<<<<<< HEAD $map1['chain'] = ['like', '%' . '/' . PID . '/' . '%']; $rs = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select(); $childPromoteIds = ''; @@ -1655,32 +948,12 @@ class DownloadController extends BaseController $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); -======= - $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; - $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); - $childPromoteIds = ''; - if(empty($rs)) { - $map['tab_user.promote_id'] = PID; - }else { - foreach ($rs as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id.','; - } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['tab_user.promote_id'] = ['in', $childPromoteIds]; - } - $levelPromote = $this->getLevelPromote(); - $queryPromote = $this->getQueryPromote($levelPromote); - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map2[] = [ '_logic' => 'or', 'id' => $queryPromote['id'], 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] ]; $ids = M('promote', 'tab_')->where($map2)->getField('id', true); -<<<<<<< HEAD if (empty($ids)) { $ids = array(); } @@ -1698,27 +971,6 @@ class DownloadController extends BaseController $map['tab_user.promote_id'] = $queryPromote['id']; //本账号 } -======= - if(empty($ids)) { - $ids = array(); - } - if(empty($levelPromote)) { - array_push($ids,PID); - - } - array_push($ids,$queryPromote['id']); - if (!empty($ids)) { - $map['tab_user.promote_id'] = ['in',$ids]; - - }else { - $map['_string'] = '1<>1'; - } - - if (!empty(I('own_id'))) { - $map['tab_user.promote_id'] = $queryPromote['id'];//本账号 - } - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if (!empty(I('begtime')) && empty(I('endtime'))) { $map['tab_user.register_time'] = ['egt', strtotime(I('begtime'))]; } elseif (empty(I('begtime')) && !empty(I('endtime'))) { @@ -1729,7 +981,6 @@ class DownloadController extends BaseController empty(I('account')) || $map['tab_user.account'] = ['like', '%' . I('account') . '%']; empty(I('id')) || $map['tab_user.id'] = intval(I('id')); -<<<<<<< HEAD $conditions = json_encode($map, TRUE); $addtime = time(); $data = [ @@ -1770,48 +1021,6 @@ class DownloadController extends BaseController $map['id'] = ['in', $childPromoteIds]; } -======= - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'zc_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Query/registe', - '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('listsIndex')); - } - - //渠道管理 - public function children_data_export() { - $promoteType = intval(I('promote_type', 0)); - $loginer = $this->getLoginPromote(); - $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; - $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); - $childPromoteIds = ''; - if(empty($rs)) { - $map['id'] = PID; - }else { - foreach ($rs as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id.','; - } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['id'] = ['in', $childPromoteIds]; - } - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($promoteType == 0) { $map['level'] = 2; } elseif ($promoteType == 1) { @@ -1819,17 +1028,10 @@ class DownloadController extends BaseController } elseif ($promoteType == 2) { $map['level'] = 4; } -<<<<<<< HEAD if (I('account', '')) { $map['account'] = ['like', '%' . I('account', '') . '%']; } if (I('mobile', '')) { -======= - if(I('account', '')) { - $map['account'] = ['like', '%' . I('account', '') . '%']; - } - if (I('mobile', '')) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map['mobile_phone'] = ['like', '%' . I('mobile', '') . '%']; } if (I('idcard', '')) { @@ -1841,7 +1043,6 @@ class DownloadController extends BaseController if (I('status', 'all') != 'all') { $map['status'] = ['eq', I('status', 'all')]; } -<<<<<<< HEAD $conditions = json_encode($map, TRUE); $addtime = time(); $type = "/Home/Promote/children/promote_type/" . $promoteType; @@ -1869,36 +1070,6 @@ class DownloadController extends BaseController */ public function coinrecord_data_export() { -======= - $conditions = json_encode($map,TRUE); - $addtime = time(); - $type = "/Home/Promote/children/promote_type/".$promoteType; - $data = [ - 'logid' => 'promote_'.time(), - 'promote_id' => PID, - 'type' => $type, - '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('listsIndex')); - - } - - /** - * 平台币转移 - * @author sunke - */ - public function coinrecord_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $gameId = I('game_id', -1); $account = I('account', ''); $sn = I('sn', ''); @@ -1908,7 +1079,6 @@ class DownloadController extends BaseController $map = ['promote_id' => $loginPromote['id']]; if ($startTime != '' || $endTime != '') { if ($startTime != '') { -<<<<<<< HEAD $map['create_time'] = ['egt', strtotime($startTime . ' 00:00:00')]; } if ($endTime != '') { @@ -1959,60 +1129,6 @@ class DownloadController extends BaseController public function mycoinrecord_data_export() { $type = I('type', 0); -======= - $map['create_time'] = ['egt', strtotime($startTime. ' 00:00:00')]; - } - if ($endTime != '') { - $map['create_time'] = ['elt', strtotime($endTime. ' 23:59:59')]; - } - } - if($sn) { - $map['sn'] = $sn; - } - if($account) { - $map1['account'] = ['like','%'.$account.'%']; - $promotesRs = M('promote','tab_')->field('id')->where($map1)->select(); - $idArr = ""; - foreach ($promotesRs as $key => $value) { - $idArr .= intval($value['id']).','; - } - $idArr1 = rtrim($idArr,','); - $map['target_id'] = ['in',$idArr1]; - } - if($gameId !== -1) { - $map['game_id'] = $gameId; - } - $conditions = json_encode($map,TRUE); - $addtime = time(); - $type = "/Home/PromoteCoin/transferLogs"; - $data = [ - 'logid' => 'cr_'.time(), - 'promote_id' => PID, - 'type' => $type, - '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('listsIndex')); - - - } - - /** - * 我的平台币明细 - * @author sunke - */ - public function mycoinrecord_data_export() { - $type = I('type', 0); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $subType = I('sub_type', 0); $targetType = I('target_type', ''); $startTime = I('start_time', ''); @@ -2035,7 +1151,6 @@ class DownloadController extends BaseController $map['target_level'] = $targetTypeRow[1]; } } -<<<<<<< HEAD if ($startTime != '' || $endTime != '') { if ($startTime != '') { @@ -2097,77 +1212,11 @@ class DownloadController extends BaseController } $coin_type = I('coin_type'); if (!empty($coin_type)) { -======= - - if ($startTime != '' || $endTime != '') { - if ($startTime != '') { - $map['create_time'] = ['egt', strtotime($startTime. ' 00:00:00')]; - } - if ($endTime != '') { - $map['create_time'] = ['elt', strtotime($endTime. ' 23:59:59')]; - } - } - - - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'pt_'.time(), - 'promote_id' => PID, - 'type' => "/Home/PromoteCoin/coinRecord", - '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('listsIndex')); - - - } - /** - * 我的平台币 - * @author sunke - */ - public function mycoin_data_export() { - $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; - $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); - $childPromoteIds = ''; - if(empty($rs)) { - $map['promote_id'] = PID; - }else { - foreach ($rs as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id.','; - } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['promote_id'] = ['in', $childPromoteIds]; - } - // var_dump($map); - $game_id = I('game_id'); - if(!empty($game_id)) { - $map['game_id'] = $game_id; - } - $status = I("status"); - if(!empty($status)) { - $map['status'] = $status; - } - $coin_type = I('coin_type'); - if(!empty($coin_type)) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a switch ($coin_type) { case 1: $map['game_id'] = 0; break; case 2: -<<<<<<< HEAD $map['game_id'] = ["gt", 0]; break; } @@ -2214,54 +1263,6 @@ class DownloadController extends BaseController } $levelPromote = $this->getLevelPromote(); -======= - $map['game_id'] = ["gt",0]; - break; - } - } - - $conditions = json_encode($map,TRUE); - $addtime = time(); - $type = "/Home/PromoteCoin/myCoin"; - $data = [ - 'logid' => 'pt_'.time(), - 'promote_id' => PID, - 'type' => $type, - '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('listsIndex')); - } - - public function players_data_export() { - $begTime = I('begtime'); - $endTime = I('endtime'); - $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; - $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); - $childPromoteIds = ''; - if(empty($rs)) { - $map['tab_pay_info.promote_id'] = PID; - }else { - foreach ($rs as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id.','; - } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['tab_pay_info.promote_id'] = ['in', $childPromoteIds]; - } - - $levelPromote = $this->getLevelPromote(); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $queryPromote = $this->getQueryPromote($levelPromote); $map2[] = [ '_logic' => 'or', @@ -2269,7 +1270,6 @@ class DownloadController extends BaseController 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] ]; $ids = M('promote', 'tab_')->where($map2)->getField('id', true); -<<<<<<< HEAD if (empty($ids)) { $ids = array(); } @@ -2280,20 +1280,6 @@ class DownloadController extends BaseController if (!empty($ids)) { $map['tab_pay_info.promote_id'] = ['in', $ids]; } else { -======= - if(empty($ids)) { - $ids = array(); - } - if(empty($levelPromote)) { - array_push($ids,PID); - - } - array_push($ids,$queryPromote['id']); - if (!empty($ids)) { - $map['tab_pay_info.promote_id'] = ['in',$ids]; - - }else { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map['_string'] = '1<>1'; } @@ -2305,16 +1291,8 @@ class DownloadController extends BaseController if ($relation_game_id != 0) { $gameMap['relation_game_id'] = $relation_game_id; } -<<<<<<< HEAD $gameId1 = M('game', 'tab_')->where($gameMap)->getField('id', true); if (empty($gameId1)) { -======= - if ($sdkVersion != 0) { - $gameMap['sdk_version'] = $sdkVersion; - } - $gameId1 = M('game', 'tab_')->where($gameMap)->getField('id', true); - if(empty($gameId1)) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $gameId1 = [-100]; } $map['game_id'] = ['in', $gameId1]; @@ -2325,7 +1303,6 @@ class DownloadController extends BaseController empty(I('extend')) || $map['tab_pay_info.extend'] = I('extend'); empty(I('user_id')) || $map['tab_pay_info.game_player_id'] = I('user_id'); if (!empty($begTime) && !empty($endTime)) { -<<<<<<< HEAD $map['tab_pay_info.create_time'] = ['between', [strtotime($begTime), strtotime($endTime) + 24 * 3600 - 1]]; } else if (empty($begTime) && !empty($endTime)) { $map['tab_pay_info.create_time'] = ['elt', strtotime($endTime) + 24 * 3600]; @@ -2356,38 +1333,6 @@ class DownloadController extends BaseController public function promotelogs_data_export() { -======= - $map['tab_pay_info.create_time'] = ['between', [strtotime($begTime), strtotime($endTime) +24*3600- 1]]; - }else if (empty($begTime) && !empty($endTime)) { - $map['tab_pay_info.create_time'] = ['elt',strtotime($endTime) + 24*3600]; - }else if (!empty($begTime) && empty($endTime)) { - $map['tab_pay_info.create_time'] = ['EGT',strtotime($begTime) + 24*3600]; - } - - - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'players_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Players/playaction', - '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('listsIndex')); - } - - public function promotelogs_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $begTime = I('begtime'); $endTime = I('endtime'); // $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; @@ -2406,7 +1351,6 @@ class DownloadController extends BaseController // } $map['pid'] = PID; -<<<<<<< HEAD empty(I('user_account')) || $map['promote'] = ['like', '%' . I('user_account') . '%']; empty(I('action_type')) || $map['action_type'] = ['like', '%' . I('action_type') . '%']; if (!empty($begTime) && !empty($endTime)) { @@ -2443,44 +1387,6 @@ class DownloadController extends BaseController */ public function recharge_data_export() { -======= - empty(I('user_account')) || $map['promote'] = ['like', '%' . I('user_account') . '%']; - empty(I('action_type')) || $map['action_type'] = ['like', '%' . I('action_type') . '%']; - if (!empty($begTime) && !empty($endTime)) { - $map['create_time'] = ['between', [strtotime($begTime), strtotime($endTime) +24*3600- 1]]; - }else if (empty($begTime) && !empty($endTime)) { - $map['create_time'] = ['elt',strtotime($endTime) + 24*3600]; - }else if (!empty($begTime) && empty($endTime)) { - $map['create_time'] = ['EGT',strtotime($begTime) + 24*3600]; - } - - - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'promoteLogs_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Safe/promoteLogs', - '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('listsIndex')); - } - /** - * 充值明细添加下载 - * @author sunke - */ - public function recharge_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a // 支付到账时间 $payedBegTime = I("payed_begtime", ''); if ($payedBegTime) { @@ -2496,19 +1402,13 @@ class DownloadController extends BaseController if (($payedEndTime - $payedBegTime) > 31 * 24 * 3600) { $this->error('到账时间范围不能超过31天'); } -<<<<<<< HEAD // 下单时间 -======= - - // 下单时间 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $beginTime = strtotime(I('begtime') . ' 00:00:00'); $endtime = strtotime(I('endtime') . ' 23:59:59'); if (($endtime - $beginTime) > 31 * 24 * 3600) { $this->error('下单时间范围不能超过31天'); } -<<<<<<< HEAD $map1['chain'] = ['like', '%' . '/' . PID . '/' . '%']; $rs = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select(); $childPromoteIds = ''; @@ -2527,33 +1427,12 @@ class DownloadController extends BaseController $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); -======= - $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); - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map2[] = [ '_logic' => 'or', 'id' => $queryPromote['id'], 'chain' => ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'] ]; $ids = M('promote', 'tab_')->where($map2)->getField('id', true); -<<<<<<< HEAD if (empty($ids)) { $ids = array(); } @@ -2572,28 +1451,6 @@ class DownloadController extends BaseController } -======= - 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'];//本账号 - } - - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if (!empty(I('begtime')) && empty(I('endtime'))) { $map['tab_spend.spend_time'] = ['egt', strtotime(I('begtime'))]; @@ -2601,7 +1458,6 @@ class DownloadController extends BaseController $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]]; -<<<<<<< HEAD } else { // $nowTime = date('Y-m-d'); // $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); @@ -2615,21 +1471,6 @@ class DownloadController extends BaseController $map['tab_spend.payed_time'] = ['between', [$payedBegTime, $payedEndTime - 1]]; } -======= - }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]]; - } - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 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'); @@ -2646,7 +1487,6 @@ class DownloadController extends BaseController $map = $this->spendRepository->withIsCheck($map, 'tab_spend.is_check'); -<<<<<<< HEAD $conditions = json_encode($map, true); $addtime = time(); $data = [ @@ -2669,30 +1509,6 @@ class DownloadController extends BaseController public function userRecharge_data_export() { -======= - $conditions = json_encode($map, true); - $addtime = time(); - $data = [ - 'logid' => 'cz_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Query/recharge', - '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('listsIndex')); - } - - public function userRecharge_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $gameId = I('relation_game_id', 0); $serverId = I('server_id', 0); $isSelf = I('is_self', 0); @@ -2711,7 +1527,6 @@ class DownloadController extends BaseController $begTime = strtotime($initBegTime); $endTime = strtotime($initEndTime); $endTime += 3600 * 24; -<<<<<<< HEAD $map1['chain'] = ['like', '%' . '/' . PID . '/' . '%']; $rs = M('promote', 'tab_')->where($map1)->field('id,account,nickname')->select(); @@ -2730,37 +1545,13 @@ class DownloadController extends BaseController $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); -======= - - $map1['chain'] = ['like','%'.'/'.PID.'/'.'%']; - $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); - $childPromoteIds = ''; - if(empty($rs)) { - $map['promote_id'] = PID; - }else { - foreach ($rs as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id.','; - } - $childPromoteIds = rtrim($childPromoteIds, ','); - $childPromoteIds .= ',' . PID; - $map['promote_id'] = ['in', $childPromoteIds]; - } - $levelPromote = $this->getLevelPromote(); - $queryPromote = $this->getQueryPromote($levelPromote); - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map2['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%']; $ids = M('promote', 'tab_')->where($map2)->getField('id', true); $ids[] = $queryPromote['id']; $map = ['promote_id' => ['in', $ids]]; $subMap = ['promote_id' => ['in', $ids]]; -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($gameId != 0 || $sdkVersion != 0) { if ($gameId != 0) { $gameMap['relation_game_id'] = $gameId; @@ -2769,11 +1560,7 @@ class DownloadController extends BaseController $gameMap['sdk_version'] = $sdkVersion; } $gameId1 = M('game', 'tab_')->where($gameMap)->getField('id', true); -<<<<<<< HEAD if (empty($gameId1)) { -======= - if(empty($gameId1)) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $gameId1 = [-100]; } $map['game_id'] = ['in', $gameId1]; @@ -2792,11 +1579,7 @@ class DownloadController extends BaseController $map['sdk_version'] = $sdkVersion; } if ($isSelf) { -<<<<<<< HEAD $map['promote_id'] = $queryPromote['id']; //本账号 -======= - $map['promote_id'] = $queryPromote['id'];//本账号 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } else { if ($headmanPromoteId != 0) { $map['promote_id'] = $headmanPromoteId; @@ -2805,7 +1588,6 @@ class DownloadController extends BaseController $map['promote_id'] = $promoteId; } } -<<<<<<< HEAD if ($costBegin) { $map['costbegin'] = $costBegin; @@ -2815,22 +1597,10 @@ class DownloadController extends BaseController if ($costEnd) { $map['costend'] = $costEnd; } else { -======= - - if($costBegin) { - $map['costbegin'] = $costBegin; - }else { - $map['costbegin'] = ""; - } - if($costEnd) { - $map['costend'] = $costEnd; - }else { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map['costend'] = ""; } $map['begintime'] = $begTime; $map['endtime'] = $endTime; -<<<<<<< HEAD $conditions = json_encode($map, TRUE); $addtime = time(); $data = [ @@ -2855,32 +1625,6 @@ class DownloadController extends BaseController public function quotaDtl_data_export() { -======= - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'wj_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Query/userRecharges', - 'dataname' => '充值玩家数据', - 'status' => 0, - 'addtime' => $addtime, - 'begintime' => 0, - 'content' => '', - 'conditions' =>$conditions - ]; - $res = M('downloadlog','tab_')->add($data); - if (!$res) { - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); - - } - - /*推广员指标查看详情 */ - - public function quotaDtl_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $nowTime = date('Y-m-d', time()); $defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime; $time = I('time', $defaultTime); @@ -2923,7 +1667,6 @@ class DownloadController extends BaseController $map = '1 = 2'; } -<<<<<<< HEAD $conditions = json_encode($map, TRUE); $addtime = time(); $data1 = [ @@ -2947,31 +1690,6 @@ class DownloadController extends BaseController /*推广指标首页导出*/ public function promoteQuota_data_export() { -======= - // $data = M('user_play_info', 'tab_')->where($map)->order('create_time desc')->select(); - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data1 = [ - 'logid' => 'quotadtl_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Query/promoteQuota', - 'dataname' => '推广员详情', - 'status' => 0, - 'addtime' => $addtime, - 'begintime' => 0, - 'content' => '', - 'conditions' =>$conditions - ]; - $res = M('downloadlog','tab_')->add($data1); - if (!$res) { - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); - } - - /*推广指标首页导出*/ - public function promoteQuota_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $nowTime = date('Y-m-d', time()); $defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime; $time = I('time', $defaultTime); @@ -3023,17 +1741,10 @@ class DownloadController extends BaseController } $map = [ 'isContainSubs' => true, -<<<<<<< HEAD 'basicPromotes' => json_encode($basicPromotes, FALSE), ]; $map['promotes'] = json_encode($data, FALSE); $map['parentsinfo'] = json_encode($parent, FALSE);; -======= - 'basicPromotes' => json_encode($basicPromotes,FALSE), - ]; - $map['promotes'] = json_encode($data,FALSE); - $map['parentsinfo'] = json_encode($parent,FALSE);; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map['currentDisplay'] = $currentDisplay; $map['ids'] = $ids; if ($relationGameId != 0 || $sdkVersion != 0) { @@ -3066,7 +1777,6 @@ class DownloadController extends BaseController list($beginTime, $endTime) = $this->getBetweenTime($time); $map['begin_time'] = $beginTime; $map['end_time'] = $endTime; -<<<<<<< HEAD $conditions = json_encode($map, TRUE); $addtime = time(); $data1 = [ @@ -3089,31 +1799,6 @@ class DownloadController extends BaseController public function achievement_data_export() { -======= - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data1 = [ - 'logid' => 'quota_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Query/promoteQuota', - 'dataname' => '推广员指标', - 'status' => 0, - 'addtime' => $addtime, - 'begintime' => 0, - 'content' => '', - 'conditions' =>$conditions - ]; - $res = M('downloadlog','tab_')->add($data1); - if (!$res) { - // $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res)); - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); - - } - - public function achievement_data_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $time = I('time', date('Y-m-d')); $sdkVersion = I('sdk_version', 0); $gameId = I('relation_game_id', 0); @@ -3141,11 +1826,7 @@ class DownloadController extends BaseController $map['id'] = $promoteId; } $data = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level', 'chain'])->where($map)->select(); -<<<<<<< HEAD $ids = array_column($data, 'id'); -======= - $ids = array_column($data, 'id'); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $rows = []; if (count($ids) > 0) { $rows = M('promote', 'tab_') @@ -3166,17 +1847,10 @@ class DownloadController extends BaseController } $map = [ 'isContainSubs' => true, -<<<<<<< HEAD 'basicPromotes' => json_encode($basicPromotes, FALSE), ]; $map['promotes'] = json_encode($data, FALSE); $map['parentsinfo'] = json_encode($parent, FALSE);; -======= - 'basicPromotes' => json_encode($basicPromotes,FALSE), - ]; - $map['promotes'] = json_encode($data,FALSE); - $map['parentsinfo'] = json_encode($parent,FALSE);; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map['currentDisplay'] = $currentDisplay; $map['ids'] = $ids; if ($gameId != 0 || $sdkVersion != 0) { @@ -3187,11 +1861,7 @@ class DownloadController extends BaseController $gameMap['sdk_version'] = $sdkVersion; } $gameId1 = M('game', 'tab_')->where($gameMap)->getField('id', true); -<<<<<<< HEAD if (empty($gameId1)) { -======= - if(empty($gameId1)) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $gameId1 = [-100]; } $map['game_id'] = ['in', $gameId1]; @@ -3208,7 +1878,6 @@ class DownloadController extends BaseController list($beginTime, $endTime) = $this->getBetweenTime($time); $map['begin_time'] = $beginTime; $map['end_time'] = $endTime; -<<<<<<< HEAD $conditions = json_encode($map, TRUE); $addtime = time(); $data1 = [ @@ -3231,32 +1900,6 @@ class DownloadController extends BaseController public function promote_grade_export() { -======= - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data1 = [ - 'logid' => 'tg_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Query/achievement', - 'dataname' => '推广员业绩', - 'status' => 0, - 'addtime' => $addtime, - 'begintime' => 0, - 'content' => '', - 'conditions' =>$conditions - ]; - $res = M('downloadlog','tab_')->add($data1); - if (!$res) { - // $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res)); - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); - - } - - public function promote_grade_export() - { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $month = I('month', date('Y-m')); $month = $month ? $month : date('Y-m'); $baseGameId = I('base_game_id', 0); @@ -3274,29 +1917,14 @@ class DownloadController extends BaseController $parentId = I('parent_id', 0); $promoteId = I('promote_id', 0); -<<<<<<< HEAD -======= - $searchLevel = 0; - $searchLevelName = ''; - $currentDisplay = ''; - $prevParentId = 0; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $promoteService = new PromoteService(); $parent = null; if ($parentId > 0) { $parent = M('promote', 'tab_')->where(['id' => $parentId])->find(); -<<<<<<< HEAD } else { $parent = $loginPromote; -======= - $currentDisplay = $promoteService->getLevelName($parent['level']) . '推广'; - $prevParentId = $parent['parent_id'] == $loginPromote['parent_id'] ? 0 : $parent['parent_id']; - } else { - $parent = $loginPromote; - $currentDisplay = '自己'; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } // $subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'group_remark'])->where(['parent_id' => $parent['id']])->select(); @@ -3312,11 +1940,7 @@ class DownloadController extends BaseController $conditions = json_encode(['promotes' => $promotes, 'setting' => $setting, 'month' => $month, 'base_game_id' => $baseGameId], true); $addtime = time(); $data1 = [ -<<<<<<< HEAD 'logid' => 'pg_' . time(), -======= - 'logid' => 'pg_'.time(), ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'promote_id' => PID, 'type' => '/Home/PromoteGrade/index', 'dataname' => '团队评级', @@ -3326,7 +1950,6 @@ class DownloadController extends BaseController 'content' => '', 'conditions' => $conditions ]; -<<<<<<< HEAD $res = M('downloadlog', 'tab_')->add($data1); if (!$res) { $this->error('添加下载失败'); @@ -3336,17 +1959,6 @@ class DownloadController extends BaseController //玩家角色 public function userRoles_data_export() { -======= - $res = M('downloadlog','tab_')->add($data1); - if (!$res) { - $this->error('添加下载失败'); - } - $this->success('添加下载成功', U('listsIndex')); - } - //玩家角色 - public function userRoles_data_export() - { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $relationGameId = I('relation_game_id', 0); $serverId = I('server_id', 0); $isSelf = I('is_self', 0); @@ -3358,11 +1970,7 @@ class DownloadController extends BaseController $roleLevelBegin = intval(I('role_level_begin', 0)); $roleLevelEnd = intval(I('role_level_end', 0)); $headmanPromoteId = I('headman_promote_id', 0); -<<<<<<< HEAD $createTime = I('create_time', date('Y-m-d') . ' 至 ' . date('Y-m-d', time() - 7 * 24 * 3600)); -======= - $createTime = I('create_time', date('Y-m-d') . ' 至 ' . date('Y-m-d', time()-7*24*3600)); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $lastSortName = trim(I('last_sort_name', '')); $sortName = trim(I('sort_name', '')); $sort = intval(I('sort', 1)); @@ -3414,13 +2022,8 @@ class DownloadController extends BaseController $createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00'); $createTimeEnd = strtotime($createTimeRow[0] . ' 23:59:59'); } -<<<<<<< HEAD if (($createTimeEnd - $createTimeBegin) > 31 * 24 * 3600) { $this->error('时间范围不能超过31天'); -======= - if (($createTimeEnd - $createTimeBegin) > 7*24*3600) { - $this->error('时间范围不能超过7天'); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $map['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]]; } @@ -3443,7 +2046,6 @@ class DownloadController extends BaseController $orderBy = $sortName . $sortString; } } -<<<<<<< HEAD $conditions = json_encode(['map' => $map, 'order' => $orderBy], true); @@ -3472,37 +2074,6 @@ class DownloadController extends BaseController $baseGameId = I('game_id', 0); $deviceType = I('device_type', ''); $timeRange = I('time_range', date('Y-m-d', strtotime('-7 day')) . ' 至 ' . date('Y-m-d')); -======= - - - $conditions = json_encode(['map' => $map, 'order' => $orderBy], true); - $addtime = time(); - $data = [ - 'logid' => 'js_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Query/userRoles', - 'dataname' => '角色查询数据', - 'status' => 0, - 'addtime' => $addtime, - 'begintime' => 0, - 'content' => '', - 'conditions' => $conditions - ]; - $res = M('downloadlog','tab_')->add($data); - if (!$res) { - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); - } - - - public function userretention_data_export() - { - $baseGameId = I('game_id', 0); - $deviceType = I('device_type', ''); - $timeRange = I('time_range', date('Y-m-d',strtotime('-7 day')) . ' 至 ' . date('Y-m-d')); - $lastSortName = trim(I('last_sort_name', '')); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $sortName = trim(I('sort_name', '')); $sort = intval(I('sort', 1)); @@ -3527,11 +2098,7 @@ class DownloadController extends BaseController $orderColumn = $sortName; $orderType = ($sort == 1) ? 'desc' : 'asc'; } -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $status = true; $data = false; $error = ''; @@ -3541,11 +2108,7 @@ class DownloadController extends BaseController } $startTime = strtotime($start . ' 00:00:00'); $endTime = strtotime($end . ' 23:59:59') + 1; -<<<<<<< HEAD if ((($endTime - $startTime) / (24 * 3600)) > 31) { -======= - if ((($endTime - $startTime)/(24*3600)) > 31) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $error = '时间间隔不能超过31天'; $status = false; } @@ -3553,13 +2116,8 @@ class DownloadController extends BaseController if (!$status) { $this->error($error); } -<<<<<<< HEAD -======= - - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $conditions = json_encode([ 'base_game_id' => $baseGameId, 'start' => $start, @@ -3572,7 +2130,6 @@ class DownloadController extends BaseController $addtime = time(); $data = [ -<<<<<<< HEAD 'logid' => 'ur_' . time(), 'promote_id' => PID, 'type' => '/Home/Query/userretention', @@ -3588,34 +2145,13 @@ class DownloadController extends BaseController $this->error('添加下载失败'); } $this->success('添加下载成功', U('listsIndex')); -======= - 'logid' => 'ur_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Query/userretention', - 'dataname' => '用户留存率', - 'status' => 0, - 'addtime' => $addtime, - 'begintime' => 0, - 'content' => '', - 'conditions' => $conditions - ]; - $res = M('downloadlog','tab_')->add($data); - if (!$res) { - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } public function gameData_data_export() { $gameId = I('game_id', 0); $serverId = I('server_id', ''); -<<<<<<< HEAD $timeRange = I('time_range', date('Y-m-d', strtotime('-7 day')) . ' 至 ' . date('Y-m-d')); -======= - $timeRange = I('time_range', date('Y-m-d',strtotime('-7 day')) . ' 至 ' . date('Y-m-d')); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $lastSortName = trim(I('last_sort_name', '')); $sortName = trim(I('sort_name', '')); $sort = intval(I('sort', 1)); @@ -3634,11 +2170,7 @@ class DownloadController extends BaseController $start = $timeRangeRow[0]; $end = $timeRangeRow[0]; } -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $spendMap = ['pay_status' => 1, '_string' => '1=1']; $roleMap = ['_string' => '1=1']; $map = []; @@ -3646,11 +2178,7 @@ class DownloadController extends BaseController $betweenTime = [strtotime($start . ' 00:00:00'), strtotime($end . ' 23:59:59')]; $spendMap['pay_time'] = ['between', $betweenTime]; $roleMap['create_time'] = ['between', $betweenTime]; -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $promoteService = new PromoteService(); $subInSql = $promoteService->subInSql($queryPromote); @@ -3687,17 +2215,10 @@ class DownloadController extends BaseController } $spendMap = $this->spendRepository->withIsCheck($spendMap); -<<<<<<< HEAD $spendSubSql = M('spend', 'tab_')->field(['game_id', 'server_id', 'sum(pay_amount) amount'])->where($spendMap)->group('game_id, server_id')->select(false); $roleSubSql = M('user_play_info', 'tab_')->field(['game_id', 'server_id', 'count(*) count'])->where($roleMap)->group('game_id, server_id')->select(false); -======= - - $spendSubSql = M('spend', 'tab_')->field(['game_id', 'server_id', 'sum(pay_amount) amount'])->where($spendMap)->group('game_id, server_id')->select(false); - $roleSubSql = M('user_play_info', 'tab_')->field(['game_id', 'server_id', 'count(*) count'])->where($roleMap)->group('game_id, server_id')->select(false); - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $conditions = json_encode([ 'spendSubSql' => $spendSubSql, 'roleSubSql' => $roleSubSql, @@ -3707,7 +2228,6 @@ class DownloadController extends BaseController $addtime = time(); $data = [ -<<<<<<< HEAD 'logid' => 'gd_' . time(), 'promote_id' => PID, 'type' => '/Home/Query/gameData', @@ -3732,32 +2252,6 @@ class DownloadController extends BaseController public function summary_data_export() { $ownId = intval(I('own_id'), 0); //本账号 -======= - 'logid' => 'gd_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Query/gameData', - 'dataname' => '游戏分区数据汇总', - 'status' => 0, - 'addtime' => $addtime, - 'begintime' => 0, - 'content' => '', - 'conditions' => $conditions - ]; - $res = M('downloadlog','tab_')->add($data); - if (!$res) { - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); - } - - /** - * 数据汇总添加下载 - * @author sunke - */ - public function summary_data_export() - { - $ownId = intval(I('own_id'), 0);//本账号 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $relationGameId = intval(I('relation_game_id', 0)); $sdkVersion = intval(I('sdk_version', 0)); $serverId = I('server_id', ''); @@ -3771,11 +2265,7 @@ class DownloadController extends BaseController $endTime += 3600 * 24; $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $loginPromote = $this->getLoginPromote(); $params = []; @@ -3805,11 +2295,7 @@ class DownloadController extends BaseController $conditions = json_encode(['map' => $map, 'params' => $params], true); $addtime = time(); $data = [ -<<<<<<< HEAD 'logid' => 'hz_' . time(), -======= - 'logid' => 'hz_'.time(), ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'promote_id' => PID, 'type' => '/Home/Query/summary', 'dataname' => '数据汇总数据', @@ -3817,7 +2303,6 @@ class DownloadController extends BaseController 'addtime' => $addtime, 'begintime' => 0, 'content' => '', -<<<<<<< HEAD 'conditions' => $conditions ]; $res = M('downloadlog', 'tab_')->add($data); @@ -3872,78 +2357,15 @@ class DownloadController extends BaseController break; case "我的平台币": $this->mycoinExcelInfo($id, $map); -======= - 'conditions' =>$conditions - ]; - $res = M('downloadlog','tab_')->add($data); - if (!$res) { - // $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res)); - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); - } - - /* - * 开始导出数据 - */ - public function export() { //开始导出 - $id = $_REQUEST['lid']; - $downloadStatus = M('downloadlog','tab_')->where(['id'=>$id])->field('dataname,status,conditions')->select(); - if($downloadStatus[0]['status'] == 1) { - $this->error("该数据已下载请重新添加",U('listsIndex')); - } - $dataname = $downloadStatus[0]['dataname']; - $conditions = $downloadStatus[0]['conditions']; - $map = array(); - foreach (json_decode($conditions, FALSE) as $key => $value) { - if($value !== 0 && $value !== "" ) { - $map[$key] = $value; - } - } - switch ($dataname) { - case "注册明细数据": - $this->registerExcelInfo($id,$map); //注册明细 - break; - case "角色查询数据": - $this->userRolesExcelInfo($id,$map); //角色查询 - break; - case "数据汇总数据": - $this->summaryExcelInfo($id,$map); - break; - case "充值明细数据": - $this->rechargeExcelInfo($id,$map); - break; - case "充值玩家数据": - $this->userRechargeExcelInfo($id,$map); - break; - case "推广员业绩": - $this->achievementExcelInfo($id,$map); - break; - case "团队评级": - $this->promoteGradeExcelInfo($id,$map); - break; - case "渠道管理": - $this->childrenExcelInfo($id,$map); - break; - case "我的平台币": - $this->mycoinExcelInfo($id,$map); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a break; case "我的平台币明细"; $this->mycoinRecordExcelInfo($id, $map); break; case "平台币转移": -<<<<<<< HEAD $this->coinrecordExcelInfo($id, $map); break; case "申请测试资源": $this->testresourceExcelInfo($id, $map); -======= - $this->coinrecordExcelInfo($id,$map); - break; - case "申请测试资源": - $this->testresourceExcelInfo($id,$map); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a break; case "申请测试资源记录": $this->testresourcelistExcelInfo($id, $map); @@ -3952,7 +2374,6 @@ class DownloadController extends BaseController $this->supportNumberListExcelInfo($id, $map); break; case "ARPU统计": -<<<<<<< HEAD $this->arpuExcelInfo($id, $map); break; case "每日概况": @@ -4005,77 +2426,15 @@ class DownloadController extends BaseController break; case "游戏分区数据汇总": $this->gameDataExcelInfo($id, $map); -======= - $this->arpuExcelInfo($id,$map); - break; - case "每日概况": - $this->dailysummaryExcelInfo($id,$map); - break; - case "结算中心": - $this->financeindexExcelInfo($id,$map); - break; - case "结算明细": - $this->settlementExcelInfo($id,$map); - break; - case "提现记录": - $this->withdrawRecordExcelInfo($id,$map); - break; - case "提现明细": - $this->withdrawDtlExcelInfo($id,$map); - break; - case "汇款证明": - $this->remitCerDownLoad($id,$map); - break; - case "平台币充值": - $this->orderlistExcelInfo($id,$map); - break; - case "玩家行为日志": - $this->playactionExcelInfo($id,$map); - break; - case "推广员指标": - $this->promotequotaExcelInfo($id,$map); - break; - case "推广员详情": - $this->promotequotaDtlExcelInfo($id,$map); - break; - case "推广员操作日志": - $this->promotelogsExcelInfo($id,$map); - break; - case "IOS下载统计": - $this->iosDataExcelInfo($id,$map); - break; - case "IOS玩家详情下载统计": - $this->iosDetailExcelInfo($id,$map); - break; - case "汇总单信息": - $this->WithdrawIndexExcelInfo($id,$map); - break; - case "结算单明细": - $this->WithdrawOrderExcelInfo($id,$map); - break; - case "用户留存率": - $this->userretentionExcelInfo($id,$map); - break; - case "游戏分区数据汇总": - $this->gameDataExcelInfo($id,$map); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a break; default: break; } -<<<<<<< HEAD } public function iosDetailExcelInfo($id, $map) { $xlsName = "IOS详情下载数统计"; -======= - - } - -public function iosDetailExcelInfo($id,$map) { - $xlsName ="IOS详情下载数统计"; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $xlsCell = array( '玩家账号', '类型', @@ -4084,11 +2443,7 @@ public function iosDetailExcelInfo($id,$map) { '所属会长', '所属部门长', '所属组长' -<<<<<<< HEAD ); -======= - ); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if (!empty($map['user_id'])) { $map1['user_id'] = $map['user_id']; @@ -4101,10 +2456,6 @@ public function iosDetailExcelInfo($id,$map) { $tfMap['create_time'] = $map['create_time']; $superMap['create_time'] = $map['create_time']; $companyMap['create_time'] = $map['create_time']; -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $belongs_president = ''; $belongs_department = ''; @@ -4125,17 +2476,12 @@ public function iosDetailExcelInfo($id,$map) { $rs = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where($map1)->select(); $tfMap['promote_id'] = $promote_id; -<<<<<<< HEAD $tfMap['type'] = 2; -======= - $tfMap['type'] = 2; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $TFCounts = M('package_download_log', 'tab_')->where($tfMap)->count(); $superMap['promote_id'] = $promote_id; $superMap['type'] = 3; $superCounts = M('package_download_log', 'tab_')->where($superMap)->count(); -<<<<<<< HEAD $companyMap['promote_id'] = $promote_id; $companyMap['type'] = 1; @@ -4157,36 +2503,12 @@ public function iosDetailExcelInfo($id,$map) { $data = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where($map1) ->limit(($i - 1) * $perSize, $perSize)->select(); foreach ($data as $key => $value) { -======= - - $companyMap['promote_id'] = $promote_id; - $companyMap['type'] = 1; - $companyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); - $csvFileName = $xlsName.'.csv'; - header('Content-Description: File Transfer'); - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - $fp = fopen('php://output', 'a');//打开output流 - mb_convert_variables('gb2312', 'UTF-8', $xlsCell); - fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = count($rs)?:0 ; - $perSize = 5000;//每次查询的条数 - $pages = ceil($accessNum / $perSize); - for($i = 1; $i <= $pages; $i++) { - $data = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where($map1) - ->limit(($i-1)*$perSize ,$perSize)->select(); - foreach($data as $key => $value) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $user_id = $value['user_id']; $usersAccount = M('user', 'tab_')->where(['id' => $user_id])->getField('account'); $csvData['account'] = $usersAccount; if ($value['type'] == 1) { $csvData['typename'] = "企业签下载"; } -<<<<<<< HEAD if ($value['type'] == 2) { $csvData['typename'] = "TF下载"; } @@ -4194,16 +2516,6 @@ public function iosDetailExcelInfo($id,$map) { $csvData['typename'] = "超级签下载"; } $promoteInfo = M('promote', 'tab_')->field('account')->where(['id' => $promote_id])->find(); -======= - if($value['type'] == 2) { - $csvData['typename'] = "TF下载"; - } - if($value['type'] == 3) { - $csvData['typename'] = "超级签下载"; - } - $csvData['create_time'] = date('Y-m-d H:i:s', $package['create_time']); - $promoteInfo = M('promote', 'tab_')->field('account')->where(['id'=>$promote_id])->find(); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $csvData['promote_account'] = $promoteInfo['account']; $csvData['belongs_president'] = $belongs_president; $csvData['belongs_department'] = $belongs_department; @@ -4212,43 +2524,25 @@ public function iosDetailExcelInfo($id,$map) { mb_convert_variables('GBK', 'UTF-8', $csvData); fputcsv($fp, $csvData); $xlsData[] = $csvData; -<<<<<<< HEAD } -======= - } ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a unset($xlsData); ob_flush(); flush(); } $allData['account'] = '汇总'; -<<<<<<< HEAD $allData['typename'] = "TF下载次数:" . $TFCounts; $allData['create_time'] = "超级签下载次数:" . $superCounts; $allData['promote_account'] = "企业签下载次数:" . $companyCounts; -======= - $allData['typename'] = "TF下载次数:".$TFCounts; - $allData['create_time'] = "超级签下载次数:".$superCounts; - $allData['promote_account'] = "企业签下载次数:".$companyCounts; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a mb_convert_variables('GBK', 'UTF-8', $allData); fputcsv($fp, $allData); $xlsData[] = $allData; fclose($fp); -<<<<<<< HEAD $this->backSuccessExport($id); } public function iosDataExcelInfo($tid, $map) { $xlsName = "IOS下载数统计"; -======= - $this->backSuccessExport($id); - } - - public function iosDataExcelInfo($tid,$map) { - $xlsName ="IOS下载数统计"; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $xlsCell = array( '推广员账号', 'IOS用户总数', @@ -4266,22 +2560,14 @@ public function iosDetailExcelInfo($id,$map) { $map1['chain'] = $map['chain']; } if (!empty($map['create_time'])) { -<<<<<<< HEAD // $map1['create_time'] = $map['create_time']; -======= - // $map1['create_time'] = $map['create_time']; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $tfMap['create_time'] = $map['create_time']; $companyMap['create_time'] = $map['create_time']; $superMap['create_time'] = $map['create_time']; $allTFMap['create_time'] = $map['create_time']; $companyMap['create_time'] = $map['create_time']; $allSuperMap['create_time'] = $map['create_time']; -<<<<<<< HEAD // $iosTimeMap['register_time'] = $map['create_time']; -======= - // $iosTimeMap['register_time'] = $map['create_time']; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map10['register_time'] = $map['create_time']; $alliosMap['register_time'] = $map['create_time']; $allUserMap['register_time'] = $map['create_time']; @@ -4307,7 +2593,6 @@ public function iosDetailExcelInfo($id,$map) { array_push($allids, PID); $allUserMap['promote_id'] = ['in', $allids]; $allUserMap['device_type'] = 2; -<<<<<<< HEAD $allTFMap['promote_id'] = ['in', $allids]; $allTFMap['type'] = 2; @@ -4317,24 +2602,12 @@ public function iosDetailExcelInfo($id,$map) { $companyMap['promote_id'] = ['in', $allids]; $companyMap['type'] = 1; -======= - $allTFMap['promote_id'] = ['in', $allids]; - $allTFMap['type'] = 2; - - $allSuperMap['promote_id'] = ['in', $allids]; - $allSuperMap['type'] = 3; - - $companyMap['promote_id'] = ['in', $allids]; - $companyMap['type'] = 1; - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $allUsersCounts = M('user', 'tab_')->where($allUserMap)->count(); $allTFCounts = M('package_download_log', 'tab_')->where($allTFMap)->count(); $allSuperCounts = M('package_download_log', 'tab_')->where($allSuperMap)->count(); $allCompanyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); $alliosMap['promote_id'] = ['in', $allids]; $alliosMap['device_type'] = 2; -<<<<<<< HEAD $allIosCounts = M('user', 'tab_')->where($alliosMap)->count(); $csvFileName = $xlsName . '.csv'; @@ -4349,27 +2622,10 @@ public function iosDetailExcelInfo($id,$map) { fputcsv($fp, $xlsCell); //将数据格式化为CSV格式并写入到output流中 $accessNum = count($rs) ?: 0; $perSize = 5000; //每次查询的条数 -======= - - $allIosCounts = M('user', 'tab_')->where($alliosMap)->count(); - $csvFileName = $xlsName.'.csv'; - header('Content-Description: File Transfer'); - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - $fp = fopen('php://output', 'a');//打开output流 - mb_convert_variables('gb2312', 'UTF-8', $xlsCell); - fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = count($rs)?:0 ; - $perSize = 5000;//每次查询的条数 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $pages = ceil($accessNum / $perSize); if ($pages == 0) { $pages = 1; } -<<<<<<< HEAD for ($i = 1; $i <= $pages; $i++) { $data = M('promote', 'tab_')->field(['id'])->where($map1) ->limit(($i - 1) * $perSize, $perSize)->select(); @@ -4381,25 +2637,10 @@ public function iosDetailExcelInfo($id,$map) { if ($i == 1) { if (!empty($map['localId']) && !in_array($map['localId'], $ids)) { array_unshift($ids, $map['localId']); -======= - for($i = 1; $i <= $pages; $i++) { - $data = M('promote', 'tab_')->field(['id'])->where($map1) - ->limit(($i-1)*$perSize ,$perSize)->select(); - $ids = array_column($data, 'id'); - - if (in_array($map['localId'], $ids)) { - }else { - - } - if ($i == 1) { - if (!empty($map['localId']) && !in_array($map['localId'], $ids)) { - array_unshift($ids,$map['localId'] ); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } if (!in_array(PID, $ids)) { array_unshift($ids, PID); } -<<<<<<< HEAD } foreach ($ids as $key => $id) { $promote1 = M('promote', 'tab_')->field('account, level, parent_id, chain')->where(['id' => $id])->select(); @@ -4408,18 +2649,6 @@ public function iosDetailExcelInfo($id,$map) { if ($id == PID) { $csvData['account'] = $promote['account'] . '[自己]'; } else { -======= - - - } - foreach($ids as $key => $id) { - $promote1 = M('promote', 'tab_')->field('account, level, parent_id, chain')->where(['id' => $id])->select(); - $promote = $promote1[0]; - $chain = $promote['chain']; - if($id == PID) { - $csvData['account'] = $promote['account'].'[自己]'; - }else { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $csvData['account'] = $promote['account']; } $iosTimeMap['promote_id'] = $id; @@ -4437,7 +2666,6 @@ public function iosDetailExcelInfo($id,$map) { $map10['promote_id'] = $id; $map10['device_type'] = 2; $usersCounts = M('user', 'tab_')->where($map10)->count(); -<<<<<<< HEAD $tfpercent = number_format((intval($tfCounts) / intval($usersCounts)), 2, '.', '') * 100; if (intval($usersCounts) == 0) { @@ -4450,36 +2678,17 @@ public function iosDetailExcelInfo($id,$map) { $csvData['companycounts'] = intval($companyCounts); if ($promote['level'] == 1) { -======= - $tfpercent = number_format((intval($tfCounts) / intval($usersCounts)),2,'.','') * 100; - - if (intval($usersCounts) == 0) { - $tfpercent = 0; - } - $csvData['userscounts'] = intval($usersCounts); - $csvData['ioscount'] = $iosCount; - $csvData['tfcounts'] = intval($tfCounts).'('.$tfpercent.'%)'; - $csvData['supercounts'] = intval($superCounts); - $csvData['companycounts'] = intval($companyCounts); - - if($promote['level'] == 1) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $csvData['belongs_president'] = $promote['account']; $csvData['belongs_department'] = "无所属部门长"; $csvData['belongs_group'] = "无所属组长"; } if ($promote['level'] == 2) { -<<<<<<< HEAD $parentPromote = M('promote', 'tab_')->field('account')->where(['id' => $promote['parent_id']])->select(); -======= - $parentPromote = M('promote', 'tab_')->field('account')->where(['id'=>$promote['parent_id']])->select(); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $csvData['belongs_president'] = $parentPromote[0]['account']; $csvData['belongs_department'] = $promote['account']; $csvData['belongs_group'] = "无所属组长"; } if ($promote['level'] == 3) { -<<<<<<< HEAD $chainArr = explode('/', $chain); $presidentAccount = M('promote', 'tab_')->where(['id' => $chainArr[1]])->getField('account'); $departmentAccount = M('promote', 'tab_')->where(['id' => $chainArr[2]])->getField('account'); @@ -4496,48 +2705,19 @@ public function iosDetailExcelInfo($id,$map) { $csvData['belongs_president'] = $presidentAccount; $csvData['belongs_department'] = $departmentAccount; $csvData['belongs_group'] = $groupAccount; -======= - $chainArr = explode('/', $chain); - $presidentAccount = M('promote', 'tab_')->where(['id' => $chainArr[1]])->getField('account'); - $departmentAccount = M('promote', 'tab_')->where(['id' => $chainArr[2]])->getField('account'); - $csvData['belongs_president'] = $presidentAccount; - $csvData['belongs_department'] = $departmentAccount; - $csvData['belongs_group'] = $promote['account']; - } - - if ($promote['level'] == 4) { - $chainArr = explode('/', $chain); - $presidentAccount = M('promote', 'tab_')->where(['id' => $chainArr[1]])->getField('account'); - $departmentAccount = M('promote', 'tab_')->where(['id' => $chainArr[2]])->getField('account'); - $groupAccount = M('promote', 'tab_')->where(['id' => $chainArr[3]])->getField('account'); - $csvData['belongs_president'] = $presidentAccount; - $csvData['belongs_department'] = $departmentAccount; - $csvData['belongs_group'] = $groupAccount; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } mb_convert_variables('GBK', 'UTF-8', $csvData); fputcsv($fp, $csvData); $xlsData[] = $csvData; -<<<<<<< HEAD } unset($xlsData); ob_flush(); flush(); -======= - } - unset($xlsData); - ob_flush(); - flush(); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $allData['account'] = '汇总'; $allData['userscounts'] = $allUsersCounts; $allData['iosycounts'] = $allIosCounts; -<<<<<<< HEAD $allData['tfcounts'] = $allTFCounts . '(' . (number_format((intval($allTFCounts) / intval($allUsersCounts)), 2, '.', '') * 100) . '%)'; -======= - $allData['tfcounts'] = $allTFCounts.'('.(number_format((intval($allTFCounts) / intval($allUsersCounts)),2,'.','') * 100).'%)'; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $allData['supercounts'] = $allSuperCounts; $allData['companycounts'] = $allCompanyCounts; @@ -4548,18 +2728,11 @@ public function iosDetailExcelInfo($id,$map) { fputcsv($fp, $allData); $xlsData[] = $allData; fclose($fp); -<<<<<<< HEAD $this->backSuccessExport($tid); } public function promotelogsExcelInfo($id, $map) { -======= - $this->backSuccessExport($tid); - } - - public function promotelogsExcelInfo($id,$map) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $xlsName = "推广员操作日志"; $xlsCell = array( '位置', @@ -4567,7 +2740,6 @@ public function iosDetailExcelInfo($id,$map) { '操作人', '时间', 'ip地址', -<<<<<<< HEAD ); $pid = $map['pid']; unset($map['pid']); @@ -4580,27 +2752,12 @@ public function iosDetailExcelInfo($id,$map) { foreach ($rs as $rsKey => $rsValue) { $id = $rsValue['id']; $childPromoteIds .= $id . ','; -======= - ); - $pid = $map['pid']; - unset($map['pid']); - $map1['chain'] = ['like','%'.'/'.$pid.'/'.'%']; - $rs = M('promote','tab_')->where($map1)->field('id,account,nickname')->select(); - $childPromoteIds = ''; - if(empty($rs)) { - $map['promote_id'] = $pid; - }else { - foreach ($rs as $rsKey => $rsValue) { - $id = $rsValue['id']; - $childPromoteIds .= $id.','; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $childPromoteIds = rtrim($childPromoteIds, ','); $childPromoteIds .= ',' . $pid; $map['promote_id'] = ['in', $childPromoteIds]; } $records = M('promote_action_logs', 'tab_')->where($map)->order('create_time')->select(); -<<<<<<< HEAD $csvFileName = $xlsName . '.csv'; header('Content-Description: File Transfer'); header('Content-Type: application/vnd.ms-excel'); @@ -4625,45 +2782,10 @@ public function iosDetailExcelInfo($id,$map) { $csvData['ip'] = $dataValue['ip']; mb_convert_variables('GBK', 'UTF-8', $csvData); fputcsv($fp, $csvData); -======= - $csvFileName = $xlsName.'.csv'; - header('Content-Description: File Transfer'); - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - $fp = fopen('php://output', 'a');//打开output流 - mb_convert_variables('gb2312', 'UTF-8', $xlsCell); - fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = count($records)?:0 ; - $perSize = 5000;//每次查询的条数 - $pages = ceil($accessNum / $perSize); - for($i = 1; $i <= $pages; $i++) { - $data = M('promote_action_logs', 'tab_')->where($map)->order('create_time') - ->limit(($i-1)*$perSize ,$perSize)->select(); - foreach($data as $dataKey => $dataValue) { - $orderLen = strlen($dataValue['promote']); - $strLen = 3; - $hideChar = ''; - - if ($orderLen <= 8) { $strLen = 2;} - for ($i = 0; $i < $orderLen - $strLen * 2; $i++) { - $hideChar .= '*'; - } - $csvData['module'] = $dataValue['module']; - $csvData['action_type'] = $dataValue['action_type']; - $csvData['user_account'] = substr($dataValue['promote'], 0, $strLen) . $hideChar . substr($dataValue['promote'], $orderLen - $strLen); - $csvData['create_time'] = date("Y-m-d H:i:s",$dataValue['create_time']); - $csvData['ip'] = $dataValue['ip']; - mb_convert_variables('GBK', 'UTF-8', $csvData); - fputcsv($fp, $csvData); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } unset($csvData); ob_flush(); flush(); -<<<<<<< HEAD } fclose($fp); $this->backSuccessExport($id); @@ -4671,14 +2793,6 @@ public function iosDetailExcelInfo($id,$map) { public function promotequotaDtlExcelInfo($id, $map) { -======= - } - fclose($fp); - $this->backSuccessExport($id); - } - - public function promotequotaDtlExcelInfo($id,$map) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $xlsName = "推广员详情"; $xlsCell = array( '玩家账号', @@ -4689,7 +2803,6 @@ public function iosDetailExcelInfo($id,$map) { '角色名', '等级', '创建时间', -<<<<<<< HEAD ); recordPromoteLogs('数据管理', '推广员详情导出'); $records = M('user_play_info', 'tab_')->where($map)->order('create_time desc')->select(); @@ -4721,52 +2834,11 @@ public function iosDetailExcelInfo($id,$map) { $csvData['sdk_version'] = "安卓版"; } if ($dataValue['sdk_version'] == 2) { -======= - ); - $records = recordPromoteLogs('数据管理','推广员详情导出'); - $records = M('user_play_info', 'tab_')->where($map)->order('create_time desc')->select(); - $csvFileName = $xlsName.'.csv'; - //设置好告诉浏览器要下载excel文件的headers - header('Content-Description: File Transfer'); - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - $fp = fopen('php://output', 'a');//打开output流 - mb_convert_variables('gb2312', 'UTF-8', $xlsCell); - fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = '100000';//从数据库获取总量,假设是十万 - $accessNum = count($records)?:0 ; - - $perSize = 5000;//每次查询的条数 - $pages = ceil($accessNum / $perSize); - for($i = 1; $i <= $pages; $i++) { - $data = M('user_play_info','tab_')->where($map)->order('create_time desc') - ->limit(($i-1)*$perSize ,$perSize)->select(); - foreach($data as $dataKey => $dataValue) { - $orderLen = strlen($dataValue['user_account']); - $strLen = 3; - $hideChar = ''; - - if ($orderLen <= 8) { $strLen = 2;} - for ($i = 0; $i < $orderLen - $strLen * 2; $i++) { - $hideChar .= '*'; - } - $csvData['user_account'] = substr($dataValue['user_account'], 0, $strLen) . $hideChar . substr($dataValue['user_account'], $orderLen - $strLen); - $csvData['promote_account'] = $dataValue['promote_account']; - $csvData['game_name'] = $dataValue['game_name']; - if($dataValue['sdk_version'] == 1) { - $csvData['sdk_version'] = "安卓版"; - } - if($dataValue['sdk_version'] == 2) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $csvData['sdk_version'] = "苹果版"; } $csvData['server_name'] = $dataValue['server_name']; $csvData['role_name'] = $dataValue['role_name']; $csvData['role_level'] = $dataValue['role_level']; -<<<<<<< HEAD $csvData['create_time'] = date("Y-m-d H:i:s", $dataValue['create_time']); mb_convert_variables('GBK', 'UTF-8', $csvData); fputcsv($fp, $csvData); @@ -4810,50 +2882,6 @@ public function iosDetailExcelInfo($id,$map) { } if (!empty($map['parentsinfo'])) { $parent = json_decode($map['parentsinfo'], TRUE); -======= - $csvData['create_time'] = date("Y-m-d H:i:s",$dataValue['create_time']); - mb_convert_variables('GBK', 'UTF-8', $csvData); - fputcsv($fp, $csvData); - } - unset($csvData); - ob_flush(); - flush(); - } - fclose($fp); - $this->backSuccessExport($id); - } - - public function promotequotaExcelInfo($tid,$map) { - $xlsName = "推广员指标"; - $xlsCell = array( - array('account','账号'), - array('real_name','姓名'), - array('game_name','游戏名称'), - array('sdk_version_text','平台'), - array('server_name','游戏区服'), - array('role_num','角色数量'), - ); - $records = recordPromoteLogs('数据管理','推广员指标导出'); - $params['isContainSubs'] = $map['isContainSubs']; - $params['basicPromotes'] = json_decode($map['basicPromotes'],TRUE); - $ids = $map['ids']; - $promotes = json_decode($map["promotes"],TRUE); - if(!empty($map['game_id'])) { - $params['game_id'] = $map["game_id"]; - } - if(!empty($map['server_id'])) { - $params['server_id'] = $map["server_id"]; - } - if(!empty($map['sdk_version'])) { - $params['sdk_version'] = $map["sdk_version"]; - } - if(!empty($map['role_level'])) { - $params['role_level'] = $map['role_level']; - unset($map['role_level']); - } - if(!empty($map['parentsinfo'])) { - $parent = json_decode($map['parentsinfo'],TRUE); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a unset($map['parentsinfo']); } // if(!empty($map['currentDisplay'])) { @@ -4861,13 +2889,8 @@ public function iosDetailExcelInfo($id,$map) { // unset($map['currentDisplay']); // } $params['begin_time'] = $map['begin_time']; -<<<<<<< HEAD $params['end_time'] = $map['end_time']; //var_dump($params); -======= - $params['end_time'] = $map['end_time']; - //var_dump($params); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $records = []; $promoteRepository = new PromoteRepository(); $createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params); @@ -4878,20 +2901,12 @@ public function iosDetailExcelInfo($id,$map) { $record = [ 'id' => $parent['id'], 'account' => $parent['account'], -<<<<<<< HEAD 'real_name' => hideRealName($parent['real_name']), -======= - 'real_name' => mb_strlen($parent['real_name'],'utf-8') == 2 ? mb_substr($parent['real_name'],0,1,'utf-8').'*':mb_substr($parent['real_name'],0,1,'utf-8').'**', ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'level' => $parent['level'], 'game_name' => $game['game_name'], 'sdk_version_text' => $game['sdk_version_text'], 'server_name' => $game['server_name'], 'role_num' => $selfCreateRoleCountList[$parent['id']], -<<<<<<< HEAD -======= - 'current_display' => $currentDisplay, ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a ]; $records[] = $record; foreach ($promotes as $promote) { @@ -4899,11 +2914,7 @@ public function iosDetailExcelInfo($id,$map) { $record = [ 'id' => $id, 'account' => $promote['account'], -<<<<<<< HEAD 'real_name' => hideRealName($promote['real_name']), -======= - 'real_name' => mb_strlen($promote['real_name'],'utf-8') == 2 ? mb_substr($promote['real_name'],0,1,'utf-8').'*':mb_substr($promote['real_name'],0,1,'utf-8').'**', ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'level' => $promote['level'], 'game_name' => $game['game_name'], 'sdk_version_text' => $game['sdk_version_text'], @@ -4915,7 +2926,6 @@ public function iosDetailExcelInfo($id,$map) { } $xlsData = []; foreach ($records as $key1 => $value1) { -<<<<<<< HEAD $value1['account'] = hidePromoteAccount($value1['account']); $xlsData[] = $value1; } @@ -4926,17 +2936,6 @@ public function iosDetailExcelInfo($id,$map) { { $xlsName = "玩家行为日志"; $xlsCell = array( -======= - $value1['account'] = $this->encryption($value1['account']); - $xlsData[] = $value1; - } - $this->exportExcel($xlsName, $xlsCell, $xlsData,$tid); - } - - public function playactionExcelInfo($id,$map) { - $xlsName = "玩家行为日志"; - $xlsCell = array( ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a // 'cp订单号', '充值时间', '玩家账号', @@ -4946,7 +2945,6 @@ public function iosDetailExcelInfo($id,$map) { '角色ID', '角色名称', '订单金额' -<<<<<<< HEAD ); $model = M('pay_info', 'tab_'); $count = M('pay_info', 'tab_')->field('id')->where($map)->count(); @@ -5045,108 +3043,6 @@ public function iosDetailExcelInfo($id,$map) { $csvData['register_time'] = date("Y-m-d H:i:s", $value1['register_time']); $csvData['register_ip'] = $value1['register_ip']; $csvData['login_time'] = date("Y-m-d H:i:s", $value1['login_time']); -======= - ); - $model = M('pay_info','tab_'); - $count = M('pay_info','tab_')->field('id')->where($map)->count(); - $csvFileName = $xlsName.'.csv'; - //设置好告诉浏览器要下载excel文件的headers - header('Content-Description: File Transfer'); - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - $fp = fopen('php://output', 'a');//打开output流 - mb_convert_variables('gb2312', 'UTF-8', $xlsCell); - fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = '100000';//从数据库获取总量,假设是十万 - $accessNum = $count ?? 0; - $perSize = 5000;//每次查询的条数 - $pages = ceil($accessNum / $perSize); - for($i = 1; $i <= $pages; $i++) { - $data = $model->where($map)->order('tab_pay_info.create_time desc') - ->limit(($i-1)*$perSize ,$perSize)->select(); - foreach($data as $key => $v) { - $v['create_time'] = date('Y-m-d H:i:s',$v['create_time']); - $promoteInfo = M('promote','tab_')->field("account")->where(['id' => intval($v['promote_id'])])->find(); - $serverId = $v['server_id']; - $gameId = $v['game_id']; - $serverInfo = M('server','tab_')->field('server_name')->where(['server_num'=>$serverId,'game_id'=>$gameId])->find(); - $v['promote_id']= $promoteInfo['account']; - /* if(empty($v['extend'])) { - $v['extend'] = $v['order_id']; - } */ - // $csvData['extend'] = $this->encryption($v['extend']); - $csvData['create_time'] = $v['create_time']; - $csvData['user_account'] = $this->encryption($v['user_account']); - $csvData['game_name'] = $v['game_name']; - $csvData['promote_id'] = $v['promote_id']; - $csvData['server_name'] = $serverInfo['server_name']; - $csvData['user_id'] = $v['game_player_id']; - $csvData['game_player_name'] = $v['game_player_name']; - $csvData['price'] = $v['price']; - mb_convert_variables('GBK', 'UTF-8', $csvData); - fputcsv($fp, $csvData); - } - unset($csvData); - ob_flush(); - flush(); - } - fclose($fp); - $this->backSuccessExport($id); - - } - - //注册明细excel信息 - public function registerExcelInfo($id,$map) { - $xlsName = "注册明细"; - $xlsCell = array( - '玩家账号', - '推广账号', - '设备IMIE/IDFA', - '注册时间', - '注册ip', - '登陆时间', - '登陆ip' - ); - $records = recordPromoteLogs('数据管理','注册明细导出'); - $model = M('user','tab_'); - - $data1 = $model->field('account')->where($map)->order('tab_user.id desc')->select(); - $csvFileName = $xlsName.'.csv'; - //设置好告诉浏览器要下载excel文件的headers - header('Content-Description: File Transfer'); - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - $fp = fopen('php://output', 'a');//打开output流 - mb_convert_variables('gb2312', 'UTF-8', $xlsCell); - fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = '100000';//从数据库获取总量,假设是十万 - $accessNum = count($data1)?:0 ; - - $perSize = 5000;//每次查询的条数 - $pages = ceil($accessNum / $perSize); - for($i = 1; $i <= $pages; $i++) { - $model = M('user','tab_'); - - $data = $model - ->field('account,device_number,promote_account,register_time,register_ip,login_time,login_ip') - ->where($map) - ->limit(($i-1)*$perSize ,$perSize) - ->order('tab_user.id desc') - ->select(); - foreach($data as $value1) { - $csvData['account'] = $this->encryption($value1['account']); - $csvData['promote_account'] = $value1['promote_account']; - $csvData['device_number'] = $this->encryption($value1['device_number']); - $csvData['register_time'] = date("Y-m-d H:i:s",$value1['register_time']); - $csvData['register_ip'] = $value1['register_ip']; - $csvData['login_time'] = date("Y-m-d H:i:s",$value1['login_time']); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $csvData['login_ip'] = $value1['login_ip']; mb_convert_variables('GBK', 'UTF-8', $csvData); fputcsv($fp, $csvData); @@ -5157,7 +3053,6 @@ public function iosDetailExcelInfo($id,$map) { } fclose($fp); $this->backSuccessExport($id); -<<<<<<< HEAD } //玩家角色excel信息 @@ -5182,31 +3077,6 @@ public function iosDetailExcelInfo($id,$map) { array('create_time', '创建时间'), ); recordPromoteLogs('数据管理', '角色查询导出'); -======= - } - - //玩家角色excel信息 - public function userRolesExcelInfo($id, $map) { - $xlsName = "角色查询"; - $xlsCell = array( - array('user_account','玩家账号'), - array('promote_account','推广账号'), - array('game_name','游戏名称'), - - array('device_number','设备码'), - array('register_time','注册时间'), - array('register_ip','注册IP'), - array('role_id','角色ID'), - array('login_time','最近登录时间'), - array('login_ip','最近登录IP'), - - array('server_name','区服'), - array('role_name','角色名'), - array('role_level','等级'), - array('create_time','创建时间'), - ); - $records = recordPromoteLogs('数据管理','角色查询导出'); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map = json_decode(json_encode($map), true); @@ -5236,20 +3106,12 @@ public function iosDetailExcelInfo($id,$map) { ->where($map['map']) ->order($map['order']) ->select(); -<<<<<<< HEAD $xlsData = []; $loginPromote = $this->getLoginPromote(); foreach ($data as $key1 => $value1) { $value1['user_account'] = getUserAccountOfPromote($value1['user_account'], $loginPromote); if ($value1['create_time'] == 0) { -======= - - $xlsData = []; - foreach ($data as $key1 => $value1) { - $value1['user_account'] = $this->encryption($value1['user_account']); - if($value1['create_time'] == 0) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $value1['create_time'] = date('Y-m-d H:i:s', $value1['play_time']); } else { $value1['create_time'] = date('Y-m-d H:i:s', $value1['create_time']); @@ -5258,7 +3120,6 @@ public function iosDetailExcelInfo($id,$map) { $value1['login_time'] = date('Y-m-d H:i:s', $value1['login_time']); $xlsData[] = $value1; } -<<<<<<< HEAD $this->exportExcel($xlsName, $xlsCell, $xlsData, $id); } @@ -5288,36 +3149,6 @@ public function iosDetailExcelInfo($id,$map) { $xlsCell[] = array('spend_voucher', '代金券使用'); } -======= - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - } - - //数据汇总excel信息 - public function summaryExcelInfo($id, $map) { - $xlsName = "数据汇总"; - $xlsCell = array( - array('game_name','游戏名称'), - array('sdk_version','平台'), - array('role_num','创角数'), - array('user_num','创建用户'), - array('new_user_num','新创角用户'), - array('new_device_num','新创角设备'), - array('new_ip_num','新增创角ip'), - array('login_user_num','登陆用户数'), - ); - $records = recordPromoteLogs('数据管理','数据汇总导出'); - if($this->canViewUserRecharge) { - $xlsCell[] = array('spend_user_num','充值人数'); - $xlsCell[] = array('spend_num','充值次数'); - $xlsCell[] = array('spend_all_amount','充值总额'); - $xlsCell[] = array('spend_cash','现金充值'); - $xlsCell[] = array('spend_generic','通用币充值'); - $xlsCell[] = array('spend_binding','绑定币充值'); - $xlsCell[] = array('spend_discount','折扣币充值'); - $xlsCell[] = array('spend_voucher','代金券使用'); - } - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $loginPromote = $this->getLoginPromote(); $map = json_decode(json_encode($map), true); $gameMap = $map['map']; @@ -5334,20 +3165,14 @@ public function iosDetailExcelInfo($id,$map) { $data = M('game', 'tab_')->where($gameMap)->order('sort desc,id desc')->select(); $records = []; -<<<<<<< HEAD if (!empty($data)) { // $distanceTime = intval($endTime - $begTime); $distanceTime = 0; if ($distanceTime / (24 * 3600) <= 31) { -======= - if (!empty($data)) { - if (intval($endTime - $begTime) / (24 * 3600) <= 31) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $gameIds = array_column($data, 'id'); $params['game_ids'] = $gameIds; $userRepository = new UserRepository(); $spendRepository = new SpendRepository(); -<<<<<<< HEAD $roleNumList = $userRepository->getCreateRoleCountByGame($params); //创角数 $userNumList = $userRepository->getCreateRoleUserCountByGame($params); //创角用户 $newUserNumList = $userRepository->getNewCreateRoleUserCountByGame($params); //新创角用户 @@ -5364,24 +3189,6 @@ public function iosDetailExcelInfo($id,$map) { $spendGenericList = $spendRepository->getPayAmountGroupByGameAndType($params); //通用币充值 $params['pay_way'] = -1; $spendBindingList = $spendRepository->getPayAmountGroupByGameAndType($params); //绑定币充值 -======= - $roleNumList = $userRepository->getCreateRoleCountByGame($params);//创角数 - $userNumList = $userRepository->getCreateRoleUserCountByGame($params);//创角用户 - $newUserNumList = $userRepository->getNewCreateRoleUserCountByGame($params);//新创角用户 - $newDeviceNumList = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备 - $newIpNumList = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP - $loginUserNumList = $userRepository->getLoginCountGroupByGame($params);//登录用户数 - if ($this->canViewUserRecharge) { - $spendUserNumList = $spendRepository->getPayUserCountGroupByGame($params);//充值人数 - $spendNumList = $spendRepository->getPayCountGroupByGame($params);//充值次数 - $spendAllAmountList = $spendRepository->getPayAmountGroupByGameAndType($params);//充值总额 - $params['pay_way'] = ['in', '1,2,3,4,5,6']; - $spendCashList = $spendRepository->getPayAmountGroupByGameAndType($params);//现金充值 - $params['pay_way'] = 0; - $spendGenericList = $spendRepository->getPayAmountGroupByGameAndType($params);//通用币充值 - $params['pay_way'] = -1; - $spendBindingList = $spendRepository->getPayAmountGroupByGameAndType($params);//绑定币充值 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } foreach ($data as $list) { $gameId = $list['id']; @@ -5414,7 +3221,6 @@ public function iosDetailExcelInfo($id,$map) { $params['game_ids'] = $allGameIs; $allData['game_name'] = "合计"; $allData['sdk_version'] = '--'; -<<<<<<< HEAD $allData['role_num'] = $userRepository->getCreateRoleCountByGame($params); //创角数 $allData['user_num'] = $userRepository->getCreateRoleUserCountByGame($params); //创角用户 $allData['new_user_num'] = $userRepository->getNewCreateRoleUserCountByGame($params); //新创角用户 @@ -5495,93 +3301,10 @@ public function iosDetailExcelInfo($id,$map) { ); recordPromoteLogs('平台币管理', '我的平台币导出'); -======= - $allData['role_num'] = $userRepository->getCreateRoleCountByGame($params);//创角数 - $allData['user_num'] = $userRepository->getCreateRoleUserCountByGame($params);//创角用户 - $allData['new_user_num'] = $userRepository->getNewCreateRoleUserCountByGame($params);//新创角用户 - $allData['new_device_num'] = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备 - $allData['new_ip_num'] = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP - $allData['login_user_num'] = $userRepository->getLoginCountGroupByGame($params);//登录用户数 - - if($this->canViewUserRecharge) { - $allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数 - $allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数 - unset($params['pay_way']); - $allData['spend_all_amount'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//充值总额 - $params['pay_way'] = ['in', '1,2,3,4,5,6']; - $allData['spend_cash'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//现金充值 - $params['pay_way'] = 0; - $allData['spend_generic'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//通用币充值 - $params['pay_way'] = -1; - $allData['spend_binding'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//绑定币充值 - $allData['spend_discount'] = '0.00'; - $allData['spend_voucher'] = '0.00'; - - } - $records[] = $allData; - } - } - $this->exportExcel($xlsName, $xlsCell, $records,$id); - } - - /* - *渠道管理 - */ - public function childrenExcelInfo($id,$map) { - $xlsName = "渠道管理"; - $xlsCell = array( - array('id','ID'), - array('account','账号'), - array('real_name','真实姓名'), - array('idcard','身份证'), - array('mobile_phone','手机号'), - array('parent_name','上级渠道'), - array('nickname','昵称'), - array('promotestatus','帐号状态'), - array('create_time','创建时间'), - - ); - $records = recordPromoteLogs('数据管理','渠道管理导出'); - $model = M('promote','tab_'); - $data = $model->where($map)->select(); - $xlsData = []; - foreach ($data as $key1 => $value1) { -// $value1['status'] = $this->payWay[$value1['pay_way']]; - $value1['promotestatus'] = "未知状态"; - if($value1['status'] == 0) { - $value1['promotestatus'] = "审核中"; - } - if($value1['status'] == 1) { - $value1['promotestatus'] = "启用"; - } - if($value1['status'] == 2) { - $value1['promotestatus'] = "冻结中"; - } - $realname = mb_strlen($value1['real_name'],'utf-8') == 2 ? mb_substr($value1['real_name'],0,1,'utf-8').'*':mb_substr($value1['real_name'],0,1,'utf-8').'**'; - $value1['real_name'] = $realname; - $value1['idcard'] = substr_replace($value1['idcard'],'************',3,12); - $value1['create_time'] = date('Y-m-d H:i:s',$value1['create_time']); - $xlsData[] = $value1; - } - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - } - - public function mycoinExcelInfo($id,$map) { - $xlsName = "我的平台币"; - $xlsCell = array( - array('cointype','平台币类型'), - array('game_name','游戏名称'), - array('num','平台币余额'), - array('status','资产状态'), - - ); - $records = recordPromoteLogs('平台币管理','我的平台币导出'); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $data = M('PromoteBalanceCoin', 'tab_') ->field('tab_promote_balance_coin.*,tab_game.game_name') ->join('left join tab_game on tab_promote_balance_coin.game_id = tab_game.id') ->where($map) -<<<<<<< HEAD ->select(); foreach ($data as $key => $value) { if ($value['game_id'] == 0) { @@ -5596,27 +3319,10 @@ public function iosDetailExcelInfo($id,$map) { } elseif ($value['status'] == 2) { $value['status'] = "锁定"; } else { -======= - ->select(); - foreach($data as $key => $value) { - if($value['game_id'] == 0) { - $value['cointype'] = "通用币"; - $value['game_name'] = "通用"; - }else { - $value['cointype'] = "绑定币"; - $value['game_name'] = $value['game_name']; - } - if($value['status'] == 1) { - $value['status'] = "正常"; - }elseif($value['status'] == 2) { - $value['status'] = "锁定"; - }else { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $value['status'] = "验证失败"; } $xlsData[] = $value; } -<<<<<<< HEAD $this->exportExcel($xlsName, $xlsCell, $xlsData, $id); } @@ -5641,31 +3347,6 @@ public function iosDetailExcelInfo($id,$map) { $records[] = [ 'id' => $item['id'], 'sn' => encryption($item['sn']), -======= - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - } - - public function mycoinRecordExcelInfo($id,$map) { - $xlsName = "我的平台币明细"; - $xlsCell = array( - array('sn','流水号'), - array('type_text','操作类型'), - array('sub_type_text','操作方式'), - array('target_type_text','对手操作类型'), - array('coin','平台币数量'), - array('balance_coin','平台币余额'), - array('description','交易说明'), - array('create_time','交易时间'), - ); - $records = recordPromoteLogs('平台币管理','我的平台币明细导出'); - $service = new PromoteCoinRecordService(); - $data = M('promote_coin_record','tab_')->where($map)->select(); - $records = []; - foreach ($data as $item) { - $records[] = [ - 'id' => $item['id'], - 'sn' => $this->encryption($item['sn']), ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'type_text' => $service->getTypeText($item['type']), 'sub_type_text' => $service->getSubTypeText($item['sub_type']), 'target_type_text' => $service->getTargetTypeText($item['target_type'], $item['target_level']), @@ -5676,7 +3357,6 @@ public function iosDetailExcelInfo($id,$map) { 'create_time' => date('Y-m-d H:i:s', $item['create_time']), ]; } -<<<<<<< HEAD $xlsData = $records; $this->exportExcel($xlsName, $xlsCell, $xlsData, $id); @@ -5701,32 +3381,6 @@ public function iosDetailExcelInfo($id,$map) { $logs = $model->where($map)->select(); $service = new PromoteCoinTransferLogService(); $gameIds = []; -======= - - $xlsData = $records; - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - - } - - // 我的平台币的交易明细 - public function coinrecordExcelInfo($id,$map) { - $xlsName = "平台币转移"; - $xlsCell = array( - array("sn","订单号"), - array("target_account","收款方账号"), - array("game_name","适用游戏"), - array("handle_type","账号类型"), - array("num","转账数量"), - array('description',"交易说明"), - array('create_time',"交易时间"), - array('status',"交易状态"), - ); - $records = recordPromoteLogs('平台币管理','平台币转移导出'); - $model = M('promote_coin_transfer_log', 'tab_'); - $logs = $model->where($map)->select(); - $service = new PromoteCoinTransferLogService(); - $gameIds = []; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $promoteIds = []; $uesrIds = []; foreach ($logs as $log) { @@ -5750,11 +3404,7 @@ public function iosDetailExcelInfo($id,$map) { if (count($uesrIds) > 0) { $users = M('user', 'tab_')->field(['id', 'account'])->where(['id' => ['in', $uesrIds]])->select(); } -<<<<<<< HEAD $users = index_by_column('id', $users); -======= - $users = index_by_column('id', $users); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $promotes = index_by_column('id', $promotes); $games = index_by_column('id', $games); $records = []; @@ -5768,13 +3418,8 @@ public function iosDetailExcelInfo($id,$map) { } $records[] = [ 'id' => $log['id'], -<<<<<<< HEAD 'sn' => encryption($log['sn']), 'target_account' => encryption($targetAccount), -======= - 'sn' => $this->encryption($log['sn']), - 'target_account' => $this->encryption($targetAccount), ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'game_name' => isset($games[$log['game_id']]) ? $games[$log['game_id']]['game_name'] : '所有游戏', 'target_type_text' => $service->getTargetTypeText($log['target_type'], $log['target_level']), 'num' => $log['num'], @@ -5784,7 +3429,6 @@ public function iosDetailExcelInfo($id,$map) { ]; } $xlsData = $records; -<<<<<<< HEAD $this->exportExcel($xlsName, $xlsCell, $xlsData, $id); } @@ -5818,45 +3462,10 @@ public function iosDetailExcelInfo($id,$map) { if ($value['check_status'] == 1) { $value['check_status'] = "正常"; } else { -======= - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - - } - - public function testresourceExcelInfo($id,$map) { - $xlsName = "测试资源"; - $xlsCell = array( - array('game_name',"产品名称"), - array('server_name',"区服"), - array('user_account',"测试账号"), - array('promote_account',"所属推广员"), - array('role_name',"角色名称"), - array('verify_resource_count',"累计发放资源"), - array('verify_count',"累计发放次数"), - array('apply_resource_count',"申请数量"), - array('check_status',"状态"), - array('create_time',"创建时间"), - ); - $records = recordPromoteLogs('测试资源','测试资源导出'); - $data = M('test_resource','tab_') - ->field("tab_test_resource.*,user.check_status") - ->join('tab_user user on tab_test_resource.user_id=user.id','left') - ->order("create_time desc") - ->where($map) - ->group("user_id,game_id,server_id") - ->select(); - foreach ($data as $key => $value) { - $value['create_time'] = date("Y-m-d H:i:s", $value['create_time']); - $value['user_account'] = $this->encryption($value['user_account']); - if($value['check_status'] == 1) { - $value['check_status'] = "正常"; - }else { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $value['check_status'] = "拉黑"; } //获取累计发放 $where = array( -<<<<<<< HEAD "user_id" => $value['user_id'], "game_id" => $value['game_id'], "server_id" => $value['server_id'] @@ -6013,187 +3622,19 @@ public function iosDetailExcelInfo($id,$map) { array('pay_amount', '充值金额'), array('discount', '优惠值'), array('coin_num', '平台币数量'), - array('pay_type', '转账类型'), - array('order_status1', '订单状态'), - array('time', '申请时间'), - ); - recordPromoteLogs('平台币管理', '平台币充值导出'); - $model = M('coin_pay_order', 'tab_'); - $data = $model->where($map)->order('id DESC')->select(); - foreach ($data as $key => $value) { - if ($value['pay_type'] == 1) { -======= - "user_id"=>$value['user_id'], - "game_id"=>$value['game_id'], - "server_id"=>$value['server_id'] - ); - $where1 = array( - "apply_status"=>2, - ); - //获取累计 - $verify_resource = M('test_resource','tab_')->field("IFNULL(sum(verify_resource),0) verify_resource_count,count(*) verify_count")->where(array_merge($where,$where1))->find(); - //获取申请 - $where2 = array( - "apply_status"=>0, - ); - $apply_resource = M('test_resource','tab_')->field("IFNULL(sum(apply_resource),0) apply_resource_count")->where(array_merge($where,$where2))->find(); - $data[$key] = array_merge($value,$verify_resource,$apply_resource); - } - $xlsData = $data; - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - - - } - - public function testresourcelistExcelInfo($id,$map){ - $xlsName = "测试资源申请记录"; - $xlsCell = array( - array('game_name',"游戏名称"), - array('server_name',"区服"), - array('user_account',"测试账号"), - array('phone',"手机号"), - array('role_name',"角色名称"), - array('apply_resource',"申请数量"), - array('verify_resource',"实际发放"), - array('apply_remark',"备注"), - array('apply_status',"审核状态"), - array('verify_remark',"审核意见"), - array('promote_account',"申请人"), - array('create_time',"申请时间"), - array('verify_time',"审核时间"), - ); - $records = recordPromoteLogs('测试资源','测试资源记录导出'); - $data=M('test_resource','tab_')->where($map)->order('id desc')->select(); - foreach($data as $key => $value) { - $data[$key]['user_account'] = $this->encryption($value['user_account']); - if($value['apply_status'] == 1) { - $data[$key]['apply_status'] = "审核未通过"; - } - elseif($value['apply_status'] == 2) { - $data[$key]['apply_status'] = "审核通过"; - } - else { - $data[$key]['apply_status'] = "待审核"; - } - $data[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']); - $data[$key]['verify_time'] = date('Y-m-d H:i:s',$value['verify_time']); - } - $xlsData = $data; - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - } - - public function supportNumberListExcelInfo($id,$map) { - $xlsName = "扶持号管理"; - $xlsCell = array( - array('game_name',"产品名称"), - array('server_name',"区服"), - array('user_account',"测试账号"), - array('promote_account',"所属推广员"), - array('role_name',"角色名称"), - array('device_number',"设备信息"), - array('check_status',"状态"), - array('create_time',"创建时间"), - ); - $records = recordPromoteLogs('测试资源','扶持号管理导出'); - $data = M('test_resource','tab_') - ->field('tab_test_resource.id,tab_test_resource.user_id,tab_test_resource.game_name,tab_test_resource.server_name,tab_test_resource.user_account,tab_test_resource.promote_account,tab_test_resource.role_name,tab_test_resource.create_time,device_number,lock_status as check_status') - ->join('left join tab_user as user on tab_test_resource.user_id = user.id') - ->where($map) - ->order('tab_test_resource.create_time DESC') - ->select(); - foreach ($data as $key => $value) { - $data[$key]['create_time'] = date('Y-m-d H:m:i',$value['create_time']); - $data[$key]['user_account'] = $this->encryption($value['user_account']); - if($value['check_status'] == 1) { - $data[$key]['check_status'] = "启用"; - }else { - $data[$key]['check_status'] = "冻结"; - } - } - $xlsData = $data; - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - } - - public function arpuExcelInfo($id,$params) { - $xlsName = "ARPU统计"; - $xlsCell = array( - array('day','日期'), - array('payGameCount','付费游戏数'), - array('loginCount','活跃用户'), - array('registerCount','新增用户'), - array('payUserCount','付费用户'), - array('newPayUserCount','新增付费用户'), - array('payAmount','付费总额'), - array('payRate','付费率'), - array('newPayAmount','新增付费额'), - // array('historyPayCount','累计付费用户'), - array('arpu','ARPU'), - array('arppu','ARPPU'), + array('pay_type', '转账类型'), + array('order_status1', '订单状态'), + array('time', '申请时间'), ); - $records = recordPromoteLogs('数据管理','ARPU统计导出'); - $dayList = $params["dayList"]; - $arr = explode(',', $params['promote_id'][1]); - $params['promote_id'] = $arr; - $records = []; - $userRepository = new UserRepository(); - $spendRepository = new SpendRepository(); - $payGameCountList = $spendRepository->getPayGameCountGroupByDay($params); - $payUserCountList = $spendRepository->getPayUserCountGroupByDay($params); - $newPayUserCountList = $spendRepository->getNewPayUserCountGroupByDay($params); - $payAmountList = $spendRepository->getPayAmountGroupByDay($params); - $newPayAmountList = $spendRepository->getNewPayAmountGroupByDay($params); - // $historyPayCountList = $spendRepository->getHistoryPayCountGroupByDay($params); - $loginCountList = $userRepository->getLoginCountGroupByDay($params); - $registerCountList = $userRepository->getRegisterCountGroupByDay($params); - - foreach ($dayList as $day) { - $records[] = [ - 'day' => $day, - 'payGameCount' => $payGameCountList[$day], - 'payUserCount' => $payUserCountList[$day], - 'newPayUserCount' => $newPayUserCountList[$day], - 'payAmount' => number_format($payAmountList[$day], 2), - 'newPayAmount' => number_format($newPayAmountList[$day], 2), - // 'historyPayCount' => $historyPayCountList[$day], - 'loginCount' => $loginCountList[$day], - 'registerCount' => $registerCountList[$day], - 'payRate' => $loginCountList[$day] == 0 ? '--' : round($payUserCountList[$day] / $loginCountList[$day] * 100, 2) . '%', - 'ratentionOneDay' => '--', - 'arpu' => $loginCountList[$day] == 0 ? '0.00' : number_format(round($payAmountList[$day] / $loginCountList[$day], 2), 2), - 'arppu' => $payUserCountList[$day] == 0 ? '0.00' : number_format(round($payAmountList[$day] / $payUserCountList[$day], 2), 2), - ]; - } - $xlsData = []; - foreach ($records as $key1 => $value1) { - $xlsData[] = $value1; - } - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - - - } - - public function orderlistExcelInfo($id,$map) { - $xlsName = "平台币充值"; - $xlsCell = array( - array('order_number','充值订单号'), - array('pay_amount','充值金额'), - array('discount','优惠值'), - array('coin_num','平台币数量'), - array('pay_type','转账类型'), - array('order_status1','订单状态'), - array('time','申请时间'), - ); - $records = recordPromoteLogs('平台币管理','平台币充值导出'); - $model = M('coin_pay_order','tab_'); + recordPromoteLogs('平台币管理', '平台币充值导出'); + $model = M('coin_pay_order', 'tab_'); $data = $model->where($map)->order('id DESC')->select(); foreach ($data as $key => $value) { - if($value['pay_type'] == 1) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a + if ($value['pay_type'] == 1) { $data[$key]['pay_type'] = "线上充值"; } else { $data[$key]['pay_type'] = "线下充值"; } -<<<<<<< HEAD if ($value['order_status'] == 0) { $data[$key]['order_status1'] = "待付款"; @@ -6230,43 +3671,6 @@ public function iosDetailExcelInfo($id,$map) { public function withdrawDtlExcelInfo($id, $map) { -======= - - if($value['order_status'] == 0) { - $data[$key]['order_status1'] = "待付款"; - } - if($value['order_status'] == 1) { - $data[$key]['order_status1'] = "付款成功"; - } - if($value['order_status'] == 2) { - $data[$key]['order_status1'] = "待审核"; - } - if($value['order_status'] == 3) { - $data[$key]['order_status1'] = "待发币"; - } - if($value['order_status'] == 4) { - $data[$key]['order_status1'] = "已发币"; - } - if($value['order_status'] == 5) { - $data[$key]['order_status1'] = "审核不通过"; - } - - $data[$key]['time'] = date('Y-m-d H:i:s' ,$value['create_time']); - - } - $xlsData = $data; - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - } - - public function remitCerDownLoad($id,$map) { - $proof_id = $map['id']; - $file = new FileController(); - $file->download($proof_id); - $this->backSuccessExport($id); - } - - public function withdrawDtlExcelInfo($id,$map) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $xlsName = "提现记录"; $xlsCell = array( '充值订单号', @@ -6293,19 +3697,12 @@ public function iosDetailExcelInfo($id,$map) { ->where($map) ->order('id desc') ->select(); -<<<<<<< HEAD $loginPromote = $this->getLoginPromote(); -======= ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if (!empty($data)) { foreach ($data as $key => &$list) { $list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2); $list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']); -<<<<<<< HEAD $list['user_account'] = getUserAccountOfPromote($list['user_account'], $loginPromote); -======= - $list['user_account'] = $this->encryption($list['user_account']); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a switch ($list['pay_way']) { case 2: case 3: @@ -6316,7 +3713,6 @@ public function iosDetailExcelInfo($id,$map) { $list['pay_way_name'] = QueryController::$payWay[$list['pay_way']]; break; } -<<<<<<< HEAD if ($list['pay_way'] !== -1 && $list['pay_way'] !== 0) { $list['cash_base'] = $list['pay_amount']; } else { @@ -6326,37 +3722,19 @@ public function iosDetailExcelInfo($id,$map) { if ($list['pay_way'] == 0) { $list['platform_base'] = $list['pay_amount']; } else { -======= - if($list['pay_way'] !== -1 && $list['pay_way'] !== 0) { - $list['cash_base'] = $list['pay_amount']; - }else { - $list['cash_base'] = 0; - } - $list['cash_selle_ratio'] = $list['selle_ratio']; - if($list['pay_way'] == 0) { - $list['platform_base'] = $list['pay_amount']; - }else { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $list['platform_base'] = 0; } $list['platform_selle_ratio'] = $list['selle_ratio']; -<<<<<<< HEAD if ($list['pay_way'] == -1) { $list['bind_base'] = $list['pay_amount']; } else { -======= - if($list['pay_way'] == -1) { - $list['bind_base'] = $list['pay_amount']; - }else { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $list['bind_base'] = 0; } $list['bind_selle_ratio'] = $list['selle_ratio']; $list['status'] = FinanceController::$withdrawStatus[$withdraw['status']]; unset($list['pay_way']); -<<<<<<< HEAD unset($list['selle_ratio']); } } @@ -6378,29 +3756,6 @@ public function iosDetailExcelInfo($id,$map) { $pages = ceil($accessNum / $perSize); for ($i = 1; $i <= $pages; $i++) { foreach ($data as $value) { -======= - unset($list['selle_ratio']); - } - } - $csvFileName = $xlsName.'.csv'; - //设置好告诉浏览器要下载excel文件的headers - header('Content-Description: File Transfer'); - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - $fp = fopen('php://output', 'a');//打开output流 - mb_convert_variables('gb2312', 'UTF-8', $xlsCell); - fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = '100000';//从数据库获取总量,假设是十万 - $accessNum = count($data)?:0 ; - - $perSize = 5000;//每次查询的条数 - $pages = ceil($accessNum / $perSize); - for($i = 1; $i <= $pages; $i++) { - foreach($data as $value) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a mb_convert_variables('GBK', 'UTF-8', $value); fputcsv($fp, $value); } @@ -6410,7 +3765,6 @@ public function iosDetailExcelInfo($id,$map) { } fclose($fp); $this->backSuccessExport($id); -<<<<<<< HEAD } public function withdrawRecordExcelInfo($id, $map) @@ -6425,22 +3779,6 @@ public function iosDetailExcelInfo($id,$map) { array('status', '提现状态'), array('respond', '说明'), ); -======= - - } - - public function withdrawRecordExcelInfo($id,$map) { - $xlsName = "提现记录"; - $xlsCell = array( - array('widthdraw_number','提现订单'), - array('create_time','提现日期'), - array('settlement_end_time','结算截止日期'), - array('sum_money','收益金额'), - array('sum_money','实际提现金额'), - array('status','提现状态'), - array('respond','说明'), - ); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $model = M('withdraw', 'tab_'); $data = $model->field('id,widthdraw_number,create_time,settlement_end_time,sum_money,status,respond') ->where($map) @@ -6454,7 +3792,6 @@ public function iosDetailExcelInfo($id,$map) { } } $xlsData = $data; -<<<<<<< HEAD $this->exportExcel($xlsName, $xlsCell, $xlsData, $id); } @@ -6462,14 +3799,6 @@ public function iosDetailExcelInfo($id,$map) { { $xlsName = "结算明细"; $xlsCell = array( -======= - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - } - - public function settlementExcelInfo($id,$map) { - $xlsName = "结算明细"; - $xlsCell = array( ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a '游戏订单号', '游戏', '玩家账号', @@ -6487,7 +3816,6 @@ public function iosDetailExcelInfo($id,$map) { $spendRepository = new SpendRepository(); $map = $spendRepository->withIsCheck($map); -<<<<<<< HEAD $model = M('spend', 'tab_'); $data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id') ->where($map) @@ -6497,23 +3825,11 @@ public function iosDetailExcelInfo($id,$map) { $total = $model->field('sum(pay_amount) as pay_amount,sum(if(pay_way > -1,pay_amount,0)) as direct_pay_amount,sum(if(pay_way = -1,pay_amount,0)) as inner_pay_amount,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income') ->where($map) ->find(); -======= - $model = M('spend', 'tab_'); - $data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id') - ->where($map) - ->order('id desc') - ->select(); - $total = []; - $total = $model->field('sum(pay_amount) as pay_amount,sum(if(pay_way > -1,pay_amount,0)) as direct_pay_amount,sum(if(pay_way = -1,pay_amount,0)) as inner_pay_amount,sum(if(selle_ratio >= 0,selle_ratio * pay_amount,0)) as income') - ->where($map) - ->find(); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $total['direct_pay_amount'] = empty($total['direct_pay_amount']) ? '0.00' : $total['direct_pay_amount']; $total['inner_pay_amount'] = empty($total['inner_pay_amount']) ? '0.00' : $total['inner_pay_amount']; $total['income'] = empty($total['income']) ? 0 : $total['income']; $total['income'] = bcdiv($total['income'], 100, 2); //提现状态 -<<<<<<< HEAD $csvFileName = $xlsName . '.csv'; //设置好告诉浏览器要下载excel文件的headers header('Content-Description: File Transfer'); @@ -6537,49 +3853,17 @@ public function iosDetailExcelInfo($id,$map) { ->order('id desc') ->limit(($i - 1) * $perSize, $perSize) ->select(); -======= - $csvFileName = $xlsName.'.csv'; - //设置好告诉浏览器要下载excel文件的headers - header('Content-Description: File Transfer'); - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - $fp = fopen('php://output', 'a');//打开output流 - mb_convert_variables('gb2312', 'UTF-8', $xlsCell); - fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = count($data)?:0 ; - - $perSize = 5000;//每次查询的条数 - $pages = ceil($accessNum / $perSize); - for($i = 1; $i <= $pages; $i++) { - - $data = $model->field('pay_order_number,game_name,user_account,promote_id,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id') - ->where($map) - ->order('id desc') - ->limit(($i-1)*$perSize ,$perSize) - ->select(); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $withdrawIds = []; foreach ($data as $key => $value) { if ($value['withdraw_id'] > 0 && !in_array($value['withdraw_id'], $withdrawIds)) { $withdrawIds[] = $value['withdraw_id']; } } -<<<<<<< HEAD if (empty($withdrawIds)) { $withdrawIds = "-10000"; } $withdrawStatus = M('withdraw', 'tab_') ->where(array('id' => ['in', $withdrawIds])) -======= - if(empty($withdrawIds)) { - $withdrawIds = "-10000"; - } - $withdrawStatus = M('withdraw', 'tab_') - ->where(array('id' => ['in',$withdrawIds])) ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a ->getField('id,status'); $promotes = []; @@ -6592,13 +3876,8 @@ public function iosDetailExcelInfo($id,$map) { foreach ($data as &$list) { //提现状态 -<<<<<<< HEAD $list['pay_order_number'] = encryption($list['pay_order_number']); $list['user_account'] = getUserAccountOfPromote($list['user_account'], $loginPromote); -======= - $list['pay_order_number'] = $this->encryption($list['pay_order_number']); - $list['user_account'] = $this->encryption($list['user_account']); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($list['pay_status'] == 1) { switch ($list['selle_status']) { case 0: @@ -6618,21 +3897,12 @@ public function iosDetailExcelInfo($id,$map) { $list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2); $list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']); -<<<<<<< HEAD if ($list['pay_way'] == -1) { $list['pay_amount_zhi'] = 0; $list['pay_amount_nei'] = $list['pay_amount']; } else { $list['pay_amount_zhi'] = $list['pay_amount']; $list['pay_amount_nei'] = 0; -======= - if($list['pay_way'] == -1) { - $list['pay_amount_zhi'] = 0; - $list['pay_amount_nei'] = $list['pay_amount']; - }else { - $list['pay_amount_zhi'] = $list['pay_amount']; - $list['pay_amount_nei'] = 0; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $promoteGroup = isset($promotes[$list['promote_id']]) ? $promoteService->getGroupNameByChain($promotes[$list['promote_id']]['chain'], $list['promote_id']) : ''; @@ -6652,11 +3922,7 @@ public function iosDetailExcelInfo($id,$map) { mb_convert_variables('GBK', 'UTF-8', $csvData); fputcsv($fp, $csvData); $xlsData[] = $csvData; -<<<<<<< HEAD } -======= - } ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a unset($xlsData); ob_flush(); flush(); @@ -6679,7 +3945,6 @@ public function iosDetailExcelInfo($id,$map) { fclose($fp); $this->backSuccessExport($id); -<<<<<<< HEAD // $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); @@ -6698,25 +3963,6 @@ public function iosDetailExcelInfo($id,$map) { $endTime = $map['pay_time'][1][1]; } else { $nowTime = date('Y-m-d'); -======= - - - // $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - - } - - public function financeindexExcelInfo($id,$map) { - $xlsName = "结算中心"; - $xlsCell = array( - array('day','时间'), - array('income','收益') - ); - if(!empty($map['pay_time'])) { - $begTime = $map['pay_time'][1][0]; - $endTime = $map['pay_time'][1][1]; - }else { - $nowTime = date('Y-m-d'); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); $initEndTime = $nowTime; @@ -6724,7 +3970,6 @@ public function iosDetailExcelInfo($id,$map) { $begTime = strtotime($initBegTime); $endTime = strtotime($initEndTime); $endTime = $endTime + 3600 * 24; -<<<<<<< HEAD } $spendRepository = new SpendRepository(); @@ -6733,16 +3978,6 @@ public function iosDetailExcelInfo($id,$map) { $model = M('spend', 'tab_'); $dayList = $this->getDayList($begTime, $endTime); $data = $model->field('FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day, -======= - } - - $spendRepository = new SpendRepository(); - $map = $spendRepository->withIsCheck($map); - - $model = M('spend', 'tab_'); - $dayList = $this->getDayList($begTime, $endTime); - $data = $model->field('FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day, ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a sum(if(selle_ratio > 0, pay_amount * selle_ratio, 0)) as income') ->where($map) ->group('day') @@ -6753,7 +3988,6 @@ public function iosDetailExcelInfo($id,$map) { $records[] = [ 'day' => $date, 'income' => bcdiv($data[$day], 100, 2), -<<<<<<< HEAD ]; } @@ -6789,43 +4023,6 @@ public function iosDetailExcelInfo($id,$map) { $xlsCell[] = array('spend_discount', '折扣币充值'); $xlsCell[] = array('spend_voucher', '代金劵使用'); } -======= - - ]; - } - $xlsData = []; - foreach ($records as $key1 => $value1) { - $xlsData[] = $value1; - } - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - - } - - public function dailysummaryExcelInfo($id,$map) { - $xlsName = "每日概况"; - $xlsCell = array( - array('day','日期'), - array('role_num','创角数'), - array('user_num','创角用户'), - array('new_user_num','新创角用户'), - array('new_device_num','新创角设备'), - array('new_ip_num','新增创角IP'), - array('login_user_num','登陆用户数'), - - ); - $records = recordPromoteLogs('数据管理','每日概况导出'); - - if ($this->canViewUserRecharge) { - $xlsCell[] = array('spend_user_num','充值人数'); - $xlsCell[] = array('spend_num','充值次数'); - $xlsCell[] = array('spend_all_amount','充值总额'); - $xlsCell[] = array('spend_cash','现金充值'); - $xlsCell[] = array('spend_generic','通用币充值'); - $xlsCell[] = array('spend_binding','绑定币充值'); - $xlsCell[] = array('spend_discount','折扣币充值'); - $xlsCell[] = array('spend_voucher','代金劵使用'); - } ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $nowTime = date('Y-m-d'); $initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime))); $initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime'); @@ -6833,7 +4030,6 @@ public function iosDetailExcelInfo($id,$map) { $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime'); $begTime = strtotime($initBegTime); $endTime = strtotime($initEndTime); -<<<<<<< HEAD $params['promote_id'] = $map['promote_id']; if (!empty($map['sdk_version']) || !empty($map['relation_game_id'])) { if (!empty($map['gameIds'])) { @@ -6874,58 +4070,13 @@ public function iosDetailExcelInfo($id,$map) { $spendGenericList = $spendRepository->getPayAmountGroupByDayAndType($params); //通用币充值 $params['pay_way'] = -1; $spendBindingList = $spendRepository->getPayAmountGroupByDayAndType($params); //绑定币充值 -======= - $params['promote_id'] = $map['promote_id']; - if(!empty($map['sdk_version']) || !empty($map['relation_game_id'])) { - if(!empty($map['gameIds'])) { - $params['game_id'] = ['in',$map['gameIds']]; - }else { - $params['_string'] = '1=2'; - } - } - if(!empty($map['begin_time'])) { - $params['begin_time'] = $map['begin_time']; - }else { - $params['begin_time'] = $begTime; - } - - if(!empty($map['end_time'])) { - $params['end_time'] = $map['end_time']; - }else { - $params['begin_time'] = $endTime - 1; - } - $params['dayList'] = $map["dayList"]; - $summaryData = []; - if (intval($endTime - $begTime) / (24 * 3600) <= 30) { - $userRepository = new UserRepository(); - $spendRepository = new SpendRepository(); - $roleNumList = $userRepository->getCreateRoleCountByDay($params);//创角数 - $userNumList = $userRepository->getCreateRoleUserCountByDay($params);//创角用户 - $newUserNumList = $userRepository->getNewCreateRoleUserCountByDay($params);//新创角用户 - $newDeviceNumList = $userRepository->getNewCreateRoleDeviceCountByDay($params);//新创角设备 - $newIpNumList = $userRepository->getNewCreateRoleIpCountByDay($params);//新创角IP - $loginUserNumList = $userRepository->getLoginCountGroupByDayNew($params);//登录用户数 - $spendUserNumList = $spendRepository->getPayUserCountGroupByDayNew($params);//充值人数 - $spendNumList = $spendRepository->getPayCountGroupByDay($params);//充值次数 - $spendAllAmountList = $spendRepository->getPayAmountGroupByDayAndType($params);//充值总额 - $params['pay_way'] = ['in', '1,2,3,4,5,6']; - $spendCashList = $spendRepository->getPayAmountGroupByDayAndType($params);//现金充值 - $params['pay_way'] = 0; - $spendGenericList = $spendRepository->getPayAmountGroupByDayAndType($params);//通用币充值 - $params['pay_way'] = -1; - $spendBindingList = $spendRepository->getPayAmountGroupByDayAndType($params);//绑定币充值 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $allData['role_num'] = 0; $allData['user_num'] = 0; $allData['new_user_num'] = 0; $allData['new_device_num'] = 0; $allData['new_ip_num'] = 0; $allData['login_user_num'] = 0; -<<<<<<< HEAD if ($this->canViewUserRecharge) { -======= - if($this->canViewUserRecharge) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $allData['spend_user_num'] = 0; $allData['spend_num'] = 0; $allData['spend_all_amount'] = 0; @@ -6937,11 +4088,7 @@ public function iosDetailExcelInfo($id,$map) { } foreach ($params['dayList'] as $day) { $date = date('Ymd', strtotime($day)); -<<<<<<< HEAD $record = [ -======= - $records[] = [ ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'day' => $date, 'role_num' => $roleNumList[$day], 'user_num' => $userNumList[$day], @@ -6983,7 +4130,6 @@ public function iosDetailExcelInfo($id,$map) { $allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2); } $records[] = $record; -<<<<<<< HEAD } $allData['day'] = '合计'; $records[] = $allData; @@ -7007,34 +4153,6 @@ public function iosDetailExcelInfo($id,$map) { array('value', '系数值'), array('num', '当月玩家达标个数'), array('amount', '当月注册充值总额'), -======= - - } - $allData['day'] = '合计'; - $records[] = $allData; - $xlsData = []; - foreach ($records as $key1 => $value1) { - $xlsData[] = $value1; - } - - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); - - } - - } - - public function promoteGradeExcelInfo($tid, $map) - { - $xlsName = "团队评级"; - $xlsCell = array( - array('account','账号'), - array('real_name','姓名'), - array('promote_group', '部门/小组'), - array('grade_name','等级'), - array('value','系数值'), - array('num','当月玩家达标个数'), - array('amount','当月注册充值总额'), ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a ); recordPromoteLogs('评级管理', '团队评级导出'); @@ -7052,7 +4170,6 @@ public function iosDetailExcelInfo($id,$map) { $xlsData[] = $value; } $this->exportExcel($xlsName, $xlsCell, $xlsData, $tid); -<<<<<<< HEAD } public function achievementExcelInfo($tid, $map) @@ -7099,53 +4216,6 @@ public function iosDetailExcelInfo($id,$map) { unset($map['parentsinfo']); } if (!empty($map['currentDisplay'])) { -======= - } - - public function achievementExcelInfo($tid, $map) { - $xlsName = "推广员业绩"; - $xlsCell = array( - array('account','账号'), - array('real_name','姓名'), - array('promote_group', '部门/小组'), - array('create_role_count','创角数'), - array('create_role_user_count','创角用户'), - array('new_create_role_user_count','新创角用户'), - array('new_create_role_ip_count','新创角ip'), - array('login_user_count','登陆用户数'), - ); - $records = recordPromoteLogs('数据管理','推广员业绩导出'); - if ($this->canViewUserRecharge) { - $xlsCell[] = array('recharge_user_count','充值人数'); - $xlsCell[] = array('recharge_count','充值次数'); - $xlsCell[] = array('recharge_amount','充值总额'); - $xlsCell[] = array('recharge_by_ban_coin','绑定币充值'); - $xlsCell[] = array('recharge_by_coin','通用币充值'); - $xlsCell[] = array('recharge_by_cash','现金充值'); - } - $params['isContainSubs'] = $map['isContainSubs']; - $params['basicPromotes'] = json_decode($map['basicPromotes'],TRUE); - $ids = $map['ids']; - $promotes = json_decode($map["promotes"],TRUE); - if(!empty($map['game_id'])) { - $params['game_id'] = $map["game_id"]; - } - if(!empty($map['server_id'])) { - $params['server_id'] = $map["server_id"]; - } - if(!empty($map['sdk_version'])) { - $params['sdk_version'] = $map["sdk_version"]; - } - if(!empty($map['lock_status'])) { - $params['lock_status'] = $map["lock_status"]; - } - - if(!empty($map['parentsinfo'])) { - $parent = json_decode($map['parentsinfo'],TRUE); - unset($map['parentsinfo']); - } - if(!empty($map['currentDisplay'])) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $currentDisplay = $map['currentDisplay']; unset($map['currentDisplay']); } @@ -7234,7 +4304,6 @@ public function iosDetailExcelInfo($id,$map) { } $xlsData = []; foreach ($records as $key1 => $value1) { -<<<<<<< HEAD $value1['account'] = encryption($value1['account']); $xlsData[] = $value1; } @@ -7293,65 +4362,6 @@ public function iosDetailExcelInfo($id,$map) { unset($map['costend']); $nowTime = strtotime(date('Y-m-d 00:00:00', time())); $subMap['create_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]]; -======= - $value1['account'] = $this->encryption($value1['account']); - $xlsData[] = $value1; - } - $this->exportExcel($xlsName, $xlsCell, $xlsData,$tid); - } - - public function userRechargeExcelInfo($id,$map) { - $xlsName = "充值玩家"; - $xlsCell = array( - '玩家账号', - '游戏名称', - '游戏区服', - '平台', - '角色名', - '充值总额', - '充值次数', - '今日充值', - '未登录天数', - '游戏累计登陆天数', - '注册时间', - '最后登录时间', - '推广员账号', - - ); - $records = recordPromoteLogs('数据管理','充值玩家导出'); - $subMap = []; - if(!empty($map['game_id'])) { - $subMap['game_id'] = $map['game_id']; - $map['uc.game_id'] = $map['game_id']; - unset($map['game_id']); - } - if(!empty($map['server_id'])) { - $subMap['server_id'] = $map['server_id']; - $map['ui.server_id'] = $map['server_id']; - unset($map['server_id']); - } - if(!empty($map['role_name'])) { - $map['ui.role_name'] = $map['role_name']; - unset($map['role_name']); - } - - if(!empty($map['user_account'])) { - $userId = M('user', 'tab_')->where(array('account' => $map['user_account']))->getField('id'); - $userId = $userId ?? 0; - $map['uc.user_id'] = $userId; - unset($map['user_account']); - } - if(!empty($map['promote_id'])) { - $map['uc.promote_id'] = $map['promote_id']; - unset($map['promote_id']); - } - $costBegin = $map['costbegin']; - $costEnd = $map['costend']; - unset($map['costbegin']); - unset($map['costend']); - $nowTime = strtotime(date('Y-m-d 00:00:00', time())); - $subMap['create_time'] = ['between', [$map['begintime'], $map['endtime']-1]]; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($costBegin != '' || $costEnd != '') { $having = ''; if ($costBegin != '' && $costEnd != '') { @@ -7368,7 +4378,6 @@ public function iosDetailExcelInfo($id,$map) { ->buildSql(); $map['_string'] = 'ui.role_id in (' . $subQuery . ')'; } -<<<<<<< HEAD $secondDay = 24 * 3600 + 1; //$map['uc.create_time'] = ['between', [$map['begintime'], $map['endtime']-1]]; $map['uc.pay_time'] = ['between', [$map['begintime'], $map['endtime'] - 1]]; @@ -7384,28 +4393,10 @@ public function iosDetailExcelInfo($id,$map) { $spendMap['_string'] = 'today.user_id = uc.user_id and today.game_id = uc.game_id and today.server_id = uc.server_id and today.game_player_id = uc.game_player_id and today.promote_id = uc.promote_id'; $spendMap['today.pay_status'] = 1; $spendMap['today.pay_time'] = ['between', [$now, $nowTimeEnd]]; -======= - $secondDay = 24*3600 + 1; - //$map['uc.create_time'] = ['between', [$map['begintime'], $map['endtime']-1]]; - $map['uc.pay_time'] = ['between', [$map['begintime'], $map['endtime']-1]]; - unset($map['begintime']); - unset($map['endtime']); - $map['uc.pay_status'] = 1; - $fieldS = "sum(uc.pay_amount) recharge_cost, count(*) recharge_count, uc.user_id, uc.user_account, uc.promote_id, uc.promote_account, uc.game_name, uc.sdk_version, uc.server_name, SUBSTRING_INDEX(GROUP_CONCAT(uc.game_player_name order by uc.id desc), ',', 1) as game_player_name"; - $fieldUser = 'u.register_time, u.login_time'; - - $now = date('Y-m-d'); - $now = strtotime($now); - $nowTimeEnd = $now + 3600 * 24 - 1; - $spendMap['_string'] = 'today.user_id = uc.user_id and today.game_id = uc.game_id and today.server_id = uc.server_id and today.game_player_id = uc.game_player_id and today.promote_id = uc.promote_id'; - $spendMap['today.pay_status'] = 1; - $spendMap['today.pay_time'] = ['between', [$now, $nowTimeEnd]]; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map = $this->spendRepository->withIsCheck($map, 'uc.is_check'); $spendMap = $this->spendRepository->withIsCheck($spendMap, 'today.is_check'); -<<<<<<< HEAD $fieldToday = M('spend', 'tab_')->alias('today') ->field('sum(pay_amount) as recharge_cost_today') ->where($spendMap) @@ -7460,61 +4451,6 @@ public function iosDetailExcelInfo($id,$map) { $data = M()->alias('record') ->table($subQuery) ->limit(($i - 1) * $perSize, $perSize) -======= - $fieldToday = M('spend', 'tab_')->alias('today') - ->field('sum(pay_amount) as recharge_cost_today') - ->where($spendMap) - ->buildSql(); - - $loginRecordMap['lr.create_time'] = $map['uc.pay_time']; - $loginRecordMap['_string'] = 'lr.user_id = uc.user_id and lr.game_id = uc.game_id'; - $fieldLR = M('login_daily_record', 'tab_')->alias('lr') - ->field("count(*) as count") - ->where($loginRecordMap) - ->buildSql(); - //$field = $fieldUC . ',' . $fieldUI . ',' . $fieldLR . ' as user_game_login_count'; - $field = "$fieldS, $fieldUser, $fieldToday as recharge_cost_today, $fieldLR as user_game_login_count"; - $subQuery = M('spend', 'tab_')->alias('uc') - ->field($field) - // ->join('left join tab_user_play_info as ui on ui.user_id = uc.user_id and ui.game_id = uc.game_id and ui.server_id = uc.server_id and ui.role_id = uc.role_id') - ->join('join tab_user as u on u.id = uc.user_id') - ->where($map) - ->group('uc.game_player_id,uc.server_id,uc.game_id,uc.user_id') - ->buildSql(); - $roles = M()->alias('record') - ->table($subQuery) - ->select(); - $total = M('spend', 'tab_')->alias('uc') - ->field($fieldS) - ->where($map) - ->find(); - $map['uc.pay_time'] = $spendMap['today.pay_time']; - $total['recharge_cost_today'] = M('spend', 'tab_')->alias('uc') - ->field('sum(uc.pay_amount) as recharge_cost_today') - ->where($map) - ->find()['recharge_cost_today']; - $total['recharge_cost_today'] = empty($total['recharge_cost_today']) ? '0.00' :$total['recharge_cost_today']; - $csvFileName = $xlsName.'.csv'; - //设置好告诉浏览器要下载excel文件的headers - header('Content-Description: File Transfer'); - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - $fp = fopen('php://output', 'a');//打开output流 - mb_convert_variables('gb2312', 'UTF-8', $xlsCell); - fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = '100000';//从数据库获取总量,假设是十万 - $accessNum = count($roles)?:0 ; - - $perSize = 5000;//每次查询的条数 - $pages = ceil($accessNum / $perSize); - for($i = 1; $i <= $pages; $i++) { - $data = M()->alias('record') - ->table($subQuery) - ->limit(($i-1)*$perSize ,$perSize) ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a ->select(); if (count($data) > 0) { @@ -7524,7 +4460,6 @@ public function iosDetailExcelInfo($id,$map) { $promotes = index_by_column('id', $promotes); } -<<<<<<< HEAD foreach ($data as $key => $value) { // if (empty($value['user_account']) ) { // $value['user_account'] = $users[$value['user_id']] ?? ''; @@ -7535,40 +4470,19 @@ public function iosDetailExcelInfo($id,$map) { if ($value['sdk_version'] == 1) { $csvData['sdk_version'] = "Android"; } else if ($value['sdk_version'] == 2) { -======= - foreach($data as $key => $value) { - // if (empty($value['user_account']) ) { - // $value['user_account'] = $users[$value['user_id']] ?? ''; - // } - $csvData['user_account'] = empty($value['user_account']) ? '--' : encryption($value['user_account']); - $csvData['game_name'] = empty($value['game_name']) ? '--' :$value['game_name']; - $csvData['server_name'] = empty($value['server_name']) ? '--' :$value['server_name']; - if($value['sdk_version'] == 1) { - $csvData['sdk_version'] = "Android"; - }else if($value['sdk_version'] == 2) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $csvData['sdk_version'] = "ios"; } else { $csvData['sdk_version'] = "--"; } -<<<<<<< HEAD $csvData['game_player_name'] = empty($value['game_player_name']) ? '--' : $value['game_player_name']; -======= - $csvData['game_player_name'] = empty($value['game_player_name']) ? '--' :$value['game_player_name']; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $csvData['recharge_cost'] = empty($value['recharge_cost']) ? 0 : $value['recharge_cost']; $csvData['recharge_count'] = empty($value['recharge_count']) ? 0 : $value['recharge_count']; $csvData['recharge_cost_today'] = empty($value['recharge_cost_today']) ? 0 : $value['recharge_cost_today']; $csvData['unlogin_day'] = empty($value['login_time']) ? '--' : intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $value['login_time']))) / (24 * 3600)); $csvData['user_game_login_count'] = empty($value['user_game_login_count']) ? 0 : $value['user_game_login_count']; $csvData['create_time'] = empty($value['register_time']) ? '--' : date('Y-m-d H:i:s', $value['register_time']); -<<<<<<< HEAD $csvData['login_time'] = empty($value['login_time']) ? '--' : date('Y-m-d H:i:s', $value['login_time']); $csvData['promote_account'] = empty($value['promote_account']) ? '--' : $value['promote_account']; -======= - $csvData['login_time'] = empty($value['login_time']) ? '--' :date('Y-m-d H:i:s',$value['login_time']); - $csvData['promote_account'] = empty($value['promote_account']) ? '--' :$value['promote_account']; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if (isset($promotes[$value['promote_id']])) { $groupName = $promoteService->getGroupNameByChain($promotes[$value['promote_id']]['chain'], $value['promote_id']); if ($groupName) { @@ -7578,17 +4492,10 @@ public function iosDetailExcelInfo($id,$map) { mb_convert_variables('GBK', 'UTF-8', $csvData); fputcsv($fp, $csvData); $xlsData[] = $csvData; -<<<<<<< HEAD } unset($xlsData); ob_flush(); flush(); -======= - } - unset($xlsData); - ob_flush(); - flush(); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $allData['user_account'] = '合计'; $allData['game_name'] = '--'; @@ -7608,20 +4515,12 @@ public function iosDetailExcelInfo($id,$map) { $xlsData[] = $allData; fclose($fp); $this->backSuccessExport($id); -<<<<<<< HEAD } public function rechargeExcelInfo($id, $map) { $xlsName = "订单查询"; $xlsCell = array( -======= - } - - public function rechargeExcelInfo($id,$map) { - $xlsName = "订单查询"; - $xlsCell = array( ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a '玩家账号', '游戏订单', '订单金额', @@ -7637,17 +4536,10 @@ public function iosDetailExcelInfo($id,$map) { '下单时间', '到账时间', ); -<<<<<<< HEAD recordPromoteLogs('数据管理', '充值明细导出'); $model = M('spend', 'tab_'); if (!empty($map['tab_spend.pay_status'])) { $map['tab_spend.pay_status'] = $map['tab_spend.pay_status'] - 2; -======= - $records = recordPromoteLogs('数据管理','充值明细导出'); - $model = M('spend','tab_'); - if(!empty($map['tab_spend.pay_status'])) { - $map['tab_spend.pay_status'] = $map['tab_spend.pay_status'] -2 ; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $data1 = $model ->field('tab_spend.id') @@ -7656,7 +4548,6 @@ public function iosDetailExcelInfo($id,$map) { ->where($map) ->order('tab_spend.id desc') ->select(); -<<<<<<< HEAD $csvFileName = $xlsName . '.csv'; //设置好告诉浏览器要下载excel文件的headers header('Content-Description: File Transfer'); @@ -7830,202 +4721,6 @@ public function iosDetailExcelInfo($id,$map) { } private function getGroupPromotes($promote) -======= - $csvFileName = $xlsName.'.csv'; - //设置好告诉浏览器要下载excel文件的headers - header('Content-Description: File Transfer'); - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - $fp = fopen('php://output', 'a');//打开output流 - mb_convert_variables('gb2312', 'UTF-8', $xlsCell); - fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = count($data1)?:0 ; - $perSize = 5000;//每次查询的条数 - $pages = ceil($accessNum / $perSize); - - $promoteIdData = []; - $promoteData = []; - for($i = 1; $i <= $pages; $i++) { - $model = M('spend','tab_'); - $data = $model - ->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) - ->limit(($i-1)*$perSize ,$perSize) - ->order('tab_spend.id desc') - ->select(); - 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; - } - } - if (!empty($promoteIdData)) { - $promoteIdData = array_unique($promoteIdData); - $promoteData = M('promote', 'tab_')->where(array('id' => ['in',$promoteIdData]))->getField('id,account,real_name'); - } - foreach ($data as $key1 => $value1) { - $value1['pay_way'] = $this->payWay[$value1['pay_way']]; - $value1['p_p_proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')'; - $value1['p_proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')'; - $value1['proinfo'] = $value1['pro_account'].'('.$value1['pro_real_name'].')'; - // $value1['user_account'] = substr_replace($value1['user_account'],'************',3,12); - $value1['user_account'] = $this->encryption($value1['user_account']); - $value1['pay_order_number'] = $this->encryption($value1['pay_order_number']); - $value1['payed_time'] = ($value1['pay_status'] == 1) ? date('Y-m-d H:i:s', $value1['payed_time']) : '--'; - $value1['pay_status'] = isset(self::$payStatus[$value1['pay_status']]) ? self::$payStatus[$value1['pay_status']] : "未知状态"; - $value1['sdk_version'] = getSDKTypeName($value1['sdk_version']); - switch ($value1['level']) { - case 3: - $value1['p_p_pro_account'] = $promoteData[$value1['parent_id']]['account']; - $value1['p_p_pro_real_name'] = $promoteData[$value1['parent_id']]['real_name']; - $value1['p_pro_account'] = $value1['pro_account']; - $value1['p_pro_real_name'] = $value1['pro_real_name']; - break; - case 4: - $promoteIdData[] = $value1['parent_id']; - $chain = trim($value1['chain'], '/'); - $chainArr = explode('/', $chain); - $value1['p_p_pro_account'] = $promoteData[$chainArr[1]]['account']; - $value1['p_p_pro_real_name'] = $promoteData[$chainArr[1]]['real_name']; - $value1['p_pro_account'] = $promoteData[$value1['parent_id']]['account']; - $value1['p_pro_real_name'] = $promoteData[$value1['parent_id']]['real_name']; - break; - } - $value1['p_p_proinfo'] = $value1['p_p_pro_account'].'('.$value1['p_p_pro_real_name'].')'; //部门长 - $value1['p_proinfo'] = $value1['p_pro_account'].'('.$value1['p_pro_real_name'].')'; //组长 - unset($value1['p_p_pro_account']); - unset($value1['p_p_pro_real_name']); - unset($value1['p_pro_account']); - unset($value1['p_pro_real_name']); - - $csvData["user_account"] = $value1["user_account"]; - $csvData["pay_order_number"] = $value1["pay_order_number"]; - $csvData["pay_amount"] = $value1["pay_amount"]; - $csvData["pay_way"] = $value1["pay_way"]; - $csvData['pay_status'] = $value1['pay_status']; - $csvData["game_name"] = $value1["game_name"]; - $csvData["sdk_version"] = $value1['sdk_version']; - $csvData["server_name"] = $value1["server_name"]; - $csvData["game_player_name"] = $value1["game_player_name"]; - $csvData["p_p_proinfo"] = $value1["p_p_proinfo"]; - $csvData["p_proinfo"] = $value1["p_proinfo"]; - $csvData["proinfo"] = $value1["proinfo"]; - $csvData["spend_time"] = date('Y-m-d H:i:s', $value1["spend_time"]); - $csvData["payed_time"] = $value1["payed_time"]; - mb_convert_variables('GBK', 'UTF-8', $csvData); - fputcsv($fp, $csvData); - $xlsData[] = $csvData; - } - unset($xlsData); - ob_flush(); - flush(); - } - $income = '0.00'; - $income = M('Spend', 'tab_') - ->field('sum(tab_spend.pay_amount) as income') - ->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()['income']; - $csvData1["user_account"] = "合计"; - $csvData1["pay_order_number"] = "--"; - $csvData1["pay_amount"] = $income; - $csvData1["pay_way"] = "--"; - $csvData1['pay_status'] = "--"; - $csvData1["game_name"] = "--"; - $csvData1["sdk_version"] = "--"; - $csvData1["server_name"] = "--"; - $csvData1["game_player_name"] = "--"; - $csvData1["p_p_proinfo"] = "--"; - $csvData1["p_proinfo"] = "--"; - $csvData1["proinfo"] = "--"; - $csvData1["spend_time"] = "--"; - $csvData1["payed_time"] = "--"; - mb_convert_variables('GBK', 'UTF-8', $csvData1); - fputcsv($fp, $csvData1); - $xlsData[] = $csvData1; - fclose($fp); - $this->backSuccessExport($id); - } - - public function backSuccessExport($id) { //导出成功后 - if(!$id) { - - }else { - $res = M('downloadlog','tab_')->where(['id'=>$id])->select(); - $data = $res[0]; - $data['status'] = 1; - $data['begintime'] = time(); - $updateRs = M('downloadlog','tab_')->where(['id'=>$id])->save($data); - } - - } - /* - * 汇款证明 - * */ - public function Remittancecer() { - $id = $_REQUEST["id"]; - $model = M("withdraw","tab_"); - $res = $model->where(['id'=>$id])->field('transfer_proof,status')->find(); - $transfer_proof = intval($res["transfer_proof"]); - $map = ['id'=>$transfer_proof]; - $addtime = time(); - $conditions = json_encode($map,TRUE); - $data = [ - 'logid' => 'remitrecord_'.time(), - 'promote_id' => PID, - 'type' => '/Home/Finance/withdrawRecord', - 'dataname' => '汇款证明', - 'status' => 0, - 'addtime' => $addtime, - 'begintime' => 0, - 'content' => '', - 'conditions' =>$conditions, - ]; - $log = M('downloadlog','tab_')->add($data); - if (!$log) { - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); - - - } - - - - - - public function encryptDecrypt($key, $string, $decrypt){ - if($decrypt){ - $decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), "12"); - return $decrypted; - }else{ - $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key)))); - return $encrypted; - } - } - -// public function getLoginPromote() -// { -// $promoteId = session('promote_auth.pid'); -// return M('promote', 'tab_')->where(['id' => $promoteId])->find(); -// } - - private function getGroupPromotes($promote) ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a { $promotes = []; if ($promote['parent_id'] == 0) { @@ -8033,7 +4728,6 @@ public function iosDetailExcelInfo($id,$map) { } return $promotes; } -<<<<<<< HEAD public function paginate($query, $defaultPageSize = 10, $defaultPage = 1) { @@ -8053,32 +4747,6 @@ public function iosDetailExcelInfo($id,$map) { return M('apply', 'tab_')->field(['game_id', 'game_name'])->where(['promote_id' => $promote['id']])->select(); } -======= - - public function paginate($query, $defaultPageSize = 10, $defaultPage = 1) - { - $page = I('get.p', $defaultPage); - $pageSize = I('get.row', $defaultPageSize); - - $countQuery = clone $query; - $count = $countQuery->count(); - $records = $query->page($page, $pageSize)->select(); - - $params = [ - 'p' => $page, - 'row' => $pageSize - ]; - $pagination = set_pagination($count, $pageSize); - - return [$records, $pagination, $count]; - } - - private function getGamesByPromote($promote) - { - return M('apply', 'tab_')->field(['game_id', 'game_name'])->where(['promote_id' => $promote['id']])->select(); - } - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a private function getBetweenTime($time, $defaultBegin = 0, $defaultEnd = 0) { $delimiter = ' 至 '; @@ -8096,22 +4764,13 @@ public function iosDetailExcelInfo($id,$map) { } return [$begin, $end]; } -<<<<<<< HEAD private function getQueryPromote($levelPromote) -======= - - private function getQueryPromote($levelPromote) ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a { $queryPromote = null; $promote = $this->getLoginPromote(); $queryPromoteId = 0; -<<<<<<< HEAD foreach ($levelPromote as $item) { -======= - foreach($levelPromote as $item) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($item != 0) { $queryPromoteId = $item; } @@ -8138,13 +4797,8 @@ public function iosDetailExcelInfo($id,$map) { } } } -<<<<<<< HEAD private function getLevelPromote() -======= - - private function getLevelPromote() ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a { $levelPromote = []; $levelPromote[] = I('level_promote_2', 0); @@ -8152,11 +4806,7 @@ public function iosDetailExcelInfo($id,$map) { $levelPromote[] = I('level_promote_4', 0); return $levelPromote; } -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a private function getDayList($beginTime, $endTime) { $dayList = []; @@ -8167,11 +4817,7 @@ public function iosDetailExcelInfo($id,$map) { return $dayList; } -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a private function assembleRecords($items, $keys, $valueColumn, $keyColumn = 'day') { $records = []; @@ -8187,7 +4833,6 @@ public function iosDetailExcelInfo($id,$map) { return $records; } -<<<<<<< HEAD public function encryption($string) { $orderLen = strlen($string); @@ -8203,22 +4848,6 @@ public function iosDetailExcelInfo($id,$map) { } return substr($string, 0, $strLen) . $hideChar . substr($string, $orderLen - $strLen); -======= - public function encryption($string) { - $orderLen = strlen($string); - $strLen = 3; - $hideChar = ''; - - if($orderLen <=8) { - $strLen = 2; - } - - for($i = 0;$i<$orderLen-$strLen*2;$i++) { - $hideChar .='*'; - } - - return substr($string, 0, $strLen) . $hideChar . substr($string, $orderLen-$strLen); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } private function getGame($map = []) @@ -8275,30 +4904,17 @@ public function iosDetailExcelInfo($id,$map) { * 汇总单信息 * @author sunke */ -<<<<<<< HEAD public function Withdraw_index_export() { $map = []; $map["promote.id"] = get_pid(); $map['tab_company_statement_info.company_type'] = ['in', "1,2"]; -======= - public function Withdraw_index_export() { - - $map = []; - -// $map['pay_time'] = strtotime($_REQUEST['start_time']); - - $map["promote.id"] = get_pid(); - $map['tab_company_statement_info.company_type'] = ['in',"1,2"]; -// $map['pay_type'] = 1; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($_REQUEST['pay_status'] || $_REQUEST['pay_status'] == '0') { $map['pay_status'] = $_REQUEST['pay_status']; } -<<<<<<< HEAD if (!empty($_REQUEST['start']) && empty($_REQUEST['end'])) { $map['statement_begin_time'] = array('GT', strtotime($_REQUEST['start'])); unset($_REQUEST['start']); @@ -8318,26 +4934,6 @@ public function iosDetailExcelInfo($id,$map) { $addtime = time(); $data = [ 'logid' => 'withdraw_' . time(), -======= - if(!empty($_REQUEST['start'])&&empty($_REQUEST['end'])){ - $map['statement_begin_time'] = array('GT',strtotime($_REQUEST['start'])); - unset($_REQUEST['start']); - } - if(empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){ - $map['statement_end_time'] = array('LT',strtotime($_REQUEST['end'])+24*60*60-1); - unset($_REQUEST['end']); - } - if(!empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){ - $map['statement_begin_time'] = array('GT',strtotime($_REQUEST['start'])); - $map['statement_end_time'] = array('LT',strtotime($_REQUEST['end'])+24*60*60-1); - unset($_REQUEST['start']);unset($_REQUEST['end']); - } - - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'withdraw_'.time(), ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'promote_id' => PID, 'type' => '/Home/Withdraw/index', 'dataname' => '汇总单信息', @@ -8345,7 +4941,6 @@ public function iosDetailExcelInfo($id,$map) { 'addtime' => $addtime, 'begintime' => 0, 'content' => '', -<<<<<<< HEAD 'conditions' => $conditions ]; $res = M('downloadlog', 'tab_')->add($data); @@ -8358,20 +4953,6 @@ public function iosDetailExcelInfo($id,$map) { public function WithdrawIndexExcelInfo($id, $map) { $xlsName = "汇总单信息"; -======= - 'conditions' =>$conditions - ]; - $res = M('downloadlog','tab_')->add($data); - if (!$res) { - // $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res)); - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); - } - - public function WithdrawIndexExcelInfo($id,$map) { - $xlsName ="汇总单信息"; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $xlsCell = array( '结算时间', '结算金额', @@ -8380,18 +4961,13 @@ public function iosDetailExcelInfo($id,$map) { '提现状态', ); -<<<<<<< HEAD $count = M("company_statement_info", "tab_") -======= - $count = M("company_statement_info","tab_") ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a ->field("tab_company_statement_info.*") ->join("left join tab_promote_company company on tab_company_statement_info.company_id=company.id") ->join("left join tab_promote promote on company.id=promote.company_id") ->where($map) ->count(); -<<<<<<< HEAD $csvFileName = $xlsName . '.csv'; header('Content-Description: File Transfer'); header('Content-Type: application/vnd.ms-excel'); @@ -8407,23 +4983,6 @@ public function iosDetailExcelInfo($id,$map) { $pages = ceil($accessNum / $perSize); for ($i = 1; $i <= $pages; $i++) { $data = M("company_statement_info", "tab_") -======= - $csvFileName = $xlsName.'.csv'; - header('Content-Description: File Transfer'); - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - $fp = fopen('php://output', 'a');//打开output流 - mb_convert_variables('gb2312', 'UTF-8', $xlsCell); - fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = $count ; - $perSize = 5000;//每次查询的条数 - $pages = ceil($accessNum / $perSize); - for($i = 1; $i <= $pages; $i++) { - $data = M("company_statement_info","tab_") ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a ->field("tab_company_statement_info.statement_begin_time time, tab_company_statement_info.statement_money, tab_company_statement_info.pool_id, @@ -8431,17 +4990,12 @@ public function iosDetailExcelInfo($id,$map) { tab_company_statement_info.pay_status") ->join("left join tab_promote_company company on tab_company_statement_info.company_id=company.id") ->join("left join tab_promote promote on company.id=promote.company_id") -<<<<<<< HEAD ->limit(($i - 1) * $perSize, $perSize) -======= - ->limit(($i-1)*$perSize ,$perSize) ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a ->where($map) ->select(); foreach ($data as $key => $value) { -<<<<<<< HEAD $value['time'] = date("Y-m-d H:i:s", $value["statement_begin_time"]) . "-" . date("Y-m-d H:i:s", $value["statement_end_time"]); if ($value['pay_status'] == '-1') { @@ -8449,15 +5003,6 @@ public function iosDetailExcelInfo($id,$map) { } elseif ($value['pay_status'] == '0') { $value['pay_status'] = '未打款'; } elseif ($value['pay_status'] == '1') { -======= - $value['time'] = date("Y-m-d H:i:s",$value["statement_begin_time"])."-".date("Y-m-d H:i:s",$value["statement_end_time"]); - - if ($value['pay_status'] == '-1') { - $value['pay_status'] = '打款失败'; - } elseif($value['pay_status'] == '0') { - $value['pay_status'] = '未打款'; - } elseif($value['pay_status'] == '1') { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $value['pay_status'] = '打款成功'; } @@ -8477,19 +5022,14 @@ public function iosDetailExcelInfo($id,$map) { * 结算单详情 * @author sunke */ -<<<<<<< HEAD public function Withdraw_order_export() { -======= - public function Withdraw_order_export() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $start = $_REQUEST['start']; $end = $_REQUEST['end']; $game_map['relation_game_id'] = $_REQUEST['relation_game_id']; -<<<<<<< HEAD $game_id = M("game", "tab_")->field("id")->where($game_map)->select(); $promote_data = []; @@ -8539,57 +5079,6 @@ public function iosDetailExcelInfo($id,$map) { $addtime = time(); $data = [ 'logid' => 'withdraw_order_' . time(), -======= - $game_id = M("game","tab_")->field("id")->where($game_map)->select(); - - $promote_data = []; - $promote_id = M("promote","tab_")->field("id")->where(['company_id'=>$_REQUEST['company_id']])->select(); - foreach ($promote_id as $key => $value) { - $promote_data[] = $value['id']; - $data = M("promote","tab_")->field("id")->where(['chain'=>['like',"/{$value['id']}/"]])->select(); - foreach ($data as $k => $v) { - $promote_data[] = $v['id']; - } - - } - - if ($promote_data) { - $map['promote_id'] = ['in',$promote_data]; - } - - $game_id = array_column($game_id,'id'); - - $map['pay_status'] = 1; - $map['pay_time'] = ['between',[strtotime($start),strtotime($end)+86399]]; - $map['game_id'] = ['in',$game_id]; - - - if ($_REQUEST['team_leader_id']) { - $promote_id = M("promote","tab_")->field("id")->where("id = {$_REQUEST['team_leader_id']} or chain like '%/{$_REQUEST['team_leader_id']}/%'")->select(); - $map['promote_id'] = ['in',array_column($promote_id,'id')]; - } - - if(!empty($_REQUEST['start'])&&empty($_REQUEST['end'])){ - $map['pay_time'] = array('GT',strtotime($_REQUEST['start'])); - unset($_REQUEST['start']); - } - if(empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){ - $map['pay_time'] = array('LT',strtotime($_REQUEST['end'])+24*60*60-1); - unset($_REQUEST['end']); - } - if(!empty($_REQUEST['start'])&&!empty($_REQUEST['end'])){ - $map['pay_time'] = array('between',[strtotime($_REQUEST['start']),strtotime($_REQUEST['end'])+24*60*60-1]); - unset($_REQUEST['start']);unset($_REQUEST['end']); - } - if($_REQUEST['pay_order_number']) { - $map['pay_order_number'] = ['like',"%{$_REQUEST['pay_order_number']}%"]; - } - - $conditions = json_encode($map,TRUE); - $addtime = time(); - $data = [ - 'logid' => 'withdraw_order_'.time(), ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'promote_id' => PID, 'type' => '/Home/Withdraw/withdrawOrderDetail', 'dataname' => '结算单明细', @@ -8597,7 +5086,6 @@ public function iosDetailExcelInfo($id,$map) { 'addtime' => $addtime, 'begintime' => 0, 'content' => '', -<<<<<<< HEAD 'conditions' => $conditions ]; $res = M('downloadlog', 'tab_')->add($data); @@ -8610,20 +5098,6 @@ public function iosDetailExcelInfo($id,$map) { public function WithdrawOrderExcelInfo($id, $map) { $xlsName = "结算单明细"; -======= - 'conditions' =>$conditions - ]; - $res = M('downloadlog','tab_')->add($data); - if (!$res) { - // $this->ajaxReturn(array("status" => -1, "msg" => "添加导出日志失败", 'ret' => $res)); - $this->error('添加下载失败'); - } - $this->success('添加下载成功',U('listsIndex')); - } - - public function WithdrawOrderExcelInfo($id,$map) { - $xlsName ="结算单明细"; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $xlsCell = array( '游戏订单号', '游戏', @@ -8633,7 +5107,6 @@ public function iosDetailExcelInfo($id,$map) { '充值时间', ); -<<<<<<< HEAD $count = M("spend", "tab_") ->where($map) ->count(); @@ -8657,40 +5130,11 @@ public function iosDetailExcelInfo($id,$map) { ->field("pay_order_number,game_name,user_account,promote_account,pay_amount,pay_time") ->where($map) ->limit(($i - 1) * $perSize, $perSize) -======= - $count = M("spend","tab_") - ->where($map) - ->count(); - - $csvFileName = $xlsName.'.csv'; - header('Content-Description: File Transfer'); - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment; filename="'. $csvFileName .'"'); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - $fp = fopen('php://output', 'a');//打开output流 - mb_convert_variables('gb2312', 'UTF-8', $xlsCell); - fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = $count ; - $perSize = 5000;//每次查询的条数 - $pages = ceil($accessNum / $perSize); - for($i = 1; $i <= $pages; $i++) { - - $data = M("spend","tab_") - ->field("pay_order_number,game_name,user_account,promote_account,pay_amount,pay_time") - ->where($map) - ->limit(($i-1)*$perSize ,$perSize) ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a ->select(); foreach ($data as $key => $value) { -<<<<<<< HEAD $value['pay_time'] = date("Y-m-d H:i:s", $data[$key]['pay_time']); -======= - $value['pay_time'] = date("Y-m-d H:i:s",$data[$key]['pay_time']); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($value['promote_account'] == "官方渠道") { $value['promote_account'] = "江息网络"; } @@ -8709,13 +5153,8 @@ public function iosDetailExcelInfo($id,$map) { public function multisort($records, $column, $type = 'asc') { $length = count($records); -<<<<<<< HEAD for ($i = 0; $i < $length; $i++) { for ($j = $i + 1; $j < $length; $j++) { -======= - for ($i = 0; $i < $length; $i ++) { - for ($j = $i + 1; $j < $length; $j ++) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($type == 'asc') { if ($records[$i][$column] > $records[$j][$column]) { $temp = $records[$i]; @@ -8734,7 +5173,6 @@ public function iosDetailExcelInfo($id,$map) { return $records; } -<<<<<<< HEAD public function userretentionExcelInfo($id, $map) { $xlsName = "用户留存率"; @@ -8754,27 +5192,6 @@ public function iosDetailExcelInfo($id,$map) { array('retention_day30', '30日留存'), ); recordPromoteLogs('数据管理', '用户留存率导出'); -======= - public function userretentionExcelInfo($id,$map) - { - $xlsName = "用户留存率"; - $xlsCell = array( - array('date','日期'), - array('game_name','游戏名称'), - array('promote_name','渠道名称'), - array('register_count','新增玩家'), - array('retention_day1', '1日留存'), - array('retention_day2', '2日留存'), - array('retention_day3', '3日留存'), - array('retention_day4', '4日留存'), - array('retention_day5', '5日留存'), - array('retention_day6', '6日留存'), - array('retention_day7', '7日留存'), - array('retention_day15', '15日留存'), - array('retention_day30', '30日留存'), - ); - $records = recordPromoteLogs('数据管理', '用户留存率导出'); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map = json_decode(json_encode($map), true); $baseGameId = $map['base_game_id']; @@ -8807,11 +5224,7 @@ public function iosDetailExcelInfo($id,$map) { 'game_ids' => $gameIds, ] ]); -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $result = (string)$response->getBody(); $result = json_decode($result, true); if (!$result) { @@ -8821,28 +5234,17 @@ public function iosDetailExcelInfo($id,$map) { $dayList = [1, 2, 3, 4, 5, 6, 7, 15, 30]; $gameName = $deviceType ? get_game_name($searchGameId) : $baseGame['name']; $promoteName = '全部'; -<<<<<<< HEAD if ($queryPromoteId) { $promoteName = get_promote_account($queryPromoteId); -======= - if ($promoteId) { - $promoteName = get_promote_account($promoteId); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } foreach ($data as $key => $item) { $item['promote_name'] = $promoteName; $item['game_name'] = $gameName; foreach ($dayList as $day) { if ($item['register_count'] > 0) { -<<<<<<< HEAD $item['retention_day' . $day] = round($item['retention_day' . $day] / $item['register_count'], 4) * 100; } else { $item['retention_day' . $day] = '--'; -======= - $item['retention_day'. $day] = round($item['retention_day'. $day]/$item['register_count'], 4)*100; - } else { - $item['retention_day'. $day] = '--'; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } } $data[$key] = $item; @@ -8853,10 +5255,6 @@ public function iosDetailExcelInfo($id,$map) { foreach ($data as $key => $item) { foreach ($dayList as $day) { if ($item['retention_day' . $day] === '--') { -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } else { $item['retention_day' . $day] .= '%'; } @@ -8866,7 +5264,6 @@ public function iosDetailExcelInfo($id,$map) { $this->exportExcel($xlsName, $xlsCell, $data, $id); } -<<<<<<< HEAD public function gameDataExcelInfo($id, $map) { $xlsName = "游戏分区数据汇总"; @@ -8877,18 +5274,6 @@ public function iosDetailExcelInfo($id,$map) { array('amount', '消费金额'), ); recordPromoteLogs('数据管理', '游戏分区数据汇总'); -======= - public function gameDataExcelInfo($id,$map) - { - $xlsName = "游戏分区数据汇总"; - $xlsCell = array( - array('game_name','游戏名称'), - array('server_name','区服名称'), - array('count','创角数'), - array('amount', '消费金额'), - ); - $records = recordPromoteLogs('数据管理', '游戏分区数据汇总'); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map = json_decode(json_encode($map), true); $spendSubSql = $map['spendSubSql']; @@ -8914,7 +5299,3 @@ public function iosDetailExcelInfo($id,$map) { $this->exportExcel($xlsName, $xlsCell, $data, $id); } } -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a diff --git a/Application/Home/Controller/HomeController.class.php b/Application/Home/Controller/HomeController.class.php index 7e3cfad5b..3e31a3eb5 100644 --- a/Application/Home/Controller/HomeController.class.php +++ b/Application/Home/Controller/HomeController.class.php @@ -208,13 +208,10 @@ class HomeController extends Controller $this->error('该链接已失效'); } -<<<<<<< HEAD if (in_array($gameId, [277, 278])) { $this->error('该游戏链接已失效'); } -======= ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $promoteService = new PromoteService(); if (!$promoteService->checkPromoteLimitRule($promote)) { $this->error('链接已失效'); @@ -328,12 +325,9 @@ class HomeController extends Controller if(in_array($game['id'], [191, 192])) { $game['relation_game_name'] = '九灵神域'; } -<<<<<<< HEAD if(in_array($game['id'], [282, 283])) { $game['relation_game_name'] = '逍遥官老爷'; } -======= ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $this->assign("serviceQQ", $serviceQQ); $this->assign('isNewIos', $isNewIos); diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index fac9900c2..07c75637f 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -54,28 +54,16 @@ class QueryController extends BaseController $userAccount = trim(I('user_account', '')); $payOrderNumber = trim(I('pay_order_number', '')); $nowTime = date('Y-m-d'); -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $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'); -<<<<<<< HEAD $begTime = strtotime($initBegTime); $endTime = strtotime($initEndTime); $endTime += 3600 * 24; -======= - - $begTime = strtotime($initBegTime); - $endTime = strtotime($initEndTime); - $endTime += 3600 * 24; - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $payedBegTime = I("payed_begtime", ''); if ($payedBegTime) $payedBegTime = strtotime($payedBegTime); $payedEndTime = I("payed_endtime", ''); @@ -90,11 +78,7 @@ class QueryController extends BaseController $endTime = 0; } } -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); $loginPromote = $this->getLoginPromote(); @@ -152,25 +136,16 @@ class QueryController extends BaseController if ($payedBegTime && $payedEndTime) { $map['tab_spend.payed_time'] = ['between', [$payedBegTime, $payedEndTime - 1]]; } -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map = $this->spendRepository->withIsCheck($map, 'tab_spend.is_check'); $data = []; $count = 0; $income = '0.00'; -<<<<<<< HEAD if ( intval($endTime - $begTime) / (24 * 3600) <= 31 || intval($payedEndTime - $payedBegTime) / (24 * 3600) <= 31 ) { -======= - if (intval($endTime - $begTime) / (24 * 3600) <= 31 - || intval($payedEndTime - $payedBegTime) / (24 * 3600) <= 31) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $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') @@ -211,11 +186,7 @@ class QueryController extends BaseController $promoteData = []; if (!empty($promoteIdData)) { $promoteIdData = array_unique($promoteIdData); -<<<<<<< HEAD $promoteData = M('promote', 'tab_')->where(array('id' => ['in', $promoteIdData]))->getField('id,account,real_name,group_remark'); -======= - $promoteData = M('promote', 'tab_')->where(array('id' => ['in',$promoteIdData]))->getField('id,account,real_name,group_remark'); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } foreach ($data as &$list) { switch ($list['level']) { @@ -244,34 +215,12 @@ class QueryController extends BaseController $list['p_pro_group_remark'] = $promoteData[$list['parent_id']]['group_remark']; break; } -<<<<<<< HEAD $list['user_account'] = getUserAccountOfPromote($list['user_account'], $loginPromote); -======= - $list['user_account'] = substr($list['user_account'], 0, 2) . '******' . substr($list['user_account'], 8); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $list['spend_time'] = date('Y-m-d H:i:s', $list['spend_time']); $list['pay_time'] = ($list['pay_status'] == 1) ? date('Y-m-d H:i:s', $list['pay_time']) : '--'; $list['pay_status'] = isset(QueryController::$payStatus[$list['pay_status']]) ? QueryController::$payStatus[$list['pay_status']] : '未知状态'; $list['sdk_version'] = getSDKTypeName($list['sdk_version']); -<<<<<<< HEAD $list['pay_order_number'] = hideOrderNumber($list['pay_order_number']); -======= - - //订单隐藏算法 - $orderLen = strlen($list['pay_order_number']); - $strLen = 4; - $hideChar = ''; - - if ($orderLen <= 8) { - $strLen = 2; - } - - for ($i = 0; $i < $orderLen - $strLen * 2; $i++) { - $hideChar .= '*'; - } - - $list['pay_order_number'] = substr($list['pay_order_number'], 0, $strLen) . $hideChar . substr($list['pay_order_number'], $orderLen - $strLen); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } } @@ -320,11 +269,7 @@ class QueryController extends BaseController { $page = intval(I('p', 1)); $row = intval(I('row', 10)); -<<<<<<< HEAD $ownId = intval(I('own_id'), 0); //本账号 -======= - $ownId = intval(I('own_id'), 0);//本账号 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $account = trim(I('account', '')); $id = intval(I('id', 0)); $nowTime = date('Y-m-d'); @@ -381,7 +326,6 @@ class QueryController extends BaseController ->where($loginMap) ->order('login_time desc') ->find(); -<<<<<<< HEAD $list['new_login_time'] = date('Y-m-d H:i:s', $newLoginData['login_time']); $list['new_login_ip'] = $newLoginData['login_ip']; @@ -389,16 +333,6 @@ class QueryController extends BaseController if (!empty($list['device_number'])) { $list['device_number'] = encryption($list['device_number']); } -======= - - $list['new_login_time'] = date('Y-m-d H:i:s', $newLoginData['login_time']); - $list['new_login_ip'] = $newLoginData['login_ip']; - $list['account'] = substr($list['account'], 0, 2) . '******' . substr($list['account'], 8); - if(!empty($list['device_number'])) { - $list['device_number'] = encryption($list['device_number']); - } - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } } @@ -648,10 +582,6 @@ class QueryController extends BaseController $promote_child = get_sub_channel_id($chid, PRO_GRADE + 1); $map['s.promote_id'] = $mapp['u.promote_id'] = array('in', $promote_child); -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } else { $promote_child = get_zi_promote_id(PID); if (empty($promote_child)) { @@ -671,18 +601,10 @@ class QueryController extends BaseController $mmap = array($mapp, $map); $user = A('User', 'Event'); $user->check_child_bill($model, $p, $mmap); -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } else { $this->meta_title = '子渠道结算'; $this->display(); } -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } public function generatesub() @@ -778,10 +700,6 @@ class QueryController extends BaseController public function son_apply_withdraw($settlement_number = '') { $map['settlement_number'] = $settlement_number; -<<<<<<< HEAD -======= - $with_map['settlement_number'] = $totalSett['settlement_number']; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $result = M("SonSettlement", "tab_")->where($map)->save(array('ti_status' => 0)); if ($result !== false) { echo json_encode(array("status" => 1)); @@ -793,10 +711,6 @@ class QueryController extends BaseController public function audit_withdraw($settlement_number = '') { $map['settlement_number'] = $settlement_number; -<<<<<<< HEAD -======= - $with_map['settlement_number'] = $totalSett['settlement_number']; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $result = M("SonSettlement", "tab_")->where($map)->save(array('ti_status' => 1)); if ($result !== false) { $this->success('审核成功'); @@ -1031,10 +945,6 @@ class QueryController extends BaseController $map_list['promote_id'] = array('in', $pro_arr); $promote_id = implode(',', $pro_arr); $join .= " AND u.promote_id in ({$promote_id})"; -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $spend2 = D('Spend'); $data = M('Apply', 'tab_')->field('game_id, game_name')->where(['promote_id' => $promote_id])->order('game_id desc')->select(); @@ -1152,10 +1062,6 @@ class QueryController extends BaseController { $this->meta_title = '留存统计'; A('User', 'Event')->retention_analysis(); -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } public function details() @@ -1202,11 +1108,7 @@ class QueryController extends BaseController $loginPromote = $this->getLoginPromote(); -<<<<<<< HEAD $ownId = intval(I('own_id'), 0); //本账号 -======= - $ownId = intval(I('own_id'), 0);//本账号 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($ownId) { $params['promote_id'] = $queryPromote['id']; } else { @@ -1248,7 +1150,6 @@ class QueryController extends BaseController if (intval($endTime - $begTime) / (24 * 3600) <= 31) { $userRepository = new UserRepository(); $spendRepository = new SpendRepository(); -<<<<<<< HEAD $roleNumList = $userRepository->getCreateRoleCountByDay($params); //创角数 $userNumList = $userRepository->getCreateRoleUserCountByDay($params); //创角用户 $newUserNumList = $userRepository->getNewCreateRoleUserCountByDay($params); //新创角用户 @@ -1265,24 +1166,6 @@ class QueryController extends BaseController $spendGenericList = $spendRepository->getPayAmountGroupByDayAndType($params); //通用币充值 $params['pay_way'] = -1; $spendBindingList = $spendRepository->getPayAmountGroupByDayAndType($params); //绑定币充值 -======= - $roleNumList = $userRepository->getCreateRoleCountByDay($params);//创角数 - $userNumList = $userRepository->getCreateRoleUserCountByDay($params);//创角用户 - $newUserNumList = $userRepository->getNewCreateRoleUserCountByDay($params);//新创角用户 - $newDeviceNumList = $userRepository->getNewCreateRoleDeviceCountByDay($params);//新创角设备 - $newIpNumList = $userRepository->getNewCreateRoleIpCountByDay($params);//新创角IP - $loginUserNumList = $userRepository->getLoginCountGroupByDayNew($params);//登录用户数 - if ($this->canViewUserRecharge) { - $spendUserNumList = $spendRepository->getPayUserCountGroupByDayNew($params);//充值人数 - $spendNumList = $spendRepository->getPayCountGroupByDay($params);//充值次数 - $spendAllAmountList = $spendRepository->getPayAmountGroupByDayAndType($params);//充值总额 - $params['pay_way'] = ['in', '1,2,3,4,5,6']; - $spendCashList = $spendRepository->getPayAmountGroupByDayAndType($params);//现金充值 - $params['pay_way'] = 0; - $spendGenericList = $spendRepository->getPayAmountGroupByDayAndType($params);//通用币充值 - $params['pay_way'] = -1; - $spendBindingList = $spendRepository->getPayAmountGroupByDayAndType($params);//绑定币充值 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $allData['role_num'] = 0; @@ -1375,11 +1258,7 @@ class QueryController extends BaseController $page = intval(I('get.p', 1)); $page = $page ? $page : 1; //默认显示第一页数据arraypage $row = intval(I('get.row', 10)); -<<<<<<< HEAD $ownId = intval(I('own_id'), 0); //本账号 -======= - $ownId = intval(I('own_id'), 0);//本账号 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $relationGameId = intval(I('relation_game_id', 0)); $sdkVersion = intval(I('sdk_version', 0)); $serverId = I('server_id', ''); @@ -1405,15 +1284,9 @@ class QueryController extends BaseController $parameter['own_id'] = $ownId; $parameter['p'] = $page; $parameter['row'] = $row; -<<<<<<< HEAD $loginPromote = $this->getLoginPromote(); -======= - - $loginPromote = $this->getLoginPromote(); - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map = []; $map = ['_string' => '1=1']; if ($ownId) { @@ -1436,27 +1309,16 @@ class QueryController extends BaseController $params['begin_time'] = $begTime; $params['end_time'] = $endTime - 1; -<<<<<<< HEAD $promoteService = new PromoteService(); $allGameIs = $promoteService->getHistoryGameIds($loginPromote); -======= - - $promoteService = new PromoteService(); - $allGameIs = $promoteService->getHistoryGameIds($loginPromote); - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($allGameIs && count($allGameIs) > 0) { $map['_string'] .= ' and id in(' . implode(',', $allGameIs) . ')'; } else { $map['_string'] .= '1=0'; } -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $data = M('game', 'tab_')->where($map)->order('sort desc,id desc')->page($page, $row)->select(); $count = M('game', 'tab_')->where($map)->count(); $records = []; @@ -1468,7 +1330,6 @@ class QueryController extends BaseController $userRepository = new UserRepository(); $spendRepository = new SpendRepository(); -<<<<<<< HEAD $roleNumList = $userRepository->getCreateRoleCountByGame($params); //创角数 $userNumList = $userRepository->getCreateRoleUserCountByGame($params); //创角用户 $newUserNumList = $userRepository->getNewCreateRoleUserCountByGame($params); //新创角用户 @@ -1485,24 +1346,6 @@ class QueryController extends BaseController $spendGenericList = $spendRepository->getPayAmountGroupByGameAndType($params); //通用币充值 $params['pay_way'] = -1; $spendBindingList = $spendRepository->getPayAmountGroupByGameAndType($params); //绑定币充值 -======= - $roleNumList = $userRepository->getCreateRoleCountByGame($params);//创角数 - $userNumList = $userRepository->getCreateRoleUserCountByGame($params);//创角用户 - $newUserNumList = $userRepository->getNewCreateRoleUserCountByGame($params);//新创角用户 - $newDeviceNumList = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备 - $newIpNumList = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP - $loginUserNumList = $userRepository->getLoginCountGroupByGame($params);//登录用户数 - if ($this->canViewUserRecharge) { - $spendUserNumList = $spendRepository->getPayUserCountGroupByGame($params);//充值人数 - $spendNumList = $spendRepository->getPayCountGroupByGame($params);//充值次数 - $spendAllAmountList = $spendRepository->getPayAmountGroupByGameAndType($params);//充值总额 - $params['pay_way'] = ['in', '1,2,3,4,5,6']; - $spendCashList = $spendRepository->getPayAmountGroupByGameAndType($params);//现金充值 - $params['pay_way'] = 0; - $spendGenericList = $spendRepository->getPayAmountGroupByGameAndType($params);//通用币充值 - $params['pay_way'] = -1; - $spendBindingList = $spendRepository->getPayAmountGroupByGameAndType($params);//绑定币充值 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } foreach ($data as $list) { $gameId = $list['id']; @@ -1532,7 +1375,6 @@ class QueryController extends BaseController } $params['all_data'] = 1; $params['game_ids'] = $allGameIs; -<<<<<<< HEAD $allData['role_num'] = $userRepository->getCreateRoleCountByGame($params); //创角数 $allData['user_num'] = $userRepository->getCreateRoleUserCountByGame($params); //创角用户 $allData['new_user_num'] = $userRepository->getNewCreateRoleUserCountByGame($params); //新创角用户 @@ -1550,25 +1392,6 @@ class QueryController extends BaseController $allData['spend_generic'] = null_to_0($spendRepository->getPayAmountByGameAndType($params)); //通用币充值 $params['pay_way'] = -1; $allData['spend_binding'] = null_to_0($spendRepository->getPayAmountByGameAndType($params)); //绑定币充值 -======= - $allData['role_num'] = $userRepository->getCreateRoleCountByGame($params);//创角数 - $allData['user_num'] = $userRepository->getCreateRoleUserCountByGame($params);//创角用户 - $allData['new_user_num'] = $userRepository->getNewCreateRoleUserCountByGame($params);//新创角用户 - $allData['new_device_num'] = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备 - $allData['new_ip_num'] = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP - $allData['login_user_num'] = $userRepository->getLoginCountGroupByGame($params);//登录用户数 - if ($this->canViewUserRecharge) { - $allData['spend_user_num'] = $spendRepository->getPayUserCountByGame($params);//充值人数 - $allData['spend_num'] = $spendRepository->getPayCountByGame($params);//充值次数 - unset($params['pay_way']); - $allData['spend_all_amount'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//充值总额 - $params['pay_way'] = ['in', '1,2,3,4,5,6']; - $allData['spend_cash'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//现金充值 - $params['pay_way'] = 0; - $allData['spend_generic'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//通用币充值 - $params['pay_way'] = -1; - $allData['spend_binding'] = null_to_0($spendRepository->getPayAmountByGameAndType($params));//绑定币充值 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $allData['spend_discount'] = '0.00'; $allData['spend_voucher'] = '0.00'; } @@ -1640,20 +1463,12 @@ class QueryController extends BaseController $promote = $_REQUEST['promote_id']; if (PID == $promote) { -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } else { $pids = get_prmoote_chlid_account($promote); $pro_arr = array_column($pids, 'id'); $pro_arr[] = $promote; $promote = implode(',', $pro_arr); -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $game = M('apply', 'tab_') @@ -1760,12 +1575,8 @@ class QueryController extends BaseController public function viewRole($p = 0) { $promoteId = D('User')->where('id = %d', I('get.id'))->getField('promote_id'); -<<<<<<< HEAD $permission = hasPromotePermission(PID, $promoteId); //是否有该推广员权限 $loginPromote = $this->getLoginPromote(); -======= - $permission = hasPromotePermission(PID, $promoteId);//是否有该推广员权限 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($permission === false) { $this->error('无推广员权限'); @@ -1810,11 +1621,7 @@ class QueryController extends BaseController if (!empty($data)) { foreach ($data as &$list) { -<<<<<<< HEAD $list['user_account'] = getUserAccountOfPromote($list['user_account'], $loginPromote); -======= - $list['user_account'] = substr($list['user_account'], 0, 2) . '******' . substr($list['user_account'], 8); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } } @@ -1889,16 +1696,11 @@ class QueryController extends BaseController $roleLevelBegin = intval(I('role_level_begin', 0)); $roleLevelEnd = intval(I('role_level_end', 0)); $headmanPromoteId = I('headman_promote_id', 0); -<<<<<<< HEAD $createTime = I('create_time', date('Y-m-d') . ' 至 ' . date('Y-m-d', time() - 7 * 24 * 3600)); -======= - $createTime = I('create_time', date('Y-m-d') . ' 至 ' . date('Y-m-d', time()-7*24*3600)); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $lastSortName = trim(I('last_sort_name', '')); $sortName = trim(I('sort_name', '')); $sort = intval(I('sort', 1)); -<<<<<<< HEAD $loginPromote = $this->getLoginPromote(); $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote, function () use ($loginPromote) { @@ -1907,16 +1709,6 @@ class QueryController extends BaseController return $promoteService->getTopPromote($loginPromote); } else { return $loginPromote; -======= - $promote = $this->getLoginPromote(); - $levelPromote = $this->getLevelPromote(); - $queryPromote = $this->getQueryPromote($levelPromote, function() use ($promote) { - if ($promote['shift_over_apply'] == 1) { - $promoteService = new PromoteService(); - return $promoteService->getTopPromote($promote); - } else { - return $promote; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } }); @@ -1936,12 +1728,8 @@ class QueryController extends BaseController } if ($roleName != '') { $map['role_name'] = ['like', '%' . $roleName . '%']; -<<<<<<< HEAD } if ($roleId != '') { -======= - }if ($roleId != '') { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map['role_id'] = $roleId; } if ($userAccount != '') { @@ -2038,33 +1826,13 @@ class QueryController extends BaseController // var_dump($records);die(); foreach ($records as $key => $value) { -<<<<<<< HEAD if ($records[$key]['create_time'] == 0) { -======= - - //隐藏算法 - $orderLen = strlen($value['user_account']); - $strLen = 3; - $hideChar = ''; - if ($orderLen <= 8) { - $strLen = 2; - } - for ($i = 0; $i < $orderLen - $strLen * 2; $i++) { - $hideChar .= '*'; - } - - if($records[$key]['create_time'] == 0) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $records[$key]['create_time'] = date('Y-m-d', $value['play_time']) . '
' . date('H:i:s', $value['play_time']); } else { $records[$key]['create_time'] = date('Y-m-d', $value['create_time']) . '
' . date('H:i:s', $value['create_time']); } -<<<<<<< HEAD $records[$key]['user_account'] = getUserAccountOfPromote($value['user_account'], $loginPromote); -======= - $records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $records[$key]['register_time'] = date('Y-m-d', $value['register_time']) . '
' . date('H:i:s', $value['register_time']); $records[$key]['login_time'] = date('Y-m-d', $value['login_time']) . '
' . date('H:i:s', $value['login_time']); @@ -2090,11 +1858,7 @@ class QueryController extends BaseController $this->assign('unique_user_count', $uniqueCountRow['user_count']); $this->assign('unique_count', $uniqueCountRow['count']); $this->assign('sort', $sort); -<<<<<<< HEAD $this->assign('setdate', date('Y-m-d')); -======= - $this->assign('setdate', date('Y-m-d', $nowTime)); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $this->assign('games', $games); $this->assign('records', $records); $this->assign('pagination', $pagination); @@ -2129,11 +1893,7 @@ class QueryController extends BaseController $nowTime = strtotime($nowTime); $nowTimeEnd = $nowTime + 3600 * 24 - 1; -<<<<<<< HEAD $loginPromote = $this->getLoginPromote(); -======= - $promote = $this->getLoginPromote(); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $levelPromote = $this->getLevelPromote(); $queryPromote = $this->getQueryPromote($levelPromote); @@ -2253,11 +2013,7 @@ class QueryController extends BaseController $promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select(); $promotes = index_by_column('id', $promotes); foreach ($records as &$list) { -<<<<<<< HEAD $list['user_account'] = empty($list['user_account']) ? '--' : getUserAccountOfPromote($list['user_account'], $loginPromote); -======= - $list['user_account'] = empty($list['user_account']) ? '--' : encryption($list['user_account']); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $list['game_name'] = empty($list['game_name']) ? '--' : $list['game_name']; $list['sdk_version'] = empty($list['sdk_version']) ? '--' : getSDKTypeName($list['sdk_version']); $list['server_name'] = empty($list['server_name']) ? '--' : $list['server_name']; @@ -2341,11 +2097,7 @@ class QueryController extends BaseController if ($id > 0) { $promoteId = D('Spend')->where('id = %d', $id)->getField('promote_id'); -<<<<<<< HEAD $permission = hasPromotePermission(PID, $promoteId); //是否有该推广员权限 -======= - $permission = hasPromotePermission(PID, $promoteId);//是否有该推广员权限 ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($permission) { $map['id'] = $id; @@ -2471,11 +2223,7 @@ class QueryController extends BaseController // $newCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds($ids, $params); $newCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds($ids, $params); $loginUserCountList = $promoteRepository->getLoginUserCountByIds($ids, $params); -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $rechargeCountList = []; $rechargeUserCountList = []; $rechargeAmountList = []; @@ -2690,11 +2438,7 @@ class QueryController extends BaseController $record = [ 'id' => $parent['id'], 'account' => $parent['account'], -<<<<<<< HEAD 'real_name' => hideRealName($parent['real_name']), -======= - 'real_name' => mb_strlen($parent['real_name'],'utf-8') == 2 ? mb_substr($parent['real_name'],0,1,'utf-8').'*':mb_substr($parent['real_name'],0,1,'utf-8').'**', ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'level' => $parent['level'], 'game_name' => $game['game_name'], 'sdk_version_text' => $game['sdk_version_text'], @@ -2709,11 +2453,7 @@ class QueryController extends BaseController $record = [ 'id' => $id, 'account' => $promote['account'], -<<<<<<< HEAD 'real_name' => hideRealName($promote['real_name']), -======= - 'real_name' => mb_strlen($promote['real_name'],'utf-8') == 2 ? mb_substr($promote['real_name'],0,1,'utf-8').'*':mb_substr($promote['real_name'],0,1,'utf-8').'**', ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a 'level' => $promote['level'], 'game_name' => $game['game_name'], 'sdk_version_text' => $game['sdk_version_text'], @@ -2750,10 +2490,7 @@ class QueryController extends BaseController $roleLevelEnd = intval(I('level_end', 0)); $promoteId = I('promote_id', 0); $isSelf = I('is_self', 0); -<<<<<<< HEAD $loginPromote = $this->getLoginPromote(); -======= ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($relationGameId != 0 || $sdkVersion != 0) { $gameIds = gameSearch($relationGameId, $sdkVersion); @@ -2788,24 +2525,7 @@ class QueryController extends BaseController $query = M('user_play_info', 'tab_')->where($map)->order('create_time desc'); list($records, $pagination, $count) = $this->paginate($query); foreach ($records as $key => $value) { -<<<<<<< HEAD $records[$key]['user_account'] = getUserAccountOfPromote($value['user_account'], $loginPromote); -======= - //订单隐藏算法 - $orderLen = strlen($value['user_account']); - $strLen = 3; - $hideChar = ''; - - if ($orderLen <= 8) { - $strLen = 2; - } - - for ($i = 0; $i < $orderLen - $strLen * 2; $i++) { - $hideChar .= '*'; - } - - $records[$key]['user_account'] = substr($value['user_account'], 0, $strLen) . $hideChar . substr($value['user_account'], $orderLen - $strLen); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } $this->assign('records', $records); @@ -2863,12 +2583,8 @@ class QueryController extends BaseController return M('server', 'tab_')->where($map)->getField('server_name'); } -<<<<<<< HEAD public function iosDownLoadData() { -======= - public function iosDownLoadData() { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $page = intval(I('get.p', 1)); $page = $page ? $page : 1; //默认显示第一页数据arraypage $row = intval(I('get.row', 10)); @@ -2879,11 +2595,7 @@ class QueryController extends BaseController $map = []; if ($queryPromote['level'] == 4) { $map['id'] = $queryPromote['id']; -<<<<<<< HEAD } else { -======= - }else { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '%']; } $iostime = time(); @@ -2924,16 +2636,11 @@ class QueryController extends BaseController $map = []; $map['tab_package_download_log.promote_id'] = ['in', $ids]; -<<<<<<< HEAD // $data = M('package_download_log','tab_')->where($map)->select(); -======= - // $data = M('package_download_log','tab_')->where($map)->select(); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $listData = []; $allUserMap['promote_id'] = ['in', $allids]; $allUserMap['device_type'] = 2; $allUserMap['register_time'] = ['between', [$begTime, $endTime]]; -<<<<<<< HEAD $allTFMap['promote_id'] = ['in', $allids]; $allTFMap['type'] = 2; $allTFMap['create_time'] = ['between', [$begTime, $endTime]]; @@ -2941,15 +2648,6 @@ class QueryController extends BaseController $allSuperMap['type'] = 3; $allSuperMap['create_time'] = ['between', [$begTime, $endTime]]; $companyMap['promote_id'] = ['in', $allids]; -======= - $allTFMap['promote_id'] = ['in', $allids]; - $allTFMap['type'] = 2; - $allTFMap['create_time'] = ['between', [$begTime, $endTime]]; - $allSuperMap['promote_id'] = ['in', $allids]; - $allSuperMap['type'] = 3; - $allSuperMap['create_time'] = ['between', [$begTime, $endTime]]; - $companyMap['promote_id'] = ['in', $allids]; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $companyMap['type'] = 1; $companyMap['create_time'] = ['between', [$begTime, $endTime]]; $alliosMap['promote_id'] = ['in', $allids]; @@ -2957,33 +2655,19 @@ class QueryController extends BaseController $alliosMap['register_time'] = ['between', [$sunday, $iostime]]; $allUsersCounts = M('user', 'tab_')->where($allUserMap)->count(); $allIosCounts = M('user', 'tab_')->where($alliosMap)->count(); -<<<<<<< HEAD $allTFCounts = M('package_download_log', 'tab_')->where($allTFMap)->count(); $allSuperCounts = M('package_download_log', 'tab_')->where($allSuperMap)->count(); $allCompanyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); -======= - - $allTFCounts = M('package_download_log', 'tab_')->where($allTFMap)->count(); - $allSuperCounts = M('package_download_log', 'tab_')->where($allSuperMap)->count(); - $allCompanyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a foreach ($ids as $key => $id) { $promote1 = M('promote', 'tab_')->field('account, level, parent_id, chain')->where(['id' => $id])->select(); $promote = $promote1[0]; $chain = $promote['chain']; $listData[$key]['promote_id'] = $id; -<<<<<<< HEAD if ($id == PID) { $listData[$key]['account'] = $promote['account'] . '' . '[' . '自己' . ']' . ''; } else { -======= - if($id == PID) { - $listData[$key]['account'] = $promote['account'].''.'['.'自己'.']'.''; - }else { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $listData[$key]['account'] = $promote['account']; } $iosTimeMap['promote_id'] = $id; @@ -3006,37 +2690,23 @@ class QueryController extends BaseController $usersCounts = M('user', 'tab_')->where($map10)->count(); $listData[$key]['userscounts'] = intval($usersCounts); $listData[$key]['tfcounts'] = intval($tfCounts); -<<<<<<< HEAD $listData[$key]['tfpercent'] = number_format((intval($tfCounts) / intval($usersCounts)), 2, '.', '') * 100; if (intval($usersCounts) == 0) { $listData[$key]['tfpercent'] = 0; } if ($promote['level'] == 1) { -======= - $listData[$key]['tfpercent'] = number_format((intval($tfCounts) / intval($usersCounts)),2,'.','') * 100; - - if (intval($usersCounts) == 0) { - $listData[$key]['tfpercent'] = 0; - } - if($promote['level'] == 1) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $listData[$key]['belongs_president'] = $promote['account']; $listData[$key]['belongs_department'] = "无所属部门长"; $listData[$key]['belongs_group'] = "无所属组长"; } if ($promote['level'] == 2) { -<<<<<<< HEAD $parentPromote = M('promote', 'tab_')->field('account')->where(['id' => $promote['parent_id']])->select(); -======= - $parentPromote = M('promote', 'tab_')->field('account')->where(['id'=>$promote['parent_id']])->select(); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $listData[$key]['belongs_president'] = $parentPromote[0]['account']; $listData[$key]['belongs_department'] = $promote['account']; $listData[$key]['belongs_group'] = "无所属组长"; } if ($promote['level'] == 3) { -<<<<<<< HEAD $chainArr = explode('/', $chain); $presidentAccount = M('promote', 'tab_')->where(['id' => $chainArr[1]])->getField('account'); $departmentAccount = M('promote', 'tab_')->where(['id' => $chainArr[2]])->getField('account'); @@ -3056,27 +2726,6 @@ class QueryController extends BaseController } } $totalpercent = number_format($allTFCounts / $allUsersCounts, 2, '.', '') * 100; -======= - $chainArr = explode('/', $chain); - $presidentAccount = M('promote', 'tab_')->where(['id' => $chainArr[1]])->getField('account'); - $departmentAccount = M('promote', 'tab_')->where(['id' => $chainArr[2]])->getField('account'); - $listData[$key]['belongs_president'] = $presidentAccount; - $listData[$key]['belongs_department'] = $departmentAccount; - $listData[$key]['belongs_group'] = $promote['account']; - } - - if ($promote['level'] == 4) { - $chainArr = explode('/', $chain); - $presidentAccount = M('promote', 'tab_')->where(['id' => $chainArr[1]])->getField('account'); - $departmentAccount = M('promote', 'tab_')->where(['id' => $chainArr[2]])->getField('account'); - $groupAccount = M('promote', 'tab_')->where(['id' => $chainArr[3]])->getField('account'); - $listData[$key]['belongs_president'] = $presidentAccount; - $listData[$key]['belongs_department'] = $departmentAccount; - $listData[$key]['belongs_group'] = $groupAccount; - } - } - $totalpercent = number_format($allTFCounts/$allUsersCounts,2,'.','') * 100; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($allUsersCounts == 0) { $totalpercent = '0'; } @@ -3090,7 +2739,6 @@ class QueryController extends BaseController $this->assign('initBegTime', $initBegTime); $this->assign('initEndTime', $initEndTime); $this->assign('allIosCounts', $allIosCounts); -<<<<<<< HEAD $this->display(); } @@ -3131,56 +2779,12 @@ class QueryController extends BaseController $query = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where($map); list($packAges, $pagination, $count) = $this->paginate($query); foreach ($packAges as $key => $package) { -======= - $this->assign('tfpercent', $tfpercent); - $this->display(); - } - - public function iosDownLoadDetail() { - $promote_id = $_REQUEST['promote_id']; - $belongs_president = $_REQUEST['belongs_president']; - $belongs_department = $_REQUEST['belongs_department']; - $belongs_group = $_REQUEST['belongs_group']; - // $createTime = I('create_time', ''); - - $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; - - $map['create_time'] = ['between', [$begTime, $endTime]]; - $tfMap['create_time'] = ['between', [$begTime, $endTime]]; - $superMap['create_time'] = ['between', [$begTime, $endTime]]; - $companyMap['create_time'] = ['between', [$begTime, $endTime]]; - - if(!empty(I('user_account'))) { - $user_id = M('user', 'tab_')->where(['account'=>I('user_account')])->getField('id'); - $map['user_id'] = $user_id; - $tfMap['user_id'] = $user_id; - $superMap['user_id'] = $user_id; - $companyMap['user_id'] = $user_id; - } - if(!empty(I('type'))) { - $map['type'] = I('type'); - - } - $map['promote_id'] = $promote_id; - //$packAges = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where(['promote_id'=>$promote_id])->select(); - $query = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where($map); - list($packAges, $pagination, $count) = $this->paginate($query); - foreach ($packAges as $key =>$package) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $user_id = $package['user_id']; $usersAccount = M('user', 'tab_')->where(['id' => $user_id])->getField('account'); $packAges[$key]['account'] = $usersAccount; if ($package['type'] == 1) { $packAges[$key]['typename'] = "企业签下载"; } -<<<<<<< HEAD if ($package['type'] == 2) { $packAges[$key]['typename'] = "TF下载"; } @@ -3189,42 +2793,20 @@ class QueryController extends BaseController } $packAges[$key]['create_time'] = date('Y-m-d H:i:s', $package['create_time']); $promoteInfo = M('promote', 'tab_')->field('account')->where(['id' => $promote_id])->find(); -======= - if($package['type'] == 2) { - $packAges[$key]['typename'] = "TF下载"; - } - if($package['type'] == 3) { - $packAges[$key]['typename'] = "超级签下载"; - } - $packAges[$key]['create_time'] = date('Y-m-d H:i:s', $package['create_time']); - $promoteInfo = M('promote', 'tab_')->field('account')->where(['id'=>$promote_id])->find(); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $packAges[$key]['promote_account'] = $promoteInfo['account']; $packAges[$key]['belongs_president'] = $belongs_president; $packAges[$key]['belongs_department'] = $belongs_department; $packAges[$key]['belongs_group'] = $belongs_group; -<<<<<<< HEAD $packAges[$key]['account'] = getUserAccountOfPromote($packAges[$key]['account'], $loginPromote); } $tfMap['promote_id'] = $promote_id; $tfMap['type'] = 2; -======= - $packAges[$key]['account'] = encryption($packAges[$key]['account']); - - } - $tfMap['promote_id'] = $promote_id; - $tfMap['type'] = 2; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $TFCounts = M('package_download_log', 'tab_')->where($tfMap)->count(); $superMap['promote_id'] = $promote_id; $superMap['type'] = 3; $superCounts = M('package_download_log', 'tab_')->where($superMap)->count(); -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $companyMap['promote_id'] = $promote_id; $companyMap['type'] = 1; $companyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); @@ -3245,13 +2827,8 @@ class QueryController extends BaseController public function multisort($records, $column, $type = 'asc') { $length = count($records); -<<<<<<< HEAD for ($i = 0; $i < $length; $i++) { for ($j = $i + 1; $j < $length; $j++) { -======= - for ($i = 0; $i < $length; $i ++) { - for ($j = $i + 1; $j < $length; $j ++) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a if ($type == 'asc') { if ($records[$i][$column] > $records[$j][$column]) { $temp = $records[$i]; @@ -3274,11 +2851,7 @@ class QueryController extends BaseController { $baseGameId = I('game_id', 0); $deviceType = I('device_type', ''); -<<<<<<< HEAD $timeRange = I('time_range', date('Y-m-d', strtotime('-7 day')) . ' 至 ' . date('Y-m-d')); -======= - $timeRange = I('time_range', date('Y-m-d',strtotime('-7 day')) . ' 至 ' . date('Y-m-d')); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $lastSortName = trim(I('last_sort_name', '')); $sortName = trim(I('sort_name', '')); $sort = intval(I('sort', 1)); @@ -3304,11 +2877,7 @@ class QueryController extends BaseController $orderColumn = $sortName; $orderType = ($sort == 1) ? 'desc' : 'asc'; } -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $status = true; $data = false; $error = ''; @@ -3318,11 +2887,7 @@ class QueryController extends BaseController } $startTime = strtotime($start . ' 00:00:00'); $endTime = strtotime($end . ' 23:59:59') + 1; -<<<<<<< HEAD if ((($endTime - $startTime) / (24 * 3600)) > 31) { -======= - if ((($endTime - $startTime)/(24*3600)) > 31) { ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $error = '时间间隔不能超过31天'; $status = false; } @@ -3351,11 +2916,7 @@ class QueryController extends BaseController 'game_ids' => $gameIds, ] ]); -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $result = (string)$response->getBody(); $result = json_decode($result, true); if (!$result) { @@ -3365,26 +2926,14 @@ class QueryController extends BaseController $dayList = [1, 2, 3, 4, 5, 6, 7, 15, 30]; $gameName = $deviceType ? get_game_name($searchGameId) : $baseGame['name']; $promoteName = '全部'; -<<<<<<< HEAD -======= - if ($promoteId) { - $promoteName = get_promote_account($promoteId); - } ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a foreach ($data as $key => $item) { $item['promote_name'] = $promoteName; $item['game_name'] = $gameName; foreach ($dayList as $day) { if ($item['register_count'] > 0) { -<<<<<<< HEAD $item['retention_day' . $day] = round($item['retention_day' . $day] / $item['register_count'], 4) * 100; } else { $item['retention_day' . $day] = '--'; -======= - $item['retention_day'. $day] = round($item['retention_day'. $day]/$item['register_count'], 4)*100; - } else { - $item['retention_day'. $day] = '--'; ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a } } $data[$key] = $item; @@ -3412,11 +2961,7 @@ class QueryController extends BaseController { $gameId = I('game_id', 0); $serverId = I('server_id', ''); -<<<<<<< HEAD $timeRange = I('time_range', date('Y-m-d', strtotime('-7 day')) . ' 至 ' . date('Y-m-d')); -======= - $timeRange = I('time_range', date('Y-m-d',strtotime('-7 day')) . ' 至 ' . date('Y-m-d')); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $lastSortName = trim(I('last_sort_name', '')); $sortName = trim(I('sort_name', '')); $sort = intval(I('sort', 1)); @@ -3435,11 +2980,7 @@ class QueryController extends BaseController $start = $timeRangeRow[0]; $end = $timeRangeRow[0]; } -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $spendMap = ['pay_status' => 1, '_string' => '1=1']; $roleMap = ['_string' => '1=1']; $map = []; @@ -3447,11 +2988,7 @@ class QueryController extends BaseController $betweenTime = [strtotime($start . ' 00:00:00'), strtotime($end . ' 23:59:59')]; $spendMap['pay_time'] = ['between', $betweenTime]; $roleMap['create_time'] = ['between', $betweenTime]; -<<<<<<< HEAD -======= - ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a $promoteService = new PromoteService(); $subInSql = $promoteService->subInSql($queryPromote); diff --git a/Application/Media/Controller/IndexController.class.php b/Application/Media/Controller/IndexController.class.php index d14075e59..e9aec9961 100644 --- a/Application/Media/Controller/IndexController.class.php +++ b/Application/Media/Controller/IndexController.class.php @@ -348,11 +348,7 @@ class IndexController extends BaseController { //生成二维码图片 //echo $_SERVER['REQUEST_URI']; ob_clean(); -<<<<<<< HEAD $object = new \QRcode(null); -======= - $object = new \QRcode(); ->>>>>>> a2bb9f000757e13fa3ca589d6763340af1fcf41a echo $object->png($url, false, $errorCorrectionLevel, $matrixPointSize, 2); }