From 0ff9f77181909c5424140e3897819074222b39fc Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 2 Jan 2020 17:05:30 +0800 Subject: [PATCH 01/46] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E8=B5=84?= =?UTF-8?q?=E8=B4=A8=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/FileController.class.php | 45 + .../Controller/PromoteController.class.php | 120 +++ .../Admin/View/Promote/certification.html | 840 ++++++++++++++++++ Application/Admin/View/Promote/lists.html | 5 +- 4 files changed, 1009 insertions(+), 1 deletion(-) create mode 100644 Application/Admin/View/Promote/certification.html diff --git a/Application/Admin/Controller/FileController.class.php b/Application/Admin/Controller/FileController.class.php index bb6b721df..a9db7bd78 100644 --- a/Application/Admin/Controller/FileController.class.php +++ b/Application/Admin/Controller/FileController.class.php @@ -241,6 +241,51 @@ class FileController extends AdminController $this->ajaxReturn($return); } + /** + * 上传图片 + * @author huajie + */ + public function uploadPictureNotLimit() + { + //TODO: 用户登录检测 + + /* 返回标准数据 */ + $return = array('status' => 1, 'info' => '上传成功', 'data' => ''); + + /* 调用文件上传组件上传文件 */ + $Picture = D('Picture'); + $pic_driver = C('PICTURE_UPLOAD_DRIVER'); + + $info = $Picture->upload( + $_FILES, + C('PICTURE_UPLOAD'), + C('PICTURE_UPLOAD_DRIVER'), + C("UPLOAD_{$pic_driver}_CONFIG"), + $_REQUEST['flag'] + ); //TODO:上传到远程服务器 + + // 添加水印 +// if ($_REQUEST['flag']) { +// $this->addWatermarkOnPic($info['download']); +// } + + /* 记录图片信息 */ + if ($info) { + $return['status'] = 1; + if (empty($info['download'])) { + $file = $info['file']; + } else { + $file = $info['download']; + } + $return = array_merge($file, $return); + } else { + $return['status'] = 0; + $return['info'] = $Picture->getError(); + } + ob_clean(); + /* 返回JSON数据 */ + $this->ajaxReturn($return); + } public function uploadDoc() { diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 9c3ccbb5a..c12a842f2 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -1137,4 +1137,124 @@ class PromoteController extends ThinkController $this->display(); } + + public function certification() + { + if ($_POST) { + $promoteId = intval(I('post.id', 0)); + if (empty($promoteId)) { + $this->error('参数异常'); + } + if (empty($_POST['real_name'])) { + $this->error('真实姓名不能为空'); + } + if (empty($_POST['idcard'])) { + $this->error('身份证号码不能为空'); + } + if(!is_idcard($_POST['idcard'])) { + $this->error('证件号码错误'); + } + if (empty($_POST['mobile_phone'])) { + $this->error('手机号码不能为空'); + } + $patternPhone = "/^1[3|5|7|8]\\d{9}$/i"; + if(!preg_match($patternPhone, $_POST['mobile_phone'])) { + $this->error("手机号码格式不合法"); + } + if (empty($_POST['idcarpic'])) { + $this->error('身份证证件照不能为空'); + } + if (empty($_POST['s_province'])) { + $this->error('联系省份不能为空'); + } + if (empty($_POST['s_city'])) { + $this->error('联系地级市不能为空'); + } + if (empty($_POST['s_county'])) { + $this->error('联系市、县级市不能为空'); + } + if (empty($_POST['s_address'])) { + $this->error('详细地址不能为空'); + } + if (empty($_POST['email'])) { + $this->error('邮箱不能为空'); + } + $patternEmail = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i"; + if (!preg_match($patternEmail, $_POST['email'])) { + $this->error('邮箱地址错误'); + } + if (empty($_POST['account_type'])) { + $this->error('账户类型不能为空'); + } + if (empty($_POST['bank_name'])) { + $this->error('开户银行不能为空'); + } + if (empty($_POST['bank_account'])) { + $this->error('银行户名不能为空'); + } + $patternBankAccount = "/^[\x{4e00}-\x{9fa5}]{2,}$/u"; + if (!preg_match($patternBankAccount, $_POST['bank_account'])) { + $this->error('银行卡开户人姓名错误'); + } + if (empty($_POST['bank_card'])) { + $this->error('卡号不能为空'); + } + $patternBankCard = "/^\d{10,19}$/u"; + if (!preg_match($patternBankCard, $_POST['bank_card'])) { + $this->error('卡号格式错误'); + } + + $save['id'] = $promoteId; + $save['ver_status'] = 1; + $save['real_name'] = I('post.real_name', ''); + $save['idcard'] = I('post.idcard', ''); + $save['idcarpic'] = I('post.idcarpic', ''); + $save['mobile_phone'] = I('post.mobile_phone', ''); + $save['address'][] = I('post.s_province', '') . ',' . I('post.s_city', '') . ',' . I('post.s_county', ''); + $save['address'][] = I('post.s_address', ''); + $save['address'] = json_encode($save['address']); + $save['email'] = I('post.email', ''); + $save['account_type'] = intval(I('post.account_type', 1)); + $save['bank_name'] = I('post.bank_name', ''); + $save['bank_account'] = I('post.bank_account', ''); + $save['bank_card'] = I('post.bank_card', ''); + if (isset($_POST['businesspic'])) { + $save['businesspic'] = I('post.businesspic', ''); + } + if (isset($_POST['agreementpic'])) { + $save['agreementpic'] = I('post.agreementpic', ''); + } + if (isset($_POST['anothpic'])) { + $save['anothpic'] = I('post.anothpic', ''); + } + + $result = D('promote')->save($save); + if ($result === false) { + $this->error('操作失败'); + } else { + $this->success('操作成功'); + } + } else { + $promoteId = intval(I('id', 0)); + if ($promoteId <= 0) { + $this->error('参数错误'); + } + + $promote = D('promote')->where(array('id' => $promoteId))->find(); + $promote['idcarpic_array'] = $promote['idcarpic'] ? explode(',', $promote['idcarpic']) : []; + $promote['businesspic_array'] = $promote['businesspic'] ? explode(',', $promote['businesspic']) : []; + $promote['agreementpic_array'] = $promote['agreementpic'] ? explode(',', $promote['agreementpic']) : []; + $promote['anothpic_array'] = $promote['anothpic'] ? explode(',', $promote['anothpic']) : []; + $promote['address'] = json_decode($promote['address'], true); + if (!empty($promote['address'])) { + foreach ($promote['address'] as &$address) { + $address = explode(',', $address); + } + } + + $this->assign('records', $promote); + $this->assign('meta_title', '资质认证'); + $this->display(); + } + } } diff --git a/Application/Admin/View/Promote/certification.html b/Application/Admin/View/Promote/certification.html new file mode 100644 index 000000000..033a38efc --- /dev/null +++ b/Application/Admin/View/Promote/certification.html @@ -0,0 +1,840 @@ + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
会长账号: + + 通过推广员后台注册申请或者管理后台创建的账号 +
*真实姓名: + + +
*身份证号码: + + +
*身份证照: + + +
+
+
上传图片
+
+ +
+ +
+
+
+ 请上传身份证正反面,图片为jpg、png格式(不超过2M) +
营业执照: + + +
+
+
上传图片
+
+ +
+ +
+
+
+ 如果是公司请上传营业执照 +
合作合同: + + +
+
+
上传图片
+
+ +
+ +
+
+
+ 须上传平台与贵公司(工作室)签署的合作合同 +
补充认证: + + +
+
+
上传图片
+
+ +
+ +
+
+
+ +
*电话: + + +
*联系地址 +
+
+    +    + + + + + +
+
+
+ +
*邮箱: + + +
*账户类型: + + + + +
*开户银行: + + +
*银行户名: + + +
*银行账号: + + +
+
+ + +
+ + + 返回 + +
+
+
+
+ + + +
+ + + + if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + + + + + + diff --git a/Application/Admin/View/Promote/lists.html b/Application/Admin/View/Promote/lists.html index 0aa7f9d25..6db8d895d 100644 --- a/Application/Admin/View/Promote/lists.html +++ b/Application/Admin/View/Promote/lists.html @@ -7,6 +7,7 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
推广限制 + 全部会长可申请 + 部分会长可申请 +
+
+
+ + + +
@@ -968,7 +1019,152 @@ + + + + diff --git a/Data/update.sql b/Data/update.sql index df2614a60..cc96f7fdf 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1073,3 +1073,16 @@ CREATE TABLE `sys_document_pop_rules` ( `operater_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作者ID', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; + + +--会长设置推广配置-- + +CREATE TABLE `tab_sociaty_games` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `promote_id` int(11) NOT NULL COMMENT '会长ID', + `game_id` int(11) NOT NULL COMMENT '游戏ID', + `status` tinyint(1) NOT null DEFAULT '0' COMMENT '状态 0 禁用 1 启用', + `create_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间', + `update_time` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT '工会授权游戏'; \ No newline at end of file From d2b7e91a64cd0cbcc811732b2ab381ae6379d784 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Wed, 15 Jan 2020 16:46:02 +0800 Subject: [PATCH 04/46] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/GameController.class.php | 21 +++++++++++++++++-- Application/Admin/View/Game/edit.html | 13 ++++++------ Data/update.sql | 11 ++++++++++ 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/Application/Admin/Controller/GameController.class.php b/Application/Admin/Controller/GameController.class.php index 19a97ebcf..eb6b0b898 100644 --- a/Application/Admin/Controller/GameController.class.php +++ b/Application/Admin/Controller/GameController.class.php @@ -935,13 +935,13 @@ class GameController extends ThinkController $dataList = []; for($i=2;$i<=$highestRow;$i++) { - $promote_id = $objPHPExcel->getActiveSheet()->getCell("B".$i)->getValue(); + $promote_id = $objPHPExcel->getActiveSheet()->getCell("A".$i)->getValue(); $promoteInfo = M('promote','tab_')->field('account')->where(['id' => $promote_id ])->find(); if(empty($promoteInfo)) { break; } - $game_id = $objPHPExcel->getActiveSheet()->getCell("C".$i)->getValue(); + $game_id = $objPHPExcel->getActiveSheet()->getCell("B".$i)->getValue(); $gameInfo = M('game','tab_')->field('game_name,game_status')->where(['id'=>$game_id])->select(); if(empty($gameInfo)) { break; @@ -965,4 +965,21 @@ class GameController extends ThinkController $this->ajaxReturn(json_encode($returnData)); } + //下载模板 + public function downloadDemo() { + $game_id = $_REQUEST['game_id']; + $game_name = M('game','tab_')->where(['id'=>$game_id])->getField('game_name'); + $data[] = [ + 'promoteid' => 99, + 'game_id' => $game_id, + 'game_name' => $game_name + ]; + $field = array( + "promoteid"=>"会长ID", + "game_id"=>"游戏ID(无需修改,已默认当前游戏)", + "game_name"=>"游戏名称(无需修改,已默认当前游戏)" + ); + data2csv($data,"模板",$field); + } + } diff --git a/Application/Admin/View/Game/edit.html b/Application/Admin/View/Game/edit.html index 56c0b7f48..f0c2dc058 100644 --- a/Application/Admin/View/Game/edit.html +++ b/Application/Admin/View/Game/edit.html @@ -968,7 +968,7 @@ EXCEL模板 - 下载模板 + 下载模板 @@ -985,12 +985,13 @@ +
+ + + +
-
- - - - +
diff --git a/Data/update.sql b/Data/update.sql index cc96f7fdf..da4cfb6d1 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1077,6 +1077,17 @@ CREATE TABLE `sys_document_pop_rules` ( --会长设置推广配置-- +CREATE TABLE `tab_sociaty_games` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `promote_id` int(11) NOT NULL COMMENT '会长ID', + `game_id` int(11) NOT NULL COMMENT '游戏ID', + `status` tinyint(1) NOT null DEFAULT '0' COMMENT '状态 0 禁用 1 启用', + `create_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间', + `update_time` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT '工会授权游戏'; + +--会长推广配置-- CREATE TABLE `tab_sociaty_games` ( `id` int(11) NOT NULL AUTO_INCREMENT, `promote_id` int(11) NOT NULL COMMENT '会长ID', From 535f185e371c604ddaea2550c33f7bfd19719e59 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 16 Jan 2020 17:26:26 +0800 Subject: [PATCH 05/46] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repository/PromoteRepository.class.php | 5 +- .../Home/Controller/QueryController.class.php | 405 ++++++++++++++---- .../Home/View/default/Query/promoteQuota.html | 178 ++++++++ 3 files changed, 501 insertions(+), 87 deletions(-) create mode 100644 Application/Home/View/default/Query/promoteQuota.html diff --git a/Application/Base/Repository/PromoteRepository.class.php b/Application/Base/Repository/PromoteRepository.class.php index 518d2cc5e..253b2b392 100644 --- a/Application/Base/Repository/PromoteRepository.class.php +++ b/Application/Base/Repository/PromoteRepository.class.php @@ -45,7 +45,10 @@ class PromoteRepository { if (isset($params['sdk_version'])) { $map['sdk_version'] = $params['sdk_version']; } - if (isset($params['begin_time']) && isset($params['begin_time']) && isset($params['time_column'])) { + if (isset($params['role_level'])) { + $map['role_level'] = $params['role_level']; + } + if (isset($params['begin_time']) && isset($params['end_time']) && isset($params['time_column'])) { $map[$params['time_column']] = ['between', [$params['begin_time'], $params['end_time']]]; } if (isset($params['lock_status'])) { diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index b51415efc..da0bac1ea 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1128,15 +1128,17 @@ class QueryController extends BaseController $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);//绑定币充值 + 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);//绑定币充值 + } $allData['role_num'] = 0; $allData['user_num'] = 0; @@ -1144,17 +1146,19 @@ class QueryController extends BaseController $allData['new_device_num'] = 0; $allData['new_ip_num'] = 0; $allData['login_user_num'] = 0; - $allData['spend_user_num'] = 0; - $allData['spend_num'] = 0; - $allData['spend_all_amount'] = 0; - $allData['spend_cash'] = 0; - $allData['spend_generic'] = 0; - $allData['spend_binding'] = 0; - $allData['spend_discount'] = 0; - $allData['spend_voucher'] = 0; + if ($this->canViewUserRecharge) { + $allData['spend_user_num'] = 0; + $allData['spend_num'] = 0; + $allData['spend_all_amount'] = 0; + $allData['spend_cash'] = 0; + $allData['spend_generic'] = 0; + $allData['spend_binding'] = 0; + $allData['spend_discount'] = 0; + $allData['spend_voucher'] = 0; + } foreach ($dayList as $day) { $date = date('Ymd', strtotime($day)); - $records[] = [ + $record = [ 'day' => $date, 'role_num' => $roleNumList[$day], 'user_num' => $userNumList[$day], @@ -1162,14 +1166,6 @@ class QueryController extends BaseController 'new_device_num' => $newDeviceNumList[$day], 'new_ip_num' => $newIpNumList[$day], 'login_user_num' => $loginUserNumList[$day], - 'spend_user_num' => $spendUserNumList[$day], - 'spend_num' => $spendNumList[$day], - 'spend_all_amount' => $spendAllAmountList[$day], - 'spend_cash' => $spendCashList[$day], - 'spend_generic' => $spendGenericList[$day], - 'spend_binding' => $spendBindingList[$day], - 'spend_discount' => 0, - 'spend_voucher' => 0, ]; $allData['role_num'] += $roleNumList[$day]; @@ -1178,14 +1174,27 @@ class QueryController extends BaseController $allData['new_device_num'] += $newDeviceNumList[$day]; $allData['new_ip_num'] += $newIpNumList[$day]; $allData['login_user_num'] += $loginUserNumList[$day]; - $allData['spend_user_num'] += $spendUserNumList[$day]; - $allData['spend_num'] += $spendNumList[$day]; - $allData['spend_all_amount'] = bcadd($allData['spend_all_amount'], $spendAllAmountList[$day], 2); - $allData['spend_cash'] = bcadd($allData['spend_cash'], $spendCashList[$day], 2); - $allData['spend_generic'] = bcadd($allData['spend_generic'], $spendGenericList[$day], 2); - $allData['spend_binding'] = bcadd($allData['spend_binding'], $spendBindingList[$day], 2); - $allData['spend_discount'] = bcadd($allData['spend_discount'], 0, 2); - $allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2); + + if ($this->canViewUserRecharge) { + $record['spend_user_num'] = $spendUserNumList[$day]; + $record['spend_num'] = $spendNumList[$day]; + $record['spend_all_amount'] = $spendAllAmountList[$day]; + $record['spend_cash'] = $spendCashList[$day]; + $record['spend_generic'] = $spendGenericList[$day]; + $record['spend_binding'] = $spendBindingList[$day]; + $record['spend_discount'] = 0; + $record['spend_voucher'] = 0; + + $allData['spend_user_num'] += $spendUserNumList[$day]; + $allData['spend_num'] += $spendNumList[$day]; + $allData['spend_all_amount'] = bcadd($allData['spend_all_amount'], $spendAllAmountList[$day], 2); + $allData['spend_cash'] = bcadd($allData['spend_cash'], $spendCashList[$day], 2); + $allData['spend_generic'] = bcadd($allData['spend_generic'], $spendGenericList[$day], 2); + $allData['spend_binding'] = bcadd($allData['spend_binding'], $spendBindingList[$day], 2); + $allData['spend_discount'] = bcadd($allData['spend_discount'], 0, 2); + $allData['spend_voucher'] = bcadd($allData['spend_voucher'], 0, 2); + } + $records[] = $record; } foreach ($dayListReverse as $day) { $date = date('Ymd', strtotime($day)); @@ -1194,8 +1203,10 @@ class QueryController extends BaseController $summaryData['user_num'][] = $userNumList[$day]; $summaryData['new_user_num'][] = $newUserNumList[$day]; $summaryData['new_device_num'][] = $newDeviceNumList[$day]; - $summaryData['spend_user_num'][] = $spendUserNumList[$day]; - $summaryData['spend_all_amount'][] = $spendAllAmountList[$day]; + if ($this->canViewUserRecharge) { + $summaryData['spend_user_num'][] = $spendUserNumList[$day]; + $summaryData['spend_all_amount'][] = $spendAllAmountList[$day]; + } } } @@ -1314,18 +1325,20 @@ class QueryController extends BaseController $newDeviceNumList = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备 $newIpNumList = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP $loginUserNumList = $userRepository->getLoginCountGroupByGame($params);//登录用户数 - $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);//绑定币充值 + 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);//绑定币充值 + } foreach ($data as &$list) { $gameId = $list['game_id']; - $records[] = [ + $record = [ 'game_id' => $gameId, 'game_name' => $list['game_name'], 'sdk_version' => $list['sdk_version'], @@ -1335,15 +1348,19 @@ class QueryController extends BaseController 'new_device_num' => $newDeviceNumList[$gameId], 'new_ip_num' => $newIpNumList[$gameId], 'login_user_num' => $loginUserNumList[$gameId], - 'spend_user_num' => $spendUserNumList[$gameId], - 'spend_num' => $spendNumList[$gameId], - 'spend_all_amount' => $spendAllAmountList[$gameId], - 'spend_cash' => $spendCashList[$gameId], - 'spend_generic' => $spendGenericList[$gameId], - 'spend_binding' => $spendBindingList[$gameId], - 'spend_discount' => 0, - 'spend_voucher' => 0, ]; + if ($this->canViewUserRecharge) { + $record['spend_user_num'] = $spendUserNumList[$gameId]; + $record['spend_num'] = $spendNumList[$gameId]; + $record['spend_all_amount'] = $spendAllAmountList[$gameId]; + $record['spend_cash'] = $spendCashList[$gameId]; + $record['spend_generic'] = $spendGenericList[$gameId]; + $record['spend_binding'] = $spendBindingList[$gameId]; + $record['spend_discount'] = 0; + $record['spend_voucher'] = 0; + } + + $records[] = $record; } $params['all_data'] = 1; $params['game_ids'] = $allGameIs; @@ -1353,18 +1370,20 @@ class QueryController extends BaseController $allData['new_device_num'] = $userRepository->getNewCreateRoleDeviceCountByGame($params);//新创角设备 $allData['new_ip_num'] = $userRepository->getNewCreateRoleIpCountByGame($params);//新创角IP $allData['login_user_num'] = $userRepository->getLoginCountGroupByGame($params);//登录用户数 - $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'; + 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'; + } } } @@ -2093,9 +2112,15 @@ class QueryController extends BaseController // $newCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds($ids, $params); $newCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds($ids, $params); $loginUserCountList = $promoteRepository->getLoginUserCountByIds($ids, $params); - $rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params); - $rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params); - $rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params); + + $rechargeCountList = []; + $rechargeUserCountList = []; + $rechargeAmountList = []; + if ($this->canViewUserRecharge) { + $rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params); + $rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params); + $rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params); + } if (I('p', 1) == 1) { $selfParams = $params; @@ -2106,10 +2131,7 @@ class QueryController extends BaseController // $selfNewCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds([$parent['id']], $selfParams); $selfNewCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds([$parent['id']], $selfParams); $selfLoginUserCountList = $promoteRepository->getLoginUserCountByIds([$parent['id']], $selfParams); - $selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams); - $selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams); - $selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams); - $records[] = [ + $record = [ 'id' => $parent['id'], 'account' => $parent['account'], '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').'**', @@ -2120,18 +2142,24 @@ class QueryController extends BaseController // 'new_create_role_device_count' => $selfNewCreateRoleDeviceCountList[$parent['id']], 'new_create_role_ip_count' => $selfNewCreateRoleIpCountList[$parent['id']], 'login_user_count' => $selfLoginUserCountList[$parent['id']], - 'recharge_count' => $selfRechargeCountList[$parent['id']], - 'recharge_user_count' => $selfRechargeUserCountList[$parent['id']], - 'recharge_amount' => $selfRechargeAmountList[$parent['id']]['ban_coin'] + $selfRechargeAmountList[$parent['id']]['coin'] + $selfRechargeAmountList[$parent['id']]['cash'], - 'recharge_by_ban_coin' => $selfRechargeAmountList[$parent['id']]['ban_coin'], - 'recharge_by_coin' => $selfRechargeAmountList[$parent['id']]['coin'], - 'recharge_by_cash' => $selfRechargeAmountList[$parent['id']]['cash'], 'current_display' => $currentDisplay, ]; + if ($this->canViewUserRecharge) { + $selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams); + $selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams); + $selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams); + $record['recharge_count'] = $selfRechargeCountList[$parent['id']]; + $record['recharge_user_count'] = $selfRechargeUserCountList[$parent['id']]; + $record['recharge_amount'] = $selfRechargeAmountList[$parent['id']]['ban_coin'] + $selfRechargeAmountList[$parent['id']]['coin'] + $selfRechargeAmountList[$parent['id']]['cash']; + $record['recharge_by_ban_coin'] = $selfRechargeAmountList[$parent['id']]['ban_coin']; + $record['recharge_by_coin'] = $selfRechargeAmountList[$parent['id']]['coin']; + $record['recharge_by_cash'] = $selfRechargeAmountList[$parent['id']]['cash']; + } + $records[] = $record; } foreach ($promotes as $promote) { $id = $promote['id']; - $records[] = [ + $record = [ 'id' => $id, 'account' => $promote['account'], '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').'**', @@ -2142,14 +2170,17 @@ class QueryController extends BaseController // 'new_create_role_device_count' => $newCreateRoleDeviceCountList[$id], 'new_create_role_ip_count' => $newCreateRoleIpCountList[$id], 'login_user_count' => $loginUserCountList[$id], - 'recharge_count' => $rechargeCountList[$id], - 'recharge_user_count' => $rechargeUserCountList[$id], - 'recharge_amount' => $rechargeAmountList[$id]['ban_coin'] + $rechargeAmountList[$id]['coin'] + $rechargeAmountList[$id]['cash'], - 'recharge_by_ban_coin' => $rechargeAmountList[$id]['ban_coin'], - 'recharge_by_coin' => $rechargeAmountList[$id]['coin'], - 'recharge_by_cash' => $rechargeAmountList[$id]['cash'], 'current_display' => '', ]; + if ($this->canViewUserRecharge) { + $record['recharge_count'] = $rechargeCountList[$id]; + $record['recharge_user_count'] = $rechargeUserCountList[$id]; + $record['recharge_amount'] = $rechargeAmountList[$id]['ban_coin'] + $rechargeAmountList[$id]['coin'] + $rechargeAmountList[$id]['cash']; + $record['recharge_by_ban_coin'] = $rechargeAmountList[$id]['ban_coin']; + $record['recharge_by_coin'] = $rechargeAmountList[$id]['coin']; + $record['recharge_by_cash'] = $rechargeAmountList[$id]['cash']; + } + $records[] = $record; } } else { $timeout = 1; @@ -2179,4 +2210,206 @@ class QueryController extends BaseController $this->ajaxReturn($data); } + + //推广员指标管理 + public function promoteQuota() + { + $time = I('time', date('Y-m-d')); + if (!empty($time)) { + $defaultTime = $time; + } else { + $nowTime = date('Y-m-d', time()); + $defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime; + $time = $defaultTime; + } + $sdkVersion = I('sdk_version', 0); + $relationGameId = I('relation_game_id', 0); + $serverId = I('server_id', 0); + $parentId = I('parent_id', 0); + $promoteId = I('promote_id', 0); + $levelBegin = I('level_begin', ''); + $levelEnd = I('level_end', ''); + $prevParentId = 0; + + $promoteService = new PromoteService(); + $loginPromote = $this->getLoginPromote(); + + $parent = null; + if ($parentId > 0) { + $parent = M('promote', 'tab_')->where(['id' => $parentId])->find(); + $currentDisplay = $promoteService->getLevelName($parent['level']) . '推广'; + $prevParentId = $parent['parent_id'] == $loginPromote['parent_id'] ? 0 : $parent['parent_id']; + } else { + $parent = $loginPromote; + $currentDisplay = '自己'; + } + $searchLevel = $parent['level'] + 1; + $searchLevelName = $promoteService->getLevelName($searchLevel); + + $games = get_promote_serach_game(); + + $subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $parent['id']])->select(); + + $map = ['parent_id' => $parent['id']]; + if ($promoteId > 0) { + $map['id'] = $promoteId; + } + + $query = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level'])->where($map); + list($promotes, $pagination, $count) = $this->paginate($query); + $ids = array_column($promotes, 'id'); + + $rows = []; + if (count($ids) > 0) { + $rows = M('promote', 'tab_') + ->field(['id', 'chain']) + ->where(['chain' => ['like', [$parent['chain'] . $parent['id'] . '/%']], 'level' => ['gt', $parent['level'] + 1]]) + ->select(); + } + + $basicPromotes = []; + foreach ($ids as $id) { + foreach ($rows as $row) { + $needChain = $parent['chain'] . $parent['id'] . '/' . $id . '/'; + if (strpos($row['chain'], $needChain) !== false) { + $basicPromotes[$row['id']] = $id; + } + } + } + $params = [ + 'isContainSubs' => true, + 'basicPromotes' => $basicPromotes, + ]; + if ($relationGameId != 0 || $sdkVersion != 0) { + $gameIds = gameSearch($relationGameId, $sdkVersion); + $params['game_id'] = ['in', $gameIds]; + } + if ($serverId > 0) { + $params['server_id'] = $serverId; + } + $where = $params; + if ($sdkVersion != 0) { + $where['sdk_version'] = $sdkVersion; + } + $game = $this->getGame($where); + + if ($levelBegin !== '' || $levelEnd !== '') { + if ($levelBegin !== '' && $levelEnd !== '') { + $levelBegin = intval($levelBegin); + $levelEnd = intval($levelEnd); + if ($levelBegin > $levelEnd) { + $this->error('角色等级范围错误'); + } + $params['role_level'] = ['between', [$levelBegin, $levelEnd]]; + } elseif ($levelBegin !== '' && $levelEnd === '') { + $levelBegin = intval($levelBegin); + $params['role_level'] = ['egt', $levelBegin]; + } elseif ($levelBegin === '' && $levelEnd !== '') { + $levelEnd = intval($levelEnd); + $params['role_level'] = ['elt', $levelEnd]; + } + } + list($beginTime, $endTime) = $this->getBetweenTime($time); + $params['begin_time'] = $beginTime; + $params['end_time'] = $endTime; + + $records = []; + $promoteRepository = new PromoteRepository(); + $createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params); + + if (I('p', 1) == 1) { + $selfParams = $params; + $selfParams['isContainSubs'] = false; + $selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$parent['id']], $selfParams); + $record = [ + 'id' => $parent['id'], + 'account' => $parent['account'], + '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').'**', + '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']], + 'current_display' => $currentDisplay, + ]; + $records[] = $record; + } + foreach ($promotes as $promote) { + $id = $promote['id']; + $record = [ + 'id' => $id, + 'account' => $promote['account'], + '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').'**', + 'level' => $promote['level'], + 'game_name' => $game['game_name'], + 'sdk_version_text' => $game['sdk_version_text'], + 'server_name' => $game['server_name'], + 'role_num' => $createRoleCountList[$id], + 'current_display' => '', + ]; + $records[] = $record; + } + + $this->assign('prevParentId', $prevParentId); + $this->assign('searchLevelName', $searchLevelName); + $this->assign('games', $games); + $this->assign('parent', $parent); + $this->assign('subPromotes', $subPromotes); + $this->assign('records', $records); + $this->assign('pagination', $pagination); + $this->assign('parentId', $parentId); + $this->assign('count', $count); + $this->assign('time', $defaultTime); + $this->assign('meta_title', '推广员指标管理'); + $this->display(); + } + + private function getGame($map = []) + { + $gameName = '全部游戏'; + $sdkVersionText = getSDKTypeName(0, true); + $serverName = '--'; + if (isset($map['game_id']) || isset($map['sdk_version'])) { + $where = []; + if (!isset($map['game_id'])) { + $sdkVersionText = getSDKTypeName($map['sdk_version'], true); + } elseif (!isset($map['sdk_version'])) { + $where['game_id'] = $map['game_id']; + $gameName = M('game', 'tab_')->where($where)->getField('relation_game_name'); + if (isset($map['server_id'])) { + $serverName = $this->getServerName($map['game_id'], 0, $map['server_id']); + } + } else { + $where['game_id'] = $map['game_id']; + $where['sdk_version'] = $map['sdk_version']; + $gameName = M('game', 'tab_')->where($where)->getField('game_name'); + $sdkVersionText = getSDKTypeName($map['sdk_version'], true); + if (isset($map['server_id'])) { + $serverName = $this->getServerName($map['game_id'], $map['sdk_version'], $map['server_id']); + } + } + } + + $game = [ + 'game_name' => $gameName, + 'sdk_version_text' => $sdkVersionText, + 'server_name' => $serverName, + ]; + return $game; + } + + private function getServerName($gameIds, $serverVersion, $serverId) + { + $map['_string'] = '1 = 1'; + if ($gameIds) { + $map['game_id'] = $gameIds; + } + if ($serverVersion) { + $map['server_version'] = $serverVersion; + } + if ($serverId) { + $map['server_id'] = $serverId; + } + return M('server', 'tab_')->where($map)->getField('server_name'); + } } diff --git a/Application/Home/View/default/Query/promoteQuota.html b/Application/Home/View/default/Query/promoteQuota.html new file mode 100644 index 000000000..e499234fe --- /dev/null +++ b/Application/Home/View/default/Query/promoteQuota.html @@ -0,0 +1,178 @@ + + + + + + +
+
+
+
当前位置:数据管理>团队推广业绩
+
+ + {$meta_title} +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
推广员游戏名称平台游戏区服角色数量操作

暂无数据

{$record.account}({$record.real_name}) + + [{$record['current_display']}] + + {$record.game_name}{$record.sdk_version_text}{$record.server_name}{$record.role_num} + + 查看下级 + +
+ +
+
+ + 导出 + + {$pagination} +
+
+
+
+ +
+
+
+
+ + + + + + + + + + \ No newline at end of file From 79f9801351d0a0df76ac8f16c24629c0dc160262 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 16 Jan 2020 17:36:58 +0800 Subject: [PATCH 06/46] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=90=BD=E5=9C=B0?= =?UTF-8?q?=E9=A1=B5/=E4=B8=8B=E8=BD=BD=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Base/Service/ApplyService.class.php | 12 ++++++++ .../Home/Controller/ApplyController.class.php | 29 +++++++++++++------ .../Home/Controller/HomeController.class.php | 10 ++++++- .../Controller/PackageController.class.php | 12 +++++++- 4 files changed, 52 insertions(+), 11 deletions(-) diff --git a/Application/Base/Service/ApplyService.class.php b/Application/Base/Service/ApplyService.class.php index 5590f5924..3a963339e 100644 --- a/Application/Base/Service/ApplyService.class.php +++ b/Application/Base/Service/ApplyService.class.php @@ -197,4 +197,16 @@ class ApplyService { parse_str($items['query'], $params); return $params; } + + public function checkSociatyPerm($promote, $game) + { + $promoteService = new PromoteService(); + $topPromote = $promoteService->getTopPromote($promote); + $record = M('sociaty_games', 'tab_')->where(['game_id' => $game['id'], 'promote_id' => $topPromote['id']])->find(); + if ($record['status'] == 1) { + return true; + } else { + return false; + } + } } \ No newline at end of file diff --git a/Application/Home/Controller/ApplyController.class.php b/Application/Home/Controller/ApplyController.class.php index 18b02e1b3..c781cdaab 100644 --- a/Application/Home/Controller/ApplyController.class.php +++ b/Application/Home/Controller/ApplyController.class.php @@ -66,11 +66,11 @@ class ApplyController extends BaseController { $loginPromote = $this->getLoginPromote(); - $promoteId = empty(I('promote_id')) ? $loginPromote['id'] : I('promote_id');//搜索的渠道ID - $promoteRole = empty(I('promote_role')) ? 1 : I('promote_role');//渠道角色 - $parentPromoteId = getParentPromoteId($promoteId);//上级渠道ID - $grandPromoteId = getGrandPromoteId($promoteId);//本账号会长渠道ID - $childGameAddPermission = getChildGameAddPermission($grandPromoteId);//游戏添加权限 + $promoteId = empty(I('promote_id')) ? $loginPromote['id'] : I('promote_id'); //搜索的渠道ID + $promoteRole = empty(I('promote_role')) ? 1 : I('promote_role'); //渠道角色 + $parentPromoteId = getParentPromoteId($promoteId); //上级渠道ID + $grandPromoteId = getGrandPromoteId($promoteId); //本账号会长渠道ID + $childGameAddPermission = getChildGameAddPermission($grandPromoteId); //游戏添加权限 $map['tab_game.online_status'] = 1;//开发者游戏上线状态 $map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请 @@ -1622,17 +1622,28 @@ class ApplyController extends BaseController $gameData['sdk_name'] = getSDKTypeName($gameData['sdk_version']); - $promoteIds = getAllPromoteListByType($promoteType); + $promotes = getAllPromoteListByType($promoteType); + + M('apply', 'tab_')->where(array('game_id' => $gameId, 'promote_id' => $value['id'], 'offline_status' => 0))->count('id'); $newPromoteData = []; - if (count($promoteIds) > 0) { - foreach ($promoteIds as $value) { + if (count($promotes) > 0) { + + $promoteIds = array_column($promotes, 'id'); + $oldIds = M('apply', 'tab_')->where(['game_id' => $gameId, 'promote_id' => ['in', $promoteIds], 'offline_status' => 0])->getField('id', true); + $newPromoteIds = array_diff($promoteIds, $oldIds); + foreach ($promotes as $promote) { + if (in_array($promote['id'], $newPromoteIds)) { + $newPromoteData[] = $promote; + } + } + /* foreach ($promoteIds as $value) { $thisPromote = M('apply', 'tab_')->where(array('game_id' => $gameId, 'promote_id' => $value['id'], 'offline_status' => 0))->count('id'); if (!$thisPromote) { $newPromoteData[] = $value; } - } + } */ } $data['game_data'] = $gameData; diff --git a/Application/Home/Controller/HomeController.class.php b/Application/Home/Controller/HomeController.class.php index aaed98006..0d2991cbf 100644 --- a/Application/Home/Controller/HomeController.class.php +++ b/Application/Home/Controller/HomeController.class.php @@ -154,8 +154,8 @@ class HomeController extends Controller $this->error('该链接已被禁'); } + $applyService = new ApplyService(); if ($code != '') { - $applyService = new ApplyService(); $data = $applyService->decodeApplyCode($code); $result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_LANDING_PAGE); if (!$result['status']) { @@ -194,6 +194,11 @@ class HomeController extends Controller $map = ['id' => intval($gameId)]; $game = M('game', 'tab_')->field($columns)->where($map)->find(); + $promote = M('promote', 'tab_')->field(['id', 'parent_id', 'chain', 'level'])->where(['id' => $promoteId])->find(); + if (!$applyService->checkSociatyPerm($promote, $game)) { + $this->error('该链接已经停止使用'); + } + if ($game['sdk_version'] == 1 && $isIOS) { $map = []; $map['relation_game_id'] = $game['relation_game_id']; @@ -208,6 +213,9 @@ class HomeController extends Controller $apply = M('apply', 'tab_')->field(['game_id', 'enable_status', 'promote_id']) ->where(['promote_id' => $promoteId, 'game_id' => $game['id']]) ->find(); + if (!$apply) { + $this->error('该链接已经停止使用'); + } $game['icon'] = get_cover($game['icon'], 'path'); $gameSource = M('GameSource', 'tab_')->field(['create_time', 'org_plist_url', 'is_new_sdk'])->where(array('game_id' => $game['id']))->find(); diff --git a/Application/Home/Controller/PackageController.class.php b/Application/Home/Controller/PackageController.class.php index 09f329745..09f09ed18 100644 --- a/Application/Home/Controller/PackageController.class.php +++ b/Application/Home/Controller/PackageController.class.php @@ -40,8 +40,9 @@ class PackageController extends Controller if ($isBlack) { $this->redirect("package/downloadError", ['message' => '该链接已被禁']); } + + $applyService = new ApplyService(); if ($code != '') { - $applyService = new ApplyService(); $data = $applyService->decodeApplyCode($code); $result = $applyService->checkApplyCode($data, ApplyService::ENCRYPT_TYPE_DOWNLOAD); if (!$result['status']) { @@ -59,7 +60,16 @@ class PackageController extends Controller $map['promote_id'] = $promoteId; $columns = ['game_id', 'promote_id', 'promote_account', 'pack_url', 'plist_url', 'status', 'enable_status']; $apply = M('apply','tab_')->field($columns)->where($map)->find(); + if (!$apply) { + $this->redirect("package/downloadError", ['message' => '该链接已经停止使用']); + } + + $promote = M('promote', 'tab_')->field(['id', 'parent_id', 'chain', 'level'])->where(['id' => $promoteId])->find(); $game = M('game','tab_')->field(['id', 'game_name', 'sdk_version'])->where(['id' => $apply['game_id']])->find(); + if (!$applyService->checkSociatyPerm($promote, $game)) { + $this->redirect("package/downloadError", ['message' => '该链接已经停止使用']); + } + if (Request::isMobile()) { if (!Request::isAndroid() && $game['sdk_version'] == 1) { From 30c40d004b8ac0fca2dcf5a2833a5abbe1bd45c9 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 16 Jan 2020 18:10:58 +0800 Subject: [PATCH 07/46] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E7=AE=A1=E7=90=86--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/QueryController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index da0bac1ea..c7777c09b 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -2374,13 +2374,13 @@ class QueryController extends BaseController if (!isset($map['game_id'])) { $sdkVersionText = getSDKTypeName($map['sdk_version'], true); } elseif (!isset($map['sdk_version'])) { - $where['game_id'] = $map['game_id']; + $where['id'] = $map['game_id']; $gameName = M('game', 'tab_')->where($where)->getField('relation_game_name'); if (isset($map['server_id'])) { $serverName = $this->getServerName($map['game_id'], 0, $map['server_id']); } } else { - $where['game_id'] = $map['game_id']; + $where['id'] = $map['game_id']; $where['sdk_version'] = $map['sdk_version']; $gameName = M('game', 'tab_')->where($where)->getField('game_name'); $sdkVersionText = getSDKTypeName($map['sdk_version'], true); From 8780b57f450db777b66d6405e6a8807dd4317eac Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 16 Jan 2020 18:13:58 +0800 Subject: [PATCH 08/46] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E7=AE=A1=E7=90=86--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/View/default/Query/promoteQuota.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Application/Home/View/default/Query/promoteQuota.html b/Application/Home/View/default/Query/promoteQuota.html index e499234fe..a941f9c6e 100644 --- a/Application/Home/View/default/Query/promoteQuota.html +++ b/Application/Home/View/default/Query/promoteQuota.html @@ -16,7 +16,7 @@
-
当前位置:数据管理>团队推广业绩
+
当前位置:数据管理>{$meta_title}
{$meta_title} @@ -56,6 +56,12 @@
+
+ + + + +
From 5fbe482fbae5786864c2770b423773bec509bd17 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 16 Jan 2020 19:39:47 +0800 Subject: [PATCH 09/46] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E7=AE=A1=E7=90=86--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/QueryController.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index c7777c09b..e27715e03 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -2214,13 +2214,11 @@ class QueryController extends BaseController //推广员指标管理 public function promoteQuota() { - $time = I('time', date('Y-m-d')); + $nowTime = date('Y-m-d', time()); + $defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime; + $time = I('time', $defaultTime); if (!empty($time)) { $defaultTime = $time; - } else { - $nowTime = date('Y-m-d', time()); - $defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime; - $time = $defaultTime; } $sdkVersion = I('sdk_version', 0); $relationGameId = I('relation_game_id', 0); From 784f416ad5f78ab6173a792ea53fac7cf7784cd3 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 16 Jan 2020 20:36:21 +0800 Subject: [PATCH 10/46] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E7=AE=A1=E7=90=86--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/QueryController.class.php | 68 ++++++++++++ .../Home/View/default/Query/promoteQuota.html | 13 ++- .../Home/View/default/Query/quotaDtl.html | 100 ++++++++++++++++++ 3 files changed, 177 insertions(+), 4 deletions(-) create mode 100644 Application/Home/View/default/Query/quotaDtl.html diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index e27715e03..5ef741147 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -2362,6 +2362,74 @@ class QueryController extends BaseController $this->display(); } + public function quotaDtl() + { + $nowTime = date('Y-m-d', time()); + $defaultTime = date('Y-m-d', strtotime('-6 day', time())) . " 至 " . $nowTime; + $time = I('time', $defaultTime); + $relationGameId = I('relation_game_id', 0); + $sdkVersion = I('sdk_version', 0); + $serverId = I('server_id', 0); + $roleLevelBegin = intval(I('level_begin', 0)); + $roleLevelEnd = intval(I('level_end', 0)); + $promoteId = I('promote_id', 0); + $isSelf = I('is_self', 0); + + if ($relationGameId != 0 || $sdkVersion != 0) { + $gameIds = gameSearch($relationGameId, $sdkVersion); + $map['game_id'] = ['in', $gameIds]; + } + if ($serverId != 0) { + $map['server_id'] = $serverId; + } + if ($roleLevelBegin != 0 && $roleLevelEnd == 0) { + $map['role_level'] = ['egt', $roleLevelBegin]; + } elseif ($roleLevelEnd != 0 && $roleLevelBegin == 0) { + $map['role_level'] = ['elt', $roleLevelEnd]; + } elseif ($roleLevelEnd != 0 && $roleLevelBegin != 0) { + $map['role_level'] = ['between', [$roleLevelBegin, $roleLevelEnd]]; + } + list($beginTime, $endTime) = $this->getBetweenTime($time); + $map['create_time'] = ['between', [$beginTime, $endTime]]; + if ($promoteId) { + if ($isSelf) { + $map['promote_id'] = $promoteId; + } else { + $promote = M('promote', 'tab_')->field(['id', 'chain'])->where(array('id' => $promoteId))->find(); + $promoteMap['chain'] = ['like', "{$promote['chain']}{$promote['id']}/%"]; + $promoteIds = M('promote', 'tab_')->where($promoteMap)->getField('id', true); + $promoteIds[] = $promoteId; + $map['promote_id'] = ['in', $promoteIds]; + } + } else { + $map = '1 = 2'; + } + + $query = M('user_play_info', 'tab_')->where($map)->order('create_time desc'); + list($records, $pagination, $count) = $this->paginate($query); + foreach ($records as $key => $value) { + //订单隐藏算法 + $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); + } + + $this->assign('records', $records); + $this->assign('pagination', $pagination); + $this->assign('count', $count); + $this->display(); + } + private function getGame($map = []) { $gameName = '全部游戏'; diff --git a/Application/Home/View/default/Query/promoteQuota.html b/Application/Home/View/default/Query/promoteQuota.html index a941f9c6e..253b7a0dc 100644 --- a/Application/Home/View/default/Query/promoteQuota.html +++ b/Application/Home/View/default/Query/promoteQuota.html @@ -10,6 +10,10 @@ line-height: 34px; height: 34px; } + .btn-span { + color: #06c; + cursor: pointer; + } @@ -80,9 +84,7 @@ 平台 游戏区服 角色数量 - 操作 -

暂无数据

@@ -98,13 +100,16 @@ {$record.sdk_version_text} {$record.server_name} {$record.role_num} - 查看下级 + + 查看详情 + + 查看详情 + -
diff --git a/Application/Home/View/default/Query/quotaDtl.html b/Application/Home/View/default/Query/quotaDtl.html new file mode 100644 index 000000000..e79866c3c --- /dev/null +++ b/Application/Home/View/default/Query/quotaDtl.html @@ -0,0 +1,100 @@ + + + + + + + +
+
+ 返回 +
+
+
+
当前位置:数据管理>推广员指标管理>查看详情
+
+ + 查看详情 +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
玩家帐号推广账号游戏名称平台游戏区服角色名等级创建时间

暂无数据

{$record.user_account}{$record.promote_account}{$record.game_name}{:getSDKTypeName($record['sdk_version'])}{$record.server_name}{$record.role_name}{$record.role_level} + + {$record.play_time|date='Y-m-d H:i:s',###} + + {$record.create_time|date='Y-m-d H:i:s',###} + +
+ +
+
+ + 导出 + + {$pagination} +
+
+
+
+ +
+
+
+
+ + + + + + + + \ No newline at end of file From 8c43defff36dccf6da56bea0d51282211a84c328 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 16 Jan 2020 20:38:36 +0800 Subject: [PATCH 11/46] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E7=AE=A1=E7=90=86--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/QueryController.class.php | 2 +- Application/Home/View/default/Public/promote_base.html | 1 + Application/Home/View/default/Query/quotaDtl.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 5ef741147..0a2c369dd 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -2358,7 +2358,7 @@ class QueryController extends BaseController $this->assign('parentId', $parentId); $this->assign('count', $count); $this->assign('time', $defaultTime); - $this->assign('meta_title', '推广员指标管理'); + $this->assign('meta_title', '推广员指标'); $this->display(); } diff --git a/Application/Home/View/default/Public/promote_base.html b/Application/Home/View/default/Public/promote_base.html index 1e53ffa9a..5cee5185d 100644 --- a/Application/Home/View/default/Public/promote_base.html +++ b/Application/Home/View/default/Public/promote_base.html @@ -67,6 +67,7 @@ 角色查询 充值玩家 团队/推广员业绩 + 推广员指标
diff --git a/Application/Home/View/default/Query/quotaDtl.html b/Application/Home/View/default/Query/quotaDtl.html index e79866c3c..e96f0cd36 100644 --- a/Application/Home/View/default/Query/quotaDtl.html +++ b/Application/Home/View/default/Query/quotaDtl.html @@ -20,7 +20,7 @@
-
当前位置:数据管理>推广员指标管理>查看详情
+
当前位置:数据管理>推广员指标>查看详情
查看详情 From b9ddc1aafb2bb44bd6ea841416a2f06afc76daf6 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Fri, 17 Jan 2020 09:57:56 +0800 Subject: [PATCH 12/46] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/GameController.class.php | 117 +++++++++++++----- Application/Admin/View/Game/edit.html | 111 ++++++++++++++--- 2 files changed, 186 insertions(+), 42 deletions(-) diff --git a/Application/Admin/Controller/GameController.class.php b/Application/Admin/Controller/GameController.class.php index eb6b0b898..72840d89f 100644 --- a/Application/Admin/Controller/GameController.class.php +++ b/Application/Admin/Controller/GameController.class.php @@ -289,19 +289,45 @@ class GameController extends ThinkController } } + public function delSociatyGames() { + $res = ['code' => 10000]; + $id = $_REQUEST['id']; + $delRest = M('sociaty_games','tab_')->where(['id'=>$id])->delete(); + if($delRest) { + $res['code'] = 10001; + $this->ajaxReturn($res); + } + } + public function edit($id = null) { if (IS_POST) { - if(!empty($_REQUEST['promote_data'])) { - $promote_data = json_decode($_REQUEST['promote_data'],TRUE); + if(!empty($_REQUEST['apply_auth'])) { + $gameData['apply_auth'] = $_REQUEST['apply_auth']; $game_appid = $_REQUEST['game_appid']; $gameId = M('game','tab_')->where(['game_appid' => $game_appid])->getField('id'); - $gameInfo = M('game','tab_')->field('game_name,game_status')->where(['id'=>$gameId])->select(); - $dataList = array(); - foreach($promote_data as $key => $promoteInfo) { - $dataList[] = ['promote_id' => intval($promoteInfo['value']),'game_id' => intval($gameId),'status'=>$gameInfo[0]['game_status'],'create_time'=>time()]; + M('game','tab_')->where(['id'=>$gameId])->save($gameData); + if($_REQUEST['apply_auth'] == 1) { + M('sociaty_games','tab_')->where(['game_id'=>$gameId])->delete(); } - M('sociaty_games','tab_')->addAll($dataList); + if(!empty($_REQUEST['promote_data'])) { + $promote_data = json_decode($_REQUEST['promote_data'],TRUE); + $game_appid = $_REQUEST['game_appid']; + $gameId = M('game','tab_')->where(['game_appid' => $game_appid])->getField('id'); + $gameInfo = M('game','tab_')->field('game_name,game_status')->where(['id'=>$gameId])->select(); + $dataList = array(); + foreach($promote_data as $key => $promoteInfo) { + $isSociaty = M('sociaty_games','tab_')->where(['promote_id'=>intval($promoteInfo['value']),'game_id'=>intval($gameId)])->getField('id'); + if(!empty($isSociaty)) { + // $this->error("选择会长中有已存在会长"); + }else { + $dataList[] = ['promote_id' => intval($promoteInfo['value']),'game_id' => intval($gameId),'status'=>$gameInfo[0]['game_status'],'create_time'=>time()]; + } + + } + M('sociaty_games','tab_')->addAll($dataList); + } + // $_REQUEST['apply_auth'] == 1 ? $this->success('开放全部会长权限成功') : $this->success('设置会长权限成功'); } if ($_POST['game_score'] <0 || $_POST['game_score'] > 5) { $this->error('游戏评分只能为0-5之间的数字!'); @@ -415,7 +441,30 @@ class GameController extends ThinkController $data['icon_data'] = explode(',', $data['icon']); } - + $apply_auth = M('game','tab_')->where(['id'=>$id])->getField('apply_auth'); + $this->assign('apply_auth',$apply_auth); + $sociatyGames = M('sociaty_games','tab_')->where(['game_id'=>$id])->select(); + $sociatyGamesData = []; + if(!empty($sociatyGames)) { + foreach($sociatyGames as $key => $value) { + $sociatyGamesData[$key]['id'] = $value['id']; + if($value['promote_id'] == -1) { + $sociatyGamesData[$key]['promoteAccount'] = "官方渠道"; + }else { + $promoteAccount = M('promote','tab_')->where(['id'=>$value['promote_id']])->getField('account'); + $sociatyGamesData[$key]['promoteAccount'] = $promoteAccount; + } + $sociatyGamesData[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']); + $applyStatus = M('apply','tab_')->field('id')->where(['game_id'=>$value['game_id'],'status'=>1])->select(); + if(empty($applyStatus)) { + $sociatyGamesData[$key]['isPromote'] = "否"; + }else { + $sociatyGamesData[$key]['isPromote'] = "是"; + } + } + } + $this->assign('sociatygames',$sociatyGamesData); + $data['introduction'] = str_replace("~~", "\r\n", $data['introduction']); $this->assign('data', $data); $this->assign('game_id', $id); @@ -911,6 +960,7 @@ class GameController extends ThinkController public function uploadExcel1() { Vendor("PHPExcel.PHPExcel"); + $gid = $_REQUEST['game_id']; if(@is_uploaded_file($_FILES['file']['tmp_name'])){ $upfile = $_FILES["file"]; $name = $upfile["name"]; @@ -921,10 +971,11 @@ class GameController extends ThinkController move_uploaded_file($tmp_name,$savePath.$name); $file_name = $savePath.$name; $error=$upfile["error"];//上传后系统返回的值 - // print($file_name); $extension = strtolower( pathinfo($file_name, PATHINFO_EXTENSION) ); if($extension == 'xlsx') { $objReader = \PHPExcel_IOFactory::createReader('excel2007'); + }elseif($extension == 'csv') { + $objReader = \PHPExcel_IOFactory::createReader('csv'); }else { $objReader = \PHPExcel_IOFactory::createReader('Excel5');//创建读取实例 } @@ -933,24 +984,38 @@ class GameController extends ThinkController $highestRow = $sheet->getHighestRow(); $highestColumn = $sheet->getHighestColumn(); $dataList = []; + $outPromote = []; //录入出错的会长 + $outGame = []; //录入出错的游戏 + $keyPro = 0; + $keyGame = 0; + $keyData = 0; for($i=2;$i<=$highestRow;$i++) { - $promote_id = $objPHPExcel->getActiveSheet()->getCell("A".$i)->getValue(); - $promoteInfo = M('promote','tab_')->field('account')->where(['id' => $promote_id ])->find(); - + $promoteAccount = $objPHPExcel->getActiveSheet()->getCell("A".$i)->getValue(); + $promoteInfo = M('promote','tab_')->field('id')->where(['account' => $promoteAccount ])->find(); + if($promote_id == -1) {$promoteInfo['account'] = "官方渠道"; } if(empty($promoteInfo)) { - break; - } - $game_id = $objPHPExcel->getActiveSheet()->getCell("B".$i)->getValue(); - $gameInfo = M('game','tab_')->field('game_name,game_status')->where(['id'=>$game_id])->select(); - if(empty($gameInfo)) { - break; + $outPromote[$keyPro]['promote_account'] = $promoteAccount; + $keyPro += 1; + }else { + $promote_id = $promoteInfo['id']; } + $gameInfo = M('game','tab_')->field('game_name,game_status')->where(['id'=>$gid])->select(); $time = time(); - $dataList[] = ['promote_id'=>$promote_id,'game_id'=>$game_id,'status'=>$gameInfo[0]['game_status'],'create_time'=>$time]; + $isSociaty = M('sociaty_games','tab_')->where(['promote_id'=>$promote_id,'game_id'=>$gid])->getField('id'); + if(empty($isSociaty) && !empty($gameInfo) && !empty($promoteInfo)) { + $dataList[$keyData] = ['promote_id'=>$promote_id,'game_id'=>$gid,'status'=>$gameInfo[0]['game_status'],'create_time'=>$time]; + $successAccount[$keyData] = ['account'=>$promoteAccount]; + $keyData += 1; + } + } - M('sociaty_games','tab_')->addAll($dataList); - $this->ajaxReturn(json_encode($dataList)); + $backData['outPromote'] = $outPromote; + $backData['datalist'] = $successAccount; + M('sociaty_games','tab_')->addAll($dataList); + $gameData['apply_auth'] = 2; + M('game','tab_')->where(['id'=>$gid])->save($gameData); + $this->ajaxReturn(json_encode($backData,TRUE)); } } @@ -970,16 +1035,12 @@ class GameController extends ThinkController $game_id = $_REQUEST['game_id']; $game_name = M('game','tab_')->where(['id'=>$game_id])->getField('game_name'); $data[] = [ - 'promoteid' => 99, - 'game_id' => $game_id, - 'game_name' => $game_name + 'promoteid' => "官方渠道", ]; $field = array( - "promoteid"=>"会长ID", - "game_id"=>"游戏ID(无需修改,已默认当前游戏)", - "game_name"=>"游戏名称(无需修改,已默认当前游戏)" + "promoteid"=>"会长账号", ); - data2csv($data,"模板",$field); + data2csv($data,'【'.$game_name.'】'.'模板',$field); } } diff --git a/Application/Admin/View/Game/edit.html b/Application/Admin/View/Game/edit.html index f0c2dc058..df524dd4c 100644 --- a/Application/Admin/View/Game/edit.html +++ b/Application/Admin/View/Game/edit.html @@ -944,13 +944,47 @@
- + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
会长账号添加时间是否已进行推广操作
aOh! 暂时还没有内容!
{$data['promoteAccount']}{$data['create_time']}{$data['isPromote']}移除
该游戏未设置会长权限,现面对所有会长开放!
+
+
+ @@ -978,7 +1012,7 @@ @@ -1078,6 +1112,7 @@ From 58eb6a0e12664c7ae7cb60a10787a167a4dc53a6 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 6 Feb 2020 20:05:07 +0800 Subject: [PATCH 27/46] =?UTF-8?q?=E6=96=B0=E5=A2=9Ecp=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A5=96=E7=BD=9A=E8=87=AA=E5=8A=A8=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/StatementController.class.php | 98 +++++++++--- .../View/Statement/createCpStatement.html | 139 +++++++++++++----- .../Admin/View/Statement/editCpStatement.html | 48 +++--- 3 files changed, 212 insertions(+), 73 deletions(-) diff --git a/Application/Admin/Controller/StatementController.class.php b/Application/Admin/Controller/StatementController.class.php index ba9fb63f8..69042b87d 100644 --- a/Application/Admin/Controller/StatementController.class.php +++ b/Application/Admin/Controller/StatementController.class.php @@ -18,8 +18,14 @@ class StatementController extends ThinkController $first_party_info = json_decode($dbres['first_party_info'],true); $second_party_info = json_decode($dbres['second_party_info'],true); $statement_info = json_decode($dbres['statement_info'],true); - $fine = array_pop($statement_info); + if($dbres['company_name'] == $first_party_info['partner']){ + $first_partner_type=0; + }else{ + $first_partner_type=1; + } + // $fine = array_pop($statement_info); $senddata = array( + "first_partner_type"=>$first_partner_type, "first_part_company"=>$first_party_info['partner'], "second_part_company"=>$second_party_info['partner'], "statement_type"=>$_REQUEST['pay_type'] == 0 ? 1 :0, @@ -27,13 +33,13 @@ class StatementController extends ThinkController "second_party_info"=>$second_party_info, "statement_info"=>$statement_info, "statement_count"=>array("sum_money"=>$dbres['statement_money'],"pay_amount"=>$dbres['pay_amount']), - "fine"=>$fine['sum_money'], + "fine"=>0, "statement_begin_time"=>date("Y-m-d",$dbres['statement_begin_time']), "statement_end_time"=>date("Y-m-d",$dbres['statement_end_time']) ); $this->assign("data",$senddata); if($_REQUEST['pay_type'] == 0){ - $this->assign("company",$dbres['company_name']); + $this->assign("company",$second_party_info['partner']); }else{ $this->assign("company",$first_party_info['partner']); } @@ -56,15 +62,20 @@ class StatementController extends ThinkController $this->ajaxReturn(array("error"=>"database error","code"=>2000)); } } + public function getCompanyList() + { + $data = array(); + $data['ptCompany']= M("CompanyInfo","tab_")->field('id,partner')->select(); + $data['cpCompany']= getPartner(); + $this->ajaxReturn(array("success"=>$data,"code"=>2000)); + } //获取推广公司基础信息 public function getCpCompanyInfo() { $CompanyId = $_REQUEST['company_id']; - if($CompanyId == 0){ - $mycompany = M("tool","tab_")->field("config")->where("name='company_info'")->find(); - $info = json_decode($mycompany['config'],true); - $info['id'] = 0; - unset($info['status']); + $company_type = $_REQUEST['company_type']; + if($company_type == 'pt'){ + $info = M("CompanyInfo","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank")->where("id = '{$CompanyId}'")->find(); }else{ $info = M("partner","tab_")->field("id,partner,link_man,link_phone,address,company_tax_no,payee_name,bank_account,opening_bank")->where("id = '{$CompanyId}'")->find(); } @@ -81,7 +92,8 @@ class StatementController extends ThinkController $map["pay_status"] = 1; $CompanyId = $_REQUEST['company_id']; //对账公司id - $statement_type = $_REQUEST['statement_type']; + $statement_type = $_REQUEST['statement_type'];//付款方 + $first_partner_type = $_REQUEST['first_partner_type'];//甲方类型:0cp,1pt $is_month = false;//是否是月结判断,非月结无需梯度计算 if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { @@ -164,8 +176,14 @@ class StatementController extends ThinkController // $redio = $ratiores[0]['ratio']; // } $redio = getGameCpRadio($v['game_id'],$v['pay_amount'],$is_month);//获取分成比例 - $v['second_ratio'] = $redio; - $v['first_ratio'] = (100-$redio); + if($first_partner_type==0){ + //甲方cp + $v['first_ratio'] = round($redio,2); + $v['second_ratio'] = round((100-$redio),2); + }else{ + $v['second_ratio'] = round($redio,2); + $v['first_ratio'] = round((100-$redio),2); + } if($statement_type == 0){ $v['sum_money'] = round($v['pay_amount']*$v['first_ratio']/100,2); }else{ @@ -180,6 +198,41 @@ class StatementController extends ThinkController $v['statement_end_time']=$_REQUEST['time_end']; $v['statement_type']=0; } + //获取奖罚 + $rrmap = array( + "reward_time" => ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]], + ); + $rfres = M("RewardRecord","tab_") + ->field(" + IFNULL(SUM(CASE WHEN reward_type = 1 THEN money ELSE 0 END),0) as reward_count, + IFNULL(SUM(CASE WHEN reward_type = 2 THEN money ELSE 0 END),0) as fine_count + ") + ->where($rrmap)->find(); + if($rfres['reward_count'] > 0){ + $list[] = array( + "statement_begin_time"=>$_REQUEST['time_start'], + "statement_end_time"=>$_REQUEST['time_end'], + 'statement_type'=>2, + "game_name"=>"奖励", + 'pay_amount'=>$rfres['reward_count'], + 'sum_money'=>$rfres['reward_count'], + ); + $countarr['pay_amount'] +=$rfres['reward_count']; + $countarr['sum_money']+=$rfres['reward_count']; + } + if($rfres['fine_count'] > 0){ + $list[] = array( + "statement_begin_time"=>$_REQUEST['time_start'], + "statement_end_time"=>$_REQUEST['time_end'], + 'statement_type'=>1, + "game_name"=>"罚款", + 'pay_amount'=>$rfres['fine_count'], + 'sum_money'=>$rfres['fine_count'], + ); + $countarr['pay_amount'] -= $rfres['fine_count']; + $countarr['sum_money'] -= $rfres['fine_count']; + } + $countarr['pay_amount'] = round($countarr['pay_amount'],2); $countarr['sum_money'] = round($countarr['sum_money'],2); @@ -188,19 +241,26 @@ class StatementController extends ThinkController } //添加数据 public function doAddCpStatement($id = 0){ + $first_partner_type = $_REQUEST['first_partner_type']; + if($first_partner_type == 0){ + //甲方cp + $company = $_REQUEST['first_party_info']; + }else{ + $company =$_REQUEST['second_party_info']; + } $second_party_info = $_REQUEST['second_party_info']; $statement_info = $_REQUEST['statement_info']; - $statement_info[] = array( - "sum_money"=>$_REQUEST['fine'], - "type_name"=>"罚款", - "statement_type"=>1 - ); + // $statement_info[] = array( + // "sum_money"=>$_REQUEST['fine'], + // "type_name"=>"罚款", + // "statement_type"=>1 + // ); //拼凑数据 $adddata = array( "statement_type"=>0, - "company_id"=>$second_party_info['id'], - "company_name"=>$second_party_info['partner'], - "link_phone"=>$second_party_info['link_phone'], + "company_id"=>$company['id'], + "company_name"=>$company['partner'], + "link_phone"=>$company['link_phone'], "statement_begin_time"=>strtotime($_REQUEST['statement_begin_time']), "statement_end_time"=>strtotime($_REQUEST['statement_end_time']), 'create_time'=>time(), diff --git a/Application/Admin/View/Statement/createCpStatement.html b/Application/Admin/View/Statement/createCpStatement.html index 07efd2329..ed7f3cc8c 100644 --- a/Application/Admin/View/Statement/createCpStatement.html +++ b/Application/Admin/View/Statement/createCpStatement.html @@ -89,16 +89,24 @@
+ + + + @@ -107,25 +115,25 @@ @@ -135,16 +143,16 @@
公司类型: +
+ +
+
甲方:
联系人: - +
联系电话: - +
邮寄地址: - +
公司税号: - +
+ + + + @@ -381,26 +389,34 @@ - + class="form-horizontal form_info_ml" id="form">
奖惩编辑
    @@ -145,7 +145,10 @@
  • - + +
@@ -171,18 +174,29 @@ $(document).on('click', '.bnt_remove', function(){ $(this).parents('li').remove(); }); - - // $('#reward_time').datetimepicker({ - // format: 'yyyy-mm-dd', - // language: "zh-CN", - // minView: 2, - // autoclose: true - // }); - $('#reward_time').datetimepicker({ - language:"zh-CN", - hour: 13, - minute: 15 + var date = new Date(); + var monthStart = date.getFullYear()+'-0'+(date.getMonth()+1)+'-01'; + $("#reward_time").datetimepicker({ + format : "yyyy-mm-dd hh:ii", + autoclose : true, + todayBtn : true, + todayHighlight : true, + startDate : monthStart, + language : 'zh-CN', + startView : 2,//月视图 + showMeridian : true, + pickerPosition : "bottom-left", + minuteStep : 5 }); + + /* $('#reward_time').datetimepicker({ + language:"zh-CN", + hour: 13, + minute: 15, + setStartDate:'2020-02-01', + todayHighlight : true, + todayBtn:true + });*/ var company_id = '{$data["company_id"]}'; function companyTypeChange() { From 1cfc48ded224677138a77206f7b017a1064bc2fc Mon Sep 17 00:00:00 2001 From: zyx Date: Sat, 8 Feb 2020 13:01:25 +0800 Subject: [PATCH 33/46] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E5=85=85=E5=80=BCcp?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=8F=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/ExportController.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index d61e779d8..f884e1056 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -1176,6 +1176,7 @@ class ExportController extends Controller foreach($xlsData as $value) { $value['pay_time'] = date('Y-m-d H:i:s',$value['pay_time']); + $value['extend'] = $value['extend'].'`'; $value['pay_way'] = get_pay_way($value['pay_way']); $value['pay_status'] = get_info_status($value['pay_status'],9); $value['pay_game_status'] = get_info_status($value['pay_game_status'],14); From a9cae8424bb548bd420fe44a5e7a7ee71f139419 Mon Sep 17 00:00:00 2001 From: zyx Date: Sat, 8 Feb 2020 15:26:05 +0800 Subject: [PATCH 34/46] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E5=85=85=E5=80=BCbug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ExportController.class.php | 125 +++++++++++------- 1 file changed, 74 insertions(+), 51 deletions(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index f884e1056..76cd96221 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -1054,87 +1054,108 @@ class ExportController extends Controller break; case 7: + $startDate = empty($_REQUEST['timestart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timestart']; + $endDate = empty($_REQUEST['timeend']) ? date('Y-m-d') : $_REQUEST['timeend']; + + $startTime = strtotime($startDate); + $endTime = strtotime($endDate) + 86399; + $map['pay_time'] = array('BETWEEN', array($startTime, $endTime)); + + unset($_REQUEST['timestart']); + unset($_REQUEST['timeend']); + if (isset($_REQUEST['user_account'])) { - $map['user_account'] = array('like', '%' . trim($_REQUEST['user_account']) . '%'); + $map['user_account'] = array('like', trim($_REQUEST['user_account'])); unset($_REQUEST['user_account']); } if (isset($_REQUEST['spend_ip'])) { - $map['spend_ip'] = array('like', '%' . trim($_REQUEST['spend_ip']) . '%'); + $map['spend_ip'] = array('like', trim($_REQUEST['spend_ip']) . '%'); unset($_REQUEST['spend_ip']); } - if (isset($_REQUEST['time-start']) && isset($_REQUEST['time-end'])) { - $map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['time-start']), strtotime($_REQUEST['time-end']) + 24 * 60 * 60 - 1)); - unset($_REQUEST['time-start']); - unset($_REQUEST['time-end']); - } - if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) { - $map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['timestart']), strtotime($_REQUEST['timeend']) + 24 * 60 * 60 - 1)); - unset($_REQUEST['timestart']); - unset($_REQUEST['timeend']); - } - if (isset($_REQUEST['start']) && isset($_REQUEST['end'])) { - $map['pay_time'] = array('BETWEEN', array(strtotime($_REQUEST['start']), strtotime($_REQUEST['end']) + 24 * 60 * 60 - 1)); - unset($_REQUEST['start']); - unset($_REQUEST['end']); - } - if(isset($_REQUEST['game_name'])){ - if($_REQUEST['game_name']=='全部'){ + if (isset($_REQUEST['game_name'])) { + if ($_REQUEST['game_name'] == '全部') { unset($_REQUEST['game_name']); - }else{ - $map['tab_spend.game_id']= ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')]; + } else { + $map['game_id'] = ['in', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')]; unset($_REQUEST['game_name']); } } - if(isset($_REQUEST['server_name'])){ - $map['tab_spend.server_name']=$_REQUEST['server_name']; - unset($_REQUEST['server_name']); + if (isset($_REQUEST['game_type']) && $_REQUEST['game_type']) { + $map['sdk_version'] = $_REQUEST['game_type']; + } + if (isset($_REQUEST['server_id'])) { + $map['server_id'] = $_REQUEST['server_id']; + unset($_REQUEST['server_id']); } if (isset($_REQUEST['pay_order_number'])) { - $map['pay_order_number'] = array('like', '%' . trim($_REQUEST['pay_order_number']) . '%'); + $map['pay_order_number'] = array('like', trim($_REQUEST['pay_order_number'])); unset($_REQUEST['pay_order_number']); } + if (isset($_REQUEST['extend'])) { + $map['extend'] = array('like', trim($_REQUEST['extend'])); + unset($_REQUEST['extend']); + } if (isset($_REQUEST['pay_status'])) { $map['pay_status'] = $_REQUEST['pay_status']; unset($_REQUEST['pay_status']); } if (isset($_REQUEST['pay_way'])) { - $map['pay_way'] = $_REQUEST['pay_way']; - unset($_REQUEST['pay_status']); + if ($_REQUEST['pay_way'] == 2) { + $map['pay_way'] = ['in', '2,3,4']; + } else { + $map['pay_way'] = $_REQUEST['pay_way']; + } + unset($_REQUEST['pay_way']); } if (isset($_REQUEST['pay_game_status'])) { $map['pay_game_status'] = $_REQUEST['pay_game_status']; unset($_REQUEST['pay_game_status']); } -// $promoteRoot = getPowerPromoteIds(); -// $data_empower_type = session('user_auth')['data_empower_type']; +// $promoteRoot = getPowerPromoteIds(); +// $data_empower_type = session('user_auth')['data_empower_type']; // -// if ($promoteRoot) { -// $map['promote_id'] =array('in',$promoteRoot); -// } else if(!$promoteRoot&&$data_empower_type!=1){ -// $map['id'] = array('lt',1); -// } +// if ($promoteRoot) { +// $map['promote_id'] =array('in',$promoteRoot); +// } else if(!$promoteRoot&&$data_empower_type!=1){ +// $map['id'] = array('lt',1); +// } setPowerPromoteIds($map,'promote_id'); - if(isset($_REQUEST['promote_id'])) { - if ($_REQUEST['promote_id'] == 0) { + if (isset($_REQUEST['promote_id'])) { + $promoteId = intval($_REQUEST['promote_id']); + if ($promoteId == 0) { $map['promote_id'] = 0; } else { - $map['_complex'] = ['tp.chain'=>['like', "%/{$_REQUEST['promote_id']}/%"], 'tp.id'=>$_REQUEST['promote_id'], '_logic' => 'or']; + $promoteMap['chain'] = ['like', "%/$promoteId/%"]; + $promoteIds = M('Promote', 'tab_')->where($promoteMap)->getField('id', true); + $promoteIds[] = $promoteId; + $map['promote_id'] = ['in', $promoteIds]; } - $tab_promote_join = "left join tab_promote as tp on tp.id = tab_spend.promote_id"; - //unset($_REQUEST['promote_id']); + } + if ($_REQUEST['data_order'] != '') { + $data_order = reset(explode(',', $_REQUEST['data_order'])); + $data_order_type = end(explode(',', $_REQUEST['data_order'])); + $this->assign('userarpu_order', $data_order); + $this->assign('userarpu_order_type', $data_order_type); + $sort = $data_order == 3 ? 'desc' : 'asc'; + $order = $data_order_type . ' ' . $sort; } else { - $tab_promote_join = false; + $order = ' pay_time desc '; } + + // if (intval(($endTime + 1) - $startTime) / (24 * 3600) <= 31) { + // $map1 = $map; + // $map1['pay_status'] = 1; + // } else { + // $map = '1 = 2'; + // $map1 = $map; + // } $map1 = $map; $map1['pay_status'] = 1; - $total = D('Spend')->where($map1)->join($tab_promote_join)->sum('pay_amount'); - if (isset($map['pay_status']) && $map['pay_status'] == 0) { - $total = sprintf("%.2f", 0); - } else { - $total = sprintf("%.2f", $total); - } + $total = M('Spend','tab_')->where($map1)->sum('pay_amount'); +// var_dump($total);die(); + $total=$total?$total:0; $xlsCell = array( @@ -1155,10 +1176,7 @@ class ExportController extends Controller fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 $accessNum = D('Spend') - ->field('pay_order_number,pay_time,user_account,game_name,promote_account,spend_ip,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status') ->where($map) - ->join($tab_promote_join) - ->order('pay_time DESC') ->count(); $perSize = 10000;//每次查询的条数 @@ -1167,11 +1185,16 @@ class ExportController extends Controller // var_dump($count);die(); for($i = 1; $i <= $pages; $i++) { $xlsData = D('Spend') +// ->field('pay_order_number,extend,pay_time,user_account,game_name,promote_account,spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status') +// ->where($map) +// ->limit(($i-1)*$perSize ,$perSize) +// ->join($tab_promote_join) +// ->order('pay_time DESC') +// ->select(); ->field('pay_order_number,extend,pay_time,user_account,game_name,promote_account,spend_ip,server_id,server_name,game_player_id,game_player_name,cost,pay_amount,pay_way,pay_status,pay_game_status') ->where($map) ->limit(($i-1)*$perSize ,$perSize) - ->join($tab_promote_join) - ->order('pay_time DESC') + ->order($order ? $order : 'pay_time desc') ->select(); foreach($xlsData as $value) { From a10a21c12bcdc60afce4cd5ac6f5585c17046ce0 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Mon, 10 Feb 2020 10:04:54 +0800 Subject: [PATCH 35/46] update sql remark --- Data/update.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data/update.sql b/Data/update.sql index fb9c70756..ec88bb531 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1114,7 +1114,7 @@ ADD COLUMN `auto_review_withdraw_updated_time` int(10) NOT NULL DEFAULT 0 COMMEN ALTER TABLE `tab_promote` ADD INDEX `auto_review_withdraw_status`(`auto_review_withdraw_status`) USING BTREE; --- 奖罚记录 +-- 2020-02-10 yulingwei 奖罚记录 CREATE TABLE `tab_reward_record` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `reward_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '奖罚类型 1奖励 2惩罚', @@ -1148,7 +1148,7 @@ CREATE TABLE `tab_company_info` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='内部公司信息'; --- 推广工会管理 新增属性类型 +-- 2020-02-10 yulingwei 推广工会管理 新增属性类型 ALTER TABLE `tab_promote_belong` MODIFY COLUMN `company_belong` tinyint(1) UNSIGNED NOT NULL DEFAULT 3 COMMENT '工会归属:0-内团;1-外团 2-分发联盟 3 无' AFTER `verify_status`, MODIFY COLUMN `company_relation` tinyint(1) UNSIGNED NOT NULL DEFAULT 2 COMMENT '工会关系:0-自主开发及维护;1-只维护 2 无' AFTER `company_belong`; From 2af2505819e3cd0ed15e418dd27257cfcad992a7 Mon Sep 17 00:00:00 2001 From: liuweiwen <529520975@qq.com> Date: Mon, 10 Feb 2020 11:22:48 +0800 Subject: [PATCH 36/46] =?UTF-8?q?=E5=90=88=E5=B9=B6=E7=83=AD=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/ExportController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 7b95f8c82..14f221229 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -7163,7 +7163,7 @@ class ExportController extends Controller if (!empty(I('timestart'))) { $timestart = strtotime(I('timestart')); - $map['_string'] = "s.pay_time > {$timestart}"; + $map['_string'] = "s.pay_time >= {$timestart}"; } if (!empty(I('timeend'))) { From d5a63a7849087ed0b56c7dfe37beec143d4e8db3 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Mon, 10 Feb 2020 14:14:40 +0800 Subject: [PATCH 37/46] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0>?= =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98>=E7=BB=93=E7=AE=97=E7=AE=A1?= =?UTF-8?q?=E7=90=86>=E6=8E=A8=E5=B9=BF=E6=8F=90=E7=8E=B0>=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=AE=A1=E6=A0=B8=E7=AE=A1=E7=90=86--=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/QueryController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index 544d7eb71..63c99a420 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -1770,7 +1770,7 @@ class QueryController extends ThinkController $records = []; if (!empty($promotes)) { foreach ($promotes as $promote) { - $promote['company_name'] = $companyList[$promote['company_id']] ?? '未知'; + $promote['company_name'] = ($companyList[$promote['company_id']] ? $companyList[$promote['company_id']] : ($promote['company_id'] == 0 ? '万盟天下科技' : '未知')); if ($promote['auto_review_withdraw_status'] == 0) { $className = 'auto-closed'; $text = '关闭'; From 2c52bccaf7f06152005f3e2903ce9a5e7ced5f87 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Mon, 10 Feb 2020 16:30:46 +0800 Subject: [PATCH 38/46] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0>?= =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98>=E7=BB=93=E7=AE=97=E7=AE=A1?= =?UTF-8?q?=E7=90=86>=E6=8E=A8=E5=B9=BF=E6=8F=90=E7=8E=B0>=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=AE=A1=E6=A0=B8=E7=AE=A1=E7=90=86--=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/QueryController.class.php | 9 ++++- .../Admin/Model/WithdrawModel.class.php | 33 +++++++++++++++++-- Application/Admin/View/Query/withdraw.html | 10 ++++++ Data/update.sql | 3 ++ 4 files changed, 51 insertions(+), 4 deletions(-) diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index 63c99a420..4f558fbcf 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -1007,6 +1007,7 @@ class QueryController extends ThinkController { $page = I('p', 1); $row = I('row', 10); + $reviewTypeList = WithdrawModel::$reviewTypeList; $map['_string'] = '1=1'; $adminid = C('USER_ADMINISTRATOR');//获取超管id $adminmobile = M('UcenterMember')->field('mobile')->find($adminid); @@ -1023,6 +1024,9 @@ class QueryController extends ThinkController if (isset($_REQUEST['settlement_type'])) { $map['settlement_type'] = $_REQUEST['settlement_type']; } + if (isset($_REQUEST['review_type'])) { + $map['review_type'] = $_REQUEST['review_type']; + } if (isset($_REQUEST['promote_account'])) { if ($_REQUEST['promote_account'] == '全部') { unset($_REQUEST['promote_account']); @@ -1052,7 +1056,7 @@ class QueryController extends ThinkController } } - $fields = 'id, widthdraw_number, sum_money, promote_id, promote_account, op_id, op_type, last_op_id, last_op_type, settlement_type, settlement_begin_time, settlement_end_time, create_time, status, respond, audit_time'; + $fields = 'id, widthdraw_number, sum_money, promote_id, promote_account, op_id, op_type, last_op_id, last_op_type, settlement_type, settlement_begin_time, settlement_end_time, create_time, status, respond, audit_time, review_type'; $count = 0; if (I('export', 0) == 1) { $records = D('withdraw')->field($fields) @@ -1093,6 +1097,7 @@ class QueryController extends ThinkController 'last_op_id_text' => $this->getOpTypeText($record['last_op_type'], $record['last_op_id']), 'op_type_text' => getPromoteWithdrawOpType($record['op_type']), 'last_op_type_text' => getPromoteWithdrawOpType($record['last_op_type']), + 'review_type_text' => $reviewTypeList[$record['review_type']] ?? '未知', 'settlement_type_text' => getPromoteWithdrawSettlementType($record['settlement_type']), 'settlement_begin_time' => $record['settlement_begin_time'] ? date('Y-m-d H:i:s', $record['settlement_begin_time']) : '--', 'settlement_end_time' => date('Y-m-d H:i:s', $record['settlement_end_time']), @@ -1118,6 +1123,7 @@ class QueryController extends ThinkController 'op_type_text' => '操作人类型', 'last_op_id_text' => '最后操作人', 'last_op_type_text' => '最后操作人类型', + 'review_type_text' => '审核模式', 'settlement_type_text' => '提现模式', 'settlement_begin_time' => '结算开始时间', 'settlement_end_time' => '结算截止时间', @@ -1153,6 +1159,7 @@ class QueryController extends ThinkController setPowerPromoteIds($map); $companys = getPromoteCompanys(); $this->assign('companys', $companys); + $this->assign('reviewTypeList', $reviewTypeList); $this->assign('is_admin', is_administrator()); $this->assign('list_data', $datas); $this->display(); diff --git a/Application/Admin/Model/WithdrawModel.class.php b/Application/Admin/Model/WithdrawModel.class.php index 7db178856..75b82fb75 100644 --- a/Application/Admin/Model/WithdrawModel.class.php +++ b/Application/Admin/Model/WithdrawModel.class.php @@ -26,6 +26,10 @@ class WithdrawModel extends Model{ const SETTLEMENT_TYPE_RECOUP = 3; const SETTLEMENT_TYPE_OTHER = 9; + //审核模式 + const REVIEW_TYPE_MANUAL = 1; + const REVIEW_TYPE_AUTO = 2; + /** * 构造函数 * @param string $name 模型名称 @@ -51,6 +55,11 @@ class WithdrawModel extends Model{ self::SETTLEMENT_TYPE_RECOUP => '补点', self::SETTLEMENT_TYPE_OTHER => '其他', ]; + + public static $reviewTypeList = [ + self::REVIEW_TYPE_MANUAL => '人工审核', + self::REVIEW_TYPE_AUTO => '自动审核', + ]; /* * 开发者提现未处理列表 @@ -193,7 +202,13 @@ class WithdrawModel extends Model{ $add['promote_id'] = $promote['id']; $add['promote_account'] = $promote['account']; $add['create_time'] = $thisTime; - $add['status'] = ($promote['auto_review_withdraw_status'] == 1) ? 1 : 0; + if ($promote['auto_review_withdraw_status'] == 1) { + $add['status'] = 1; + $add['review_type'] = 2; + } else { + $add['status'] = 0; + $add['review_type'] = 1; + } $add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(1); $add['settlement_begin_time'] = $settlementBeginTime; $add['settlement_end_time'] = $settlementEndTime; @@ -329,7 +344,13 @@ class WithdrawModel extends Model{ $add['promote_id'] = $promote['id']; $add['promote_account'] = $promote['account']; $add['create_time'] = $thisTime; - $add['status'] = ($promote['auto_review_withdraw_status'] == 1) ? 1 : 0; + if ($promote['auto_review_withdraw_status'] == 1) { + $add['status'] = 1; + $add['review_type'] = 2; + } else { + $add['status'] = 0; + $add['review_type'] = 1; + } $add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(2); $add['settlement_begin_time'] = $settlementBeginTime; $add['settlement_end_time'] = $settlementEndTime; @@ -447,7 +468,13 @@ class WithdrawModel extends Model{ $add['promote_id'] = $promote['id']; $add['promote_account'] = $promote['account']; $add['create_time'] = $thisTime; - $add['status'] = ($promote['auto_review_withdraw_status'] == 1) ? 1 : 0; + if ($promote['auto_review_withdraw_status'] == 1) { + $add['status'] = 1; + $add['review_type'] = 2; + } else { + $add['status'] = 0; + $add['review_type'] = 1; + } $add['widthdraw_number'] = D('withdraw')->produceWithdrawNumber(3); $add['settlement_begin_time'] = $settlementBeginTime; $add['settlement_end_time'] = $settlementEndTime; diff --git a/Application/Admin/View/Query/withdraw.html b/Application/Admin/View/Query/withdraw.html index 2946f9515..9932b2f13 100644 --- a/Application/Admin/View/Query/withdraw.html +++ b/Application/Admin/View/Query/withdraw.html @@ -111,6 +111,14 @@ +
+ +
搜索 @@ -139,6 +147,7 @@
+ @@ -175,6 +184,7 @@ + diff --git a/Data/update.sql b/Data/update.sql index ec88bb531..36e91ea72 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -1154,3 +1154,6 @@ MODIFY COLUMN `company_belong` tinyint(1) UNSIGNED NOT NULL DEFAULT 3 COMMENT ' MODIFY COLUMN `company_relation` tinyint(1) UNSIGNED NOT NULL DEFAULT 2 COMMENT '工会关系:0-自主开发及维护;1-只维护 2 无' AFTER `company_belong`; ADD COLUMN `company_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '工会类型 1公司 2个人' AFTER `can_view_recharge`; +-- 2020-02-10 cxj 推广提现--新增审核模式 +ALTER TABLE `tab_withdraw` +ADD COLUMN `review_type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '审核模式:1-人工审核 2-自动审核'; \ No newline at end of file From ce960beb6dad4588e99db460c714238b18252867 Mon Sep 17 00:00:00 2001 From: liuweiwen <529520975@qq.com> Date: Mon, 10 Feb 2020 16:34:38 +0800 Subject: [PATCH 39/46] =?UTF-8?q?=E5=90=88=E4=BD=9C=E6=96=B9=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E6=A0=BC=E5=BC=8F=E9=AA=8C=E8=AF=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/PartnerController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/PartnerController.class.php b/Application/Admin/Controller/PartnerController.class.php index 4b3afe97b..4cbcfd3c5 100644 --- a/Application/Admin/Controller/PartnerController.class.php +++ b/Application/Admin/Controller/PartnerController.class.php @@ -100,7 +100,7 @@ class PartnerController extends ThinkController $this->error('合作方已存在'); } - if(!preg_match("/^1[358][0-9]{9}$/u",I('link_phone'))) { + if(!checkPhone(I('link_phone'))) { $this->error('联系电话格式不正确'); } $res2 = $model->where(['link_phone' => I('link_phone')])->getField('id'); @@ -173,7 +173,7 @@ class PartnerController extends ThinkController $this->error('合作方已存在'); } - if(!preg_match("/^1[358][0-9]{9}$/u",I('link_phone'))) { + if(!checkPhone(I('link_phone'))) { $this->error('联系电话格式不正确'); } $res2 = $model->where([ From 77463c7e1d0a4e10d5d006eb2afb09fbb7ff0c59 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 10 Feb 2020 16:38:34 +0800 Subject: [PATCH 40/46] =?UTF-8?q?=E5=B8=82=E5=9C=BA=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=8A=E6=B8=B8=E6=B5=81=E6=B0=B4=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index a37e87067..a5edb032a 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -2018,10 +2018,23 @@ function getWithdrawNumber() { //上有流水计算 function caculateUpstream($game_id,$pay_amount) { - $data = M('cp_game_ratio','tab_') + $ladderData = M('cp_game_ratio','tab_') ->where(['game_id'=>$game_id,'begin_total_amount'=>['elt',$pay_amount],'is_del'=>0]) - ->order('begin_total_amount Desc') - ->find(); + ->limit(0,2) + ->order('begin_total_amount desc') + ->select(); + + foreach($ladderData as $key => $value) { + + if ($value['instanceof'] == 1 && $value['begin_total_amount'] <= $pay_amount + || $value['instanceof'] == 2 && $value['begin_total_amount'] != $pay_amount ) { + $data['ratio'] = $value['ratio']; + break; + } else { + $data['ratio'] = $value['ratio']; + } + + } return number_format($pay_amount*($data['ratio']/100),2,'.',''); From 5ab9f2cc1c00e71998ab9389ed8c1f8a5e963440 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 10 Feb 2020 16:40:51 +0800 Subject: [PATCH 41/46] =?UTF-8?q?=E4=B8=8B=E6=B8=B8=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=8D=95=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/AjaxController.class.php | 14 ++- .../StatementMangementController.class.php | 99 +++++++++++++++++++ 2 files changed, 111 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/AjaxController.class.php b/Application/Admin/Controller/AjaxController.class.php index 2c6797c10..83cc1f5fd 100644 --- a/Application/Admin/Controller/AjaxController.class.php +++ b/Application/Admin/Controller/AjaxController.class.php @@ -360,11 +360,21 @@ class AjaxController extends ThinkController{ if (!in_array($v['game_name'],$gameStr)) { array_push($gameStr,$v['game_name']); } else { - $game_ratio[$v['game_name']] = $v; - unset($data['game_ratio'][$key]); +// var_dump($key); + if (!$game_ratio[$v['game_name']]) { + $game_ratio[$v['game_name']] = $v; + } + else { + $game_ratio[$v['game_name']]['sum_amount'] += $v['sum_amount']; + } + unset($value[$k]); } } + if (!$value) { + unset($data['game_ratio'][$key]); + } + } // dump($data['game_ratio']);die(); diff --git a/Application/Admin/Controller/StatementMangementController.class.php b/Application/Admin/Controller/StatementMangementController.class.php index e31bc70ea..6532fb38c 100644 --- a/Application/Admin/Controller/StatementMangementController.class.php +++ b/Application/Admin/Controller/StatementMangementController.class.php @@ -346,4 +346,103 @@ class StatementMangementController extends ThinkController return $this->success($data, '', true); } + public function PersonOrderList() { + + $map = []; + + $data = M('withdraw','tab_') + ->field("tab_withdraw.id,pc.company_name,pc.id as cid,tab_withdraw.promote_id,tab_withdraw.promote_account,username,'个人' as type,game_ratio + ,mobile_phone,real_name,tab_promote.bank_card,account_openin,tab_promote.address,bank_account") + ->join('left join tab_promote_belong on tab_withdraw.promote_id=tab_promote_belong.promote_id') + ->join("left join tab_statement as statement on tab_withdraw.widthdraw_number = statement.ext_field") + ->join("left join tab_promote on tab_promote.id=tab_promote_belong.promote_id") + ->join("left join tab_promote_company as pc on pc.id = tab_promote.company_id") + ->join("left join sys_ucenter_member on sys_ucenter_member.id=tab_promote.admin_id") + ->where("ext_field is null and tab_promote_belong.company_type=2") + ->where($map) + ->select(); + + $gameStr = []; + $game_ratio = []; + foreach($data as $dkey => &$dval) { + + $dval['game_ratio'] = json_decode($dval['game_ratio'],true); + + if (is_array($dval['game_ratio'])) { + foreach ($dval['game_ratio'] as $key => &$value) { + + foreach ($value as $k => &$v) { + +// $v['game_id'] = $key; + + $v['game_name'] = substr(get_gamename($key),0,strpos(get_gamename($key), '(')); + + if (!in_array($v['game_name'],$gameStr)) { + array_push($gameStr,$v['game_name']); + + } else { +// var_dump($key); + if (!$game_ratio[$v['game_name']]) { + $game_ratio[$v['game_name']] = $v; + } + else { + $game_ratio[$v['game_name']]['sum_amount'] += $v['sum_amount']; + } + unset($value[$k]); + } +// + } + if (!$value) { + unset($dval['game_ratio'][$key]); + } + + } + + + foreach ($dval['game_ratio'] as $key => $val) { + + $startTime = strtotime($val[0]['begin_time']); + $endTime = strtotime($val[0]['end_time']); + + $rewardData = M('reward_record','tab_') + ->field("sum(tab_reward_record.money) as money,reward_type,relation_game_name") + ->join("left join (select * from tab_game group by relation_game_id)tab_game on tab_reward_record.relation_game_id=tab_game.relation_game_id") + ->where(['company_type'=>2,'relation_game_name'=>['like',"%{$val[0]['game_name']}%"],'reward_time'=>['between',[$startTime,$endTime]]]) + ->group('reward_type') + ->select(); + + foreach ($rewardData as $rk => $rv) { + + if ($rv['reward_type'] == 1) { + $val[0]['reward'] = $rv['money']; + } else { + $val[0]['forfeit'] = $rv['money']; + } + + } + + + foreach ($val as $k => &$v) { + + if ($game_ratio[$v['game_name']]) { + + $v['sum_amount'] = number_format($v['sum_amount'] + $game_ratio[$v['game_name']]['sum_amount'],2,'.',''); + + } + } + unset($dval['game_ratio'][$key]); + array_push($dval['game_ratio'],$val[0]); + + } + + } + } + + + dump($data); + + $this->display(); + + } + } From dfd198e9b73bd55a18dc1f8a8194313c0503b4e0 Mon Sep 17 00:00:00 2001 From: liuweiwen <529520975@qq.com> Date: Mon, 10 Feb 2020 18:11:08 +0800 Subject: [PATCH 42/46] =?UTF-8?q?=E5=AF=B9=E8=B4=A6=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A5=96=E7=BD=9A=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 4 ++-- Application/Admin/Controller/PublicController.class.php | 2 +- Application/Admin/View/VerifyBill/company_show.html | 2 +- Application/Admin/View/VerifyBill/partner_show.html | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index a5edb032a..8ebfc1ae6 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -1865,7 +1865,7 @@ function excelUpStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_all_ foreach ($data['statement_info'] as $key => $value) { $objPHPExcel->getActiveSheet()->insertNewRowBefore($line,1)->mergeCells("J$line:K$line"); $objPHPExcel->getActiveSheet()->setCellValue('C'.$line, $value['statement_begin_time'] . '-' . $value['statement_end_time']); - if ($value['statement_type'] == 1) {//罚款 + if ($value['statement_type'] > 0) {//罚款 $product_name = $value['type_name']; $objPHPExcel->getActiveSheet()->setCellValue('F'.$line , '-'); $objPHPExcel->getActiveSheet()->setCellValue('G'.$line, '-'); @@ -1950,7 +1950,7 @@ function excelDownStreamTemplate($data, $all_sum_money, $all_pay_amount, $big_al $objPHPExcel->getActiveSheet()->removeConditionalStyles(); $objPHPExcel->getActiveSheet()->setCellValue('A'.$line, $value['statement_begin_time'] . '-' . $value['statement_end_time']); - if ($value['statement_type'] == 1) {//罚款 + if ($value['statement_type']>0) {//罚款 $product_name = $value['type_name']; $objPHPExcel->getActiveSheet()->setCellValue('D'.$line, '-'); $objPHPExcel->getActiveSheet()->setCellValue('E'.$line, '-'); diff --git a/Application/Admin/Controller/PublicController.class.php b/Application/Admin/Controller/PublicController.class.php index 7daf4f29a..7b210c0f2 100644 --- a/Application/Admin/Controller/PublicController.class.php +++ b/Application/Admin/Controller/PublicController.class.php @@ -346,7 +346,7 @@ class PublicController extends \Think\Controller public function telsafecode($phone = '', $delay = 10, $flag = true) { $taskClient = new TaskClient(); - $result = $taskClient->sendSmsCode($phone, get_client_ip()); + $result = $taskClient->sendSms($phone, get_client_ip()); $data = []; if ($result['code'] == TaskClient::SUCCESS) { $data['status'] = 1; diff --git a/Application/Admin/View/VerifyBill/company_show.html b/Application/Admin/View/VerifyBill/company_show.html index 995ba6c54..cafdcf067 100644 --- a/Application/Admin/View/VerifyBill/company_show.html +++ b/Application/Admin/View/VerifyBill/company_show.html @@ -104,7 +104,7 @@ - + diff --git a/Application/Admin/View/VerifyBill/partner_show.html b/Application/Admin/View/VerifyBill/partner_show.html index 688ac0c83..c19d3007c 100644 --- a/Application/Admin/View/VerifyBill/partner_show.html +++ b/Application/Admin/View/VerifyBill/partner_show.html @@ -101,7 +101,7 @@ - + @@ -113,6 +113,7 @@ + From 2cd5574de7488813b72a8079a71e34b1c434d936 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Tue, 11 Feb 2020 10:28:41 +0800 Subject: [PATCH 43/46] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/PromoteController.class.php | 1 + Application/Admin/View/Promote/belong.html | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index a0b36d08a..6aada89f3 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -1352,6 +1352,7 @@ class PromoteController extends ThinkController 'verify_status' => $verify_status, 'approver_id' => getAdmin(), 'approver_name' => getAdmin('username'), + 'verify_time' => time() ]); if (!is_null($res) ) { if ($verify_status == 1) {//审核通过才修改推广员的归属关系 diff --git a/Application/Admin/View/Promote/belong.html b/Application/Admin/View/Promote/belong.html index 9678510a2..7a0db395f 100644 --- a/Application/Admin/View/Promote/belong.html +++ b/Application/Admin/View/Promote/belong.html @@ -133,6 +133,7 @@ + @@ -243,6 +244,7 @@ + From b4d35af3cba4ab7c6406b89a307222ceaa9ed8bd Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Tue, 11 Feb 2020 14:03:30 +0800 Subject: [PATCH 46/46] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Base/Service/ApplyService.class.php | 6 +++++- Application/Home/Controller/ApplyController.class.php | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Application/Base/Service/ApplyService.class.php b/Application/Base/Service/ApplyService.class.php index 78ec3a71e..fc5fb7926 100644 --- a/Application/Base/Service/ApplyService.class.php +++ b/Application/Base/Service/ApplyService.class.php @@ -217,6 +217,10 @@ class ApplyService { { $promoteService = new PromoteService(); $topPromote = $promoteService->getTopPromote($promote); - return M('sociaty_games', 'tab_')->where(['game_id' => $game['id'], 'promote_id' => $topPromote['id']])->getField('game_id', true); + $tempIds = M('sociaty_games', 'tab_')->where(['promote_id' => $topPromote['id']])->getField('game_id', true); + $tempIds = $tempIds ?? []; + $ids = M('game', 'tab_')->where(['apply_auth' => 1])->getField('id', true); + $ids = $ids ?? []; + return array_merge($tempIds, $ids); } } \ No newline at end of file diff --git a/Application/Home/Controller/ApplyController.class.php b/Application/Home/Controller/ApplyController.class.php index 6044d0f97..a50f68bb1 100644 --- a/Application/Home/Controller/ApplyController.class.php +++ b/Application/Home/Controller/ApplyController.class.php @@ -92,6 +92,10 @@ class ApplyController extends BaseController $map['tab_game.sdk_version'] = $type; + $applyService = new ApplyService(); + $tempIds = $applyService->getSociatyGameIds($loginPromote); + $gameIdList = array_intersect($gameIdList, $tempIds); + if (count($gameIdList) > 0) { $gameIds = implode(',', $gameIdList); @@ -115,6 +119,10 @@ class ApplyController extends BaseController } else { $gameIdList = M('Game', 'tab_')->group('relation_game_id')->having('count(id) = 2')->getField('id', true); + $applyService = new ApplyService(); + $tempIds = $applyService->getSociatyGameIds($loginPromote); + $gameIdList = array_intersect($gameIdList, $tempIds); + if (count($gameIdList) > 0) { $gameIds = implode(',', $gameIdList); $map['tab_game.id'] = ['in', $gameIds];
乙方:
操作人类型 最后操作人 最后操作人类型审核模式 提现模式 结算开始时间 结算截止时间{$data.op_type_text} {$data.last_op_id_text} {$data.last_op_type_text}{$data.review_type_text} {$data.settlement_type_text} {$data.settlement_begin_time} {$data.settlement_end_time}
-
-- {$item.sum_money}元
工会类型 充值信息权限 申请时间审核时间 备注 审核 申请人 {:set_show_time($data['applicant_time'])}{:set_show_time($data['verify_time'])} {$data['remark']} From c57f67a43b5121ef17471b9e4eb46cbb38fff8c7 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Tue, 11 Feb 2020 13:08:51 +0800 Subject: [PATCH 44/46] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0>?= =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E7=AE=A1=E7=90=86>=E6=8F=90=E7=8E=B0?= =?UTF-8?q?=E8=AE=B0=E5=BD=95--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/View/default/Finance/withdrawRecord.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Home/View/default/Finance/withdrawRecord.html b/Application/Home/View/default/Finance/withdrawRecord.html index b033492d5..75bd0c642 100644 --- a/Application/Home/View/default/Finance/withdrawRecord.html +++ b/Application/Home/View/default/Finance/withdrawRecord.html @@ -197,7 +197,7 @@ 提现明细 - 汇款证明 + From e9581a2e040e0f1751d1e2f2426dacad4252f736 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Tue, 11 Feb 2020 13:17:42 +0800 Subject: [PATCH 45/46] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0>?= =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98>=E7=BB=93=E7=AE=97=E7=AE=A1?= =?UTF-8?q?=E7=90=86>=E6=8E=A8=E5=B9=BF=E6=8F=90=E7=8E=B0--=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/QueryController.class.php | 6 +++--- Application/Admin/View/Query/withdraw.html | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index 4f558fbcf..259fccaa8 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -1224,10 +1224,10 @@ class QueryController extends ThinkController $save['audit_time'] = time(); $save['status'] = $status; $res = $withdraw->where($map)->save($save); - if ($res === false) { - $this->error('操作失败'); - } else { + if ($res) { $this->success('操作成功', U('withdraw')); + } else { + $this->error('操作失败'); } } diff --git a/Application/Admin/View/Query/withdraw.html b/Application/Admin/View/Query/withdraw.html index 9932b2f13..67937146e 100644 --- a/Application/Admin/View/Query/withdraw.html +++ b/Application/Admin/View/Query/withdraw.html @@ -170,11 +170,11 @@
- + - + - + {$data.widthdraw_number} {$data.sum_money}