From 0af6a53ba7edb6ea5e8d835f4ffff7b9543906d4 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Tue, 21 Apr 2020 15:53:45 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E5=90=8E=E5=8F=B0arpu=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ConsoleController.class.php | 1 - .../Admin/Controller/StatController.class.php | 130 ++++++ Application/Admin/View/Stat/userarpu.html | 108 ++--- Application/Admin/View/Stat/userarpu_old.html | 407 ++++++++++++++++++ 4 files changed, 577 insertions(+), 69 deletions(-) create mode 100644 Application/Admin/View/Stat/userarpu_old.html diff --git a/Application/Admin/Controller/ConsoleController.class.php b/Application/Admin/Controller/ConsoleController.class.php index 7fd9fc095..fc7bef092 100644 --- a/Application/Admin/Controller/ConsoleController.class.php +++ b/Application/Admin/Controller/ConsoleController.class.php @@ -434,7 +434,6 @@ class ConsoleController extends Think { $start = I('start', date('Y-m-d')); $end = I('end', date('Y-m-d')); $gameIds = I('game_ids', ''); - $startTime = strtotime($start . ' 00:00:00'); $endTime = strtotime($end . ' 23:59:59'); $gameIdRows = explode(',', $gameIds); diff --git a/Application/Admin/Controller/StatController.class.php b/Application/Admin/Controller/StatController.class.php index 12b37a10a..3543c2d9b 100644 --- a/Application/Admin/Controller/StatController.class.php +++ b/Application/Admin/Controller/StatController.class.php @@ -672,6 +672,136 @@ AND UNIX_TIMESTAMP( } public function userarpu($p=0) + { + $start = I('start', date('Y-m-d')); + $end = I('end', date('Y-m-d')); + $gameIds = I('game_ids', ''); + $promoteId = I('promote_id', 0); + $dataOrder = I('data_order', ''); + $containBindCoins = I('contain_bind_coins', 0); + + $orderType = ''; + $order = 0; + if ($dataOrder != '') { + $dataOrderRow = explode(',', $dataOrder); + $order = $dataOrderRow[0]; + $orderType = $dataOrderRow[1]; + } + + $promoteIds = []; + if ($promoteId > 0) { + $promote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $promoteId])->find(); + $promoteIds = M('promote', 'tab_')->where(['chain' => ['like', $promote['chain'] . $promote['id'] . '/%']])->getField('id', true); + $promoteIds[] = $promote['id']; + } + + $startTime = strtotime($start . ' 00:00:00'); + $endTime = strtotime($end . ' 23:59:59'); + $gameIdRows = $gameIds ? explode(',', $gameIds) : []; + + $conditions = []; + if (count($gameIdRows)) { + $conditions['game_id'] = ['in', $gameIdRows]; + } + if (count($promoteIds)) { + $conditions['promote_id'] = ['in', $promoteIds]; + } + // 新增用户 + + /* M('user', 'tab_') + ->field('count(*) count, FROM_UNIXTIME(register_time, "%Y-%m-%d") date') + ->where([ + 'game_id' => ['in', $gameIdRows], + 'register_time' => ['between', [$startTime, $endTime]] + ]) + ->group('date') + ->select(); */ + + $newUsers = M('user_play', 'tab_') + ->field('count(DISTINCT user_id) count, FROM_UNIXTIME(create_time, "%Y-%m-%d") date') + ->where(array_merge($conditions, ['create_time' => ['between', [$startTime, $endTime]]])) + ->group('date') + ->select(); + $newUsers = index_by_column('date', $newUsers); + + // 活跃用户 + $loginUsers = M('login_daily_record', 'tab_') + ->field('count(DISTINCT user_id) count, FROM_UNIXTIME(create_time, "%Y-%m-%d") date') + ->where(array_merge($conditions, ['create_time' => ['between', [$startTime, $endTime]]])) + ->group('date') + ->select(); + $loginUsers = index_by_column('date', $loginUsers); + + $spendConditions = array_merge($conditions, [ + 'pay_time' => ['between', [$startTime, $endTime]], + 'pay_status' => 1, + ]); + if ($containBindCoins == 0) { + $spendConditions['pay_way'] = ['gt', -1]; + } + + // 付费玩家,付费金额 + $payLogs = M('spend', 'tab_') + ->field('count(DISTINCT user_id) count, sum(pay_amount) amount, FROM_UNIXTIME(pay_time, "%Y-%m-%d") date') + ->where($spendConditions) + ->group('date') + ->select(); + $payLogs = index_by_column('date', $payLogs); + + $rows = []; + for ($time = $startTime; $time < $endTime; $time = $time + 24*3600) { + $date = date('Y-m-d', $time); + $newUser = isset($newUsers[$date]) ? $newUsers[$date]['count'] : 0; + $loginUser = isset($loginUsers[$date]) ? $loginUsers[$date]['count'] : 0; + $payAmount = isset($payLogs[$date]) ? $payLogs[$date]['amount'] : 0; + $payUser = isset($payLogs[$date]) ? $payLogs[$date]['count'] : 0; + $rows[] = [ + 'date' => $date, + 'new_user' => $newUser, + 'login_user' => $loginUser, + 'pay_amount' => $payAmount, + 'pay_user' => $payUser, + 'pay_rate' => $loginUser > 0 ? (round($payUser / $loginUser * 100, 2)) : '0', + 'arpu' => $loginUser > 0 ? (round($payAmount / $loginUser, 2)) : '0.00', + 'arppu' => $payUser > 0 ? (round($payAmount / $payUser, 2)) : '0.00', + ]; + } + + if (I('export', 0) == 1) { + $fields = [ + 'date' => '日期', + 'new_user' => '新增玩家', + 'login_user' => '活跃玩家', + 'pay_account' => '充值金额', + 'pay_user' => '付费玩家', + 'pay_rate' => '付费率', + 'arpu' => 'ARPU', + 'arppu' => 'ARPPU', + ]; + foreach ($rows as &$item) { + $item['pay_rate'] = $item['pay_rate'] . '%'; + } + + addOperationLog(['op_type'=>3,'key'=>getNowDate(),'op_name'=>'ARPU分析','url'=>U('Stat/userarpu'),'menu'=>'统计-数据分析-ARPU分析']); + + data2csv($rows, '数据分析_ARPU分析', $fields); + exit; + } + + if ($dataOrder) { + $sort = $order == 3 ? SORT_DESC : SORT_ASC; + $orderColumn = array_column($rows, $orderType); + array_multisort($orderColumn, $sort, SORT_REGULAR, $rows); + } + + $this->meta_title = 'ARPU统计'; + $this->assign('records', $rows); + $this->assign('order', $order); + $this->assign('orderType', $orderType); + $this->display(); + } + + public function userarpu_old($p=0) { $request=$_REQUEST; $page = intval($p); diff --git a/Application/Admin/View/Stat/userarpu.html b/Application/Admin/View/Stat/userarpu.html index de5c56d00..45e9da560 100644 --- a/Application/Admin/View/Stat/userarpu.html +++ b/Application/Admin/View/Stat/userarpu.html @@ -48,18 +48,18 @@ 活跃玩家 当天登录的玩家总数 -
  • +
  • 付费玩家 当天付费的玩家数量
  • -
  • +
  • 付费率 付费玩家/活跃玩家 @@ -83,12 +83,12 @@
    参与统计设置: - +
    @@ -103,7 +103,7 @@
    - @@ -132,63 +132,35 @@ - 日期▲日期▼日期 - - 游戏名称 - - - 渠道名称 - + 日期▲日期▼日期 - 新增玩家▲新增玩家▼新增玩家 - - 活跃玩家▲活跃玩家▼活跃玩家 + 新增玩家▲新增玩家▼新增玩家 - 1日留存▲1日留存▼1日留存 + 活跃玩家▲活跃玩家▼活跃玩家 - 充值▲充值▼充值 + 充值金额▲充值金额▼充值金额 - 付费玩家▲付费玩家▼付费玩家 + 付费玩家▲付费玩家▼付费玩家 - 新付费玩家▲新付费玩家▼新付费玩家 + 付费率▲付费率▼付费率 - 付费率▲付费率▼付费率 - - ARPU▲ARPU▼ARPU + ARPU▲ARPU▼ARPU - ARPPU▲ARPPU▼ARPPU - - 累计付费玩家▲累计付费玩家▼累计付费玩家 - - - 详情 - + ARPPU▲ARPPU▼ARPPU - + - {$vo.time} - - {$game_name} - - - {$promote_name} - - {$vo.register_num} - {$vo.act_user} - {$vo.keep_num}% - {$vo.spend} - {$vo.spend_people} - {$vo.new_pop} - {$vo.spend_rate}% - {$vo.ARPU} - {$vo.ARPPU} - {$vo.pop_num} - - 查看 - + {$vo.date} + {$vo.new_user} + {$vo.login_user} + {$vo.pay_amount} + {$vo.pay_user} + {$vo.pay_rate}% + {$vo.arpu} + {$vo.arppu} @@ -196,13 +168,13 @@
    - 导出 + 导出 {$_page|default=''}
    @@ -210,11 +182,11 @@ @@ -249,8 +221,8 @@ $(function(){ if(interval < 0 || start == ''){ layer.msg('请选择搜索时间'); return false; - }else if(interval>90){ - layer.msg('请选择90日内的时间段'); + }else if(interval>31){ + layer.msg('请选择31日内的时间段'); return false; } @@ -283,8 +255,8 @@ $(function(){ $(".paixu").click(function(){ var that=$(this); $data_order=that.attr('data-order'); - $order_type='{$userarpu_order}'; - if($order_type==''||$order_type=='4'){ + $order_type='{$order}'; + if($order_type==0||$order_type=='4'){ $(".sortBy").attr('name','data_order'); val='3,'+$data_order; $(".sortBy").attr('value',val); diff --git a/Application/Admin/View/Stat/userarpu_old.html b/Application/Admin/View/Stat/userarpu_old.html new file mode 100644 index 000000000..de5c56d00 --- /dev/null +++ b/Application/Admin/View/Stat/userarpu_old.html @@ -0,0 +1,407 @@ + + + + + + + + + + + + + +
    +
    +
    + 参与统计设置: + + +
    +
    + +
    +
    + +
    +
    + +  -  + +
    +
    + +
    +
    + +
    + +
    + 搜索 +
    +
    +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    日期▲日期▼日期游戏名称渠道名称新增玩家▲新增玩家▼新增玩家活跃玩家▲活跃玩家▼活跃玩家1日留存▲1日留存▼1日留存充值▲充值▼充值付费玩家▲付费玩家▼付费玩家新付费玩家▲新付费玩家▼新付费玩家付费率▲付费率▼付费率ARPU▲ARPU▼ARPUARPPU▲ARPPU▼ARPPU累计付费玩家▲累计付费玩家▼累计付费玩家详情
    {$vo.time}{$game_name}{$promote_name}{$vo.register_num}{$vo.act_user}{$vo.keep_num}%{$vo.spend}{$vo.spend_people}{$vo.new_pop}{$vo.spend_rate}%{$vo.ARPU}{$vo.ARPPU}{$vo.pop_num}查看
    +
    +
    +
    + 导出 + {$_page|default=''} +
    +
    + + + + +if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + + From a29365fed8decf4315cc847f049195967ad1bee0 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Wed, 6 May 2020 15:13:09 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E7=99=BB=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/IndexController.class.php | 63 +++++ .../Home/Controller/SafeController.class.php | 68 +++++ .../Home/View/default/Index/index.html | 1 + .../Home/View/default/Index/phoneLogin.html | 267 ++++++++++++++++++ .../Home/View/default/Safe/bindTel.html | 265 +++++++++++++++++ 5 files changed, 664 insertions(+) create mode 100644 Application/Home/View/default/Index/phoneLogin.html create mode 100644 Application/Home/View/default/Safe/bindTel.html diff --git a/Application/Home/Controller/IndexController.class.php b/Application/Home/Controller/IndexController.class.php index c91fac847..ad19c8d97 100644 --- a/Application/Home/Controller/IndexController.class.php +++ b/Application/Home/Controller/IndexController.class.php @@ -14,6 +14,7 @@ use OT\DataDictionary; use User\Api\PromoteApi; use Home\Controller\DownController; +use Base\Tool\TaskClient; /** * 前台首页控制器 @@ -74,6 +75,12 @@ class IndexController extends HomeController $map['account'] = $account; $data['last_login_time'] = time(); M("promote", "tab_")->where($map)->save($data); + $loginrecord['promote_id'] = get_pid(); + $loginrecord['account'] = $_POST['account']; + $loginrecord['client_ip'] = $_SERVER['REMOTE_ADDR']; + $loginrecord['login_type'] = 1; + $loginrecord['create_time'] = time(); + M("promote_login_record", "tab_")->add($loginrecord); $this->ajaxReturn(array("status" => 1, "msg" => "登录成功", 'url' => U('Promote/index'))); } else { $msg = ""; @@ -99,6 +106,25 @@ class IndexController extends HomeController } } + public function doPhoneLogin($mobile = null, $verify = null) { + if (!$this->checksafecode($mobile, $verify)) { + $this->error('验证码错误'); + } + $promote = M('promote', 'tab_')->where([ + 'login_phone' => $mobile, + ])->find(); + if($promote) { + $loginrecord['promote_id'] = get_pid(); + $loginrecord['account'] = $_POST['account']; + $loginrecord['client_ip'] = $_SERVER['REMOTE_ADDR']; + $loginrecord['login_type'] = 1; + $loginrecord['create_time'] = time(); + M("promote_login_record", "tab_")->add($loginrecord); + setcookie('login_phone', $mobile, time() + 3600 * 10000, $_SERVER["HTTP_HOST"]); + $this->success('登录成功!', U('Promote/index')); + } + } + /* public function register() { if (IS_POST) { @@ -291,4 +317,41 @@ class IndexController extends HomeController $Promote->logout(); redirect(U('Index/index')); } + + public function phoneLogin() { + $this->display(); + } + + /** + * 发动手机验证码 + */ + public function telsafecode($phone = '', $delay = 10, $flag = true) + { + $taskClient = new TaskClient(); + $result = $taskClient->sendSmsCode($phone, get_client_ip()); + $data = []; + if ($result['code'] == TaskClient::SUCCESS) { + $data['status'] = 1; + } else { + $data['status'] = 0; + } + $data['msg'] = $result['message']; + echo json_encode($data); + exit; + } + + /** + * 手机安全码验证 + */ + public function checksafecode($phone, $code) + { + $taskClient = new TaskClient(); + $result = $taskClient->checkSms($phone, $code); + $data = []; + if ($result && $result['code'] == TaskClient::SUCCESS) { + return true; + } else { + return false; + } + } } diff --git a/Application/Home/Controller/SafeController.class.php b/Application/Home/Controller/SafeController.class.php index 5e9d5bede..ba6a98334 100644 --- a/Application/Home/Controller/SafeController.class.php +++ b/Application/Home/Controller/SafeController.class.php @@ -9,6 +9,7 @@ namespace Home\Controller; use Think\Controller; use Base\Repository\PromoteRepository; +use Base\Tool\TaskClient; /** * 扩展控制器 @@ -559,4 +560,71 @@ class SafeController extends BaseController{ $this->ajaxReturn(['code'=>0000,'mes'=>'删除成功']); } } + + public function bindTel() { + $id = get_pid(); + $promote = M('promote', 'tab_')->where(['id' => $id])->find(); + if(!empty($promote['login_phone'])) { + $this->assign('login_phone', $promote['login_phone']); + } + return $this->display(); + } + + /** + * 发动手机验证码 + */ + public function telsafecode($phone = '', $delay = 10, $flag = true) + { + $taskClient = new TaskClient(); + $result = $taskClient->sendSmsCode($phone, get_client_ip()); + $data = []; + if ($result['code'] == TaskClient::SUCCESS) { + $data['status'] = 1; + } else { + $data['status'] = 0; + } + $data['msg'] = $result['message']; + echo json_encode($data); + exit; + } + + /** + * 手机安全码验证 + */ + public function checksafecode($phone, $code) + { + $taskClient = new TaskClient(); + $result = $taskClient->checkSms($phone, $code); + $data = []; + if ($result && $result['code'] == TaskClient::SUCCESS) { + return true; + } else { + return false; + } + } + + public function addLoginMobile($mobile = null, $verify = null) { + if (IS_POST) { + /* 检测验证码 TODO: */ + + if (!$this->checksafecode($mobile, $verify)) { + $this->error('验证码错误'); + } + $id = get_pid(); + $promote = M('promote', 'tab_')->where([ + 'id' => $id + ])->find(); + if ($promote) { + $promote['login_phone'] = $mobile; + $updateRs = M('promote', 'tab_')->where(['id' => $id])->save($promote); + if($updateRs) { + $this->success("更新登陆手机号成功"); + }else { + $this->error("更新登陆手机号失败"); + } + }else { + $this->error("无此推广账号信息"); + } + } + } } \ No newline at end of file diff --git a/Application/Home/View/default/Index/index.html b/Application/Home/View/default/Index/index.html index 578362aeb..822ac37eb 100644 --- a/Application/Home/View/default/Index/index.html +++ b/Application/Home/View/default/Index/index.html @@ -38,6 +38,7 @@
    +
    diff --git a/Application/Home/View/default/Index/phoneLogin.html b/Application/Home/View/default/Index/phoneLogin.html new file mode 100644 index 000000000..dcaec1ca9 --- /dev/null +++ b/Application/Home/View/default/Index/phoneLogin.html @@ -0,0 +1,267 @@ + + + + + + + +
    +
    + + + +
    +
    +
    +
    + +
    + + + +
    + +
    + +
    +
    + + + + + + \ No newline at end of file diff --git a/Application/Home/View/default/Safe/bindTel.html b/Application/Home/View/default/Safe/bindTel.html new file mode 100644 index 000000000..dbaa93c66 --- /dev/null +++ b/Application/Home/View/default/Safe/bindTel.html @@ -0,0 +1,265 @@ + + + + + + + + +
    +
    + + 手机号绑定 +
    +
    +
    + +
    + + + + + + + + + + + + + + +
    *手机号码 + + + + + + +
    *短信验证码 + + +
    + + +
    +
    + + + +
    +
    +
    + + + + + +
    + + + + + + + + \ No newline at end of file From 86944126094713192112a807c82b71d3c14bada6 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Wed, 6 May 2020 15:39:22 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E7=99=BB=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/IndexController.class.php | 4 +++- Application/Home/Controller/SafeController.class.php | 5 +++-- Application/Home/View/default/Index/phoneLogin.html | 2 +- Application/Home/View/default/Safe/bindTel.html | 5 ++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Application/Home/Controller/IndexController.class.php b/Application/Home/Controller/IndexController.class.php index ad19c8d97..adf2ac5e8 100644 --- a/Application/Home/Controller/IndexController.class.php +++ b/Application/Home/Controller/IndexController.class.php @@ -106,7 +106,9 @@ class IndexController extends HomeController } } - public function doPhoneLogin($mobile = null, $verify = null) { + public function doPhoneLogin() { + $mobile = $_POST['login_phone']; + $verify = $_POST['code']; if (!$this->checksafecode($mobile, $verify)) { $this->error('验证码错误'); } diff --git a/Application/Home/Controller/SafeController.class.php b/Application/Home/Controller/SafeController.class.php index ba6a98334..a37ae670b 100644 --- a/Application/Home/Controller/SafeController.class.php +++ b/Application/Home/Controller/SafeController.class.php @@ -603,10 +603,11 @@ class SafeController extends BaseController{ } } - public function addLoginMobile($mobile = null, $verify = null) { + public function addLoginMobile() { if (IS_POST) { /* 检测验证码 TODO: */ - + $mobile = $_POST['login_phone']; + $verify = $_POST['code']; if (!$this->checksafecode($mobile, $verify)) { $this->error('验证码错误'); } diff --git a/Application/Home/View/default/Index/phoneLogin.html b/Application/Home/View/default/Index/phoneLogin.html index dcaec1ca9..dca59442c 100644 --- a/Application/Home/View/default/Index/phoneLogin.html +++ b/Application/Home/View/default/Index/phoneLogin.html @@ -25,7 +25,7 @@
    -
    +
    diff --git a/Application/Home/View/default/Safe/bindTel.html b/Application/Home/View/default/Safe/bindTel.html index dbaa93c66..9a6b69d63 100644 --- a/Application/Home/View/default/Safe/bindTel.html +++ b/Application/Home/View/default/Safe/bindTel.html @@ -57,9 +57,9 @@ *短信验证码 - + - + @@ -216,7 +216,6 @@ + + + + + + + + +
    +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + +
    *推广公司: + + {$company.company_name} + + + +
    *会长: + + {$promote.account} + + + +
    开始时间: + +
    结束时间: + +
    +
    + +
    + + + 返回 + +
    +
    +
    +
    + + + + + + + + if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + \ No newline at end of file diff --git a/Application/Admin/View/PromoteLimitRule/records.html b/Application/Admin/View/PromoteLimitRule/records.html new file mode 100644 index 000000000..096c11029 --- /dev/null +++ b/Application/Admin/View/PromoteLimitRule/records.html @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + 搜索 + 添加 +
    + +
    +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + 推广公司会长账号内外团限制时间操作
    aOh! 暂时还没有内容!
    + + {$data.company_name}{$data.promote_account}{$data.company_belong}{$data.limit_rule} +
    + 编辑 + 删除 +
    +
    +
    +
    +
    + + + + {$_page|default=''} +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index a048db92d..a1645f115 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -1125,4 +1125,28 @@ class PromoteService { return $selfGameIds; } } + + public function checkPromoteLimitRule($promote) + { + $topPromote = $this->getTopPromote($promote); + $rule = M('promote_limit_rules', 'tab_')->where(['promote_id' => $topPromote['id']])->order('created_at desc')->limit(1)->find(); + if ($rule) { + if ($rule['started_at'] === null && $rule['ended_at'] === null) { + return false; + } elseif ($rule['started_at'] === null && $rule['ended_at'] !== null) { + if (time() < strtotime($rule['ended_at'] . ' 23:59:59')) { + return false; + } + } elseif ($rule['started_at'] !== null && $rule['ended_at'] === null) { + if (time() >= strtotime($rule['started_at'] . ' 00:00:00')) { + return false; + } + } else { + if (time() >= strtotime($rule['started_at'] . ' 00:00:00') && time() < strtotime($rule['ended_at'] . ' 23:59:59')) { + return false; + } + } + } + return true; + } } \ No newline at end of file diff --git a/Application/Home/Controller/HomeController.class.php b/Application/Home/Controller/HomeController.class.php index 345c8268a..c1c57599f 100644 --- a/Application/Home/Controller/HomeController.class.php +++ b/Application/Home/Controller/HomeController.class.php @@ -5,6 +5,7 @@ use Think\Controller; use User\Api\MemberApi; use Base\Facade\Request; use Base\Service\ApplyService; +use Base\Service\PromoteService; use Base\Service\PackageDownloadLogService; use Base\Tool\MobileDetect; @@ -170,6 +171,16 @@ class HomeController extends Controller $promoteId = $data['promote_id']; } + $promote = M('promote', 'tab_')->field(['id', 'parent_id', 'chain', 'level'])->where(['id' => $promoteId])->find(); + if (!$promote) { + $this->error('该链接已失效'); + } + + $promoteService = new PromoteService(); + if (!$promoteService->checkPromoteLimitRule($promote)) { + $this->error('链接已失效'); + } + $isWechat = Request::isWechat(); $isIOS = Request::isIOS() || Request::isIPadOS(); $isAndroid = Request::isAndroid(); @@ -208,8 +219,6 @@ 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 ($game['sdk_version'] == 1 && $isIOS) { $map = []; $map['relation_game_id'] = $game['relation_game_id']; diff --git a/Application/Home/Controller/PackageController.class.php b/Application/Home/Controller/PackageController.class.php index 41e70efce..6f664020d 100644 --- a/Application/Home/Controller/PackageController.class.php +++ b/Application/Home/Controller/PackageController.class.php @@ -54,6 +54,16 @@ class PackageController extends Controller $promoteId = $data['promote_id']; } + $promote = M('promote', 'tab_')->field(['id', 'parent_id', 'chain', 'level'])->where(['id' => $promoteId])->find(); + if (!$promote) { + $this->error('该链接已失效'); + } + + $promoteService = new PromoteService(); + if (!$promoteService->checkPromoteLimitRule($promote)) { + $this->error('链接已失效'); + } + $map = []; $map['status'] = 1; $map['enable_status'] = 1; @@ -65,7 +75,6 @@ class PackageController extends Controller $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', 'apply_auth'])->where(['id' => $apply['game_id']])->find(); if (Request::isMobile() || Request::isTablet()) { From dc85bdb631b6fe413e3db9796b7ace968425a0e7 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Mon, 15 Jun 2020 11:49:06 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8E=A8=E5=B9=BF=E9=99=90=E5=88=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteLimitRuleController.class.php | 27 ++++++++++++++++++- .../Admin/View/PromoteLimitRule/records.html | 22 +++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/PromoteLimitRuleController.class.php b/Application/Admin/Controller/PromoteLimitRuleController.class.php index 2dcddbcc8..2a6785708 100644 --- a/Application/Admin/Controller/PromoteLimitRuleController.class.php +++ b/Application/Admin/Controller/PromoteLimitRuleController.class.php @@ -168,7 +168,7 @@ class PromoteLimitRuleController extends ThinkController 'op_type' => 2, 'key' => $id, 'op_name' => '删除会长推广限制', - 'url' => U('PresidentDeposit/records', ['id' => $id]), + 'url' => U('PresidentDeposit/delete', ['id' => $id]), 'menu' => '推广员-推广员管理-推广限制-删除推广限制' ]); @@ -178,6 +178,31 @@ class PromoteLimitRuleController extends ThinkController ]); } + public function batchDelete() + { + $ids = I('ids', []); + if (count($ids) == 0) { + $this->ajaxReturn([ + 'status' => 0, + 'message' => '无选中项' + ]); + } + M('promote_limit_rules', 'tab_')->where(['id' => ['in', $ids]])->delete(); + + addOperationLog([ + 'op_type' => 2, + 'key' => implode(',', $ids), + 'op_name' => '批量删除会长推广限制', + 'url' => U('PresidentDeposit/batchDelete', ['ids' => implode(',', $ids)]), + 'menu' => '推广员-推广员管理-推广限制-批量删除推广限制' + ]); + + $this->ajaxReturn([ + 'status' => 1, + 'message' => '删除成功' + ]); + } + public function getPromotesByCompany() { $companyId = I('company_id', 0); diff --git a/Application/Admin/View/PromoteLimitRule/records.html b/Application/Admin/View/PromoteLimitRule/records.html index 096c11029..80a197769 100644 --- a/Application/Admin/View/PromoteLimitRule/records.html +++ b/Application/Admin/View/PromoteLimitRule/records.html @@ -75,6 +75,7 @@ - 安全密码: + 新安全密码: + + + *短信验证码 + + + + + + @@ -207,5 +216,53 @@ _reset_area('','',''); }); + + \ No newline at end of file diff --git a/Application/Home/View/default/Safe/setSafeIndex.html b/Application/Home/View/default/Safe/setSafeIndex.html index 78a792b8d..d429b556b 100644 --- a/Application/Home/View/default/Safe/setSafeIndex.html +++ b/Application/Home/View/default/Safe/setSafeIndex.html @@ -37,24 +37,32 @@
    - - 设置安全密码 + 修改安全密码
    - -
    - - - - - + 为了保证您的账户安全,提现和转账等操作需要使用安全密码进行确认(请不要和登陆密码一样) + +
    新密码: -
    + + + + + + - - + + + @@ -208,5 +216,53 @@ _reset_area('','',''); }); + + \ No newline at end of file From e4a29b8bb4a4d63a488df7cfe632ea69e094aaf6 Mon Sep 17 00:00:00 2001 From: yulingwei <2436953959@qq.com> Date: Mon, 22 Jun 2020 19:24:56 +0800 Subject: [PATCH 17/18] upt --- Application/Home/View/default/Safe/setSafeIndex.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Home/View/default/Safe/setSafeIndex.html b/Application/Home/View/default/Safe/setSafeIndex.html index d429b556b..8e79c0f1f 100644 --- a/Application/Home/View/default/Safe/setSafeIndex.html +++ b/Application/Home/View/default/Safe/setSafeIndex.html @@ -3,11 +3,11 @@
    新安全密码: +
    确认密码: - *短信验证码 + + +