From 5c8221d9dc4066d1fbc3a7ed69667e90f5e7f79d Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Fri, 20 Mar 2020 17:31:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E9=99=90=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/ToolController.class.php | 377 +++++++++++++++ Application/Admin/View/Tool/addLimitPay.html | 366 ++++++++++++++ Application/Admin/View/Tool/editLimitPay.html | 448 ++++++++++++++++++ Application/Admin/View/Tool/limitPay.html | 144 ++++++ 4 files changed, 1335 insertions(+) create mode 100644 Application/Admin/View/Tool/addLimitPay.html create mode 100644 Application/Admin/View/Tool/editLimitPay.html create mode 100644 Application/Admin/View/Tool/limitPay.html diff --git a/Application/Admin/Controller/ToolController.class.php b/Application/Admin/Controller/ToolController.class.php index 39598df6e..c04110d61 100644 --- a/Application/Admin/Controller/ToolController.class.php +++ b/Application/Admin/Controller/ToolController.class.php @@ -6,6 +6,13 @@ namespace Admin\Controller; * @author 麦当苗儿 */ class ToolController extends ThinkController { + public $pay_type = [ + 0 => ['name' => '支付宝', 'paytag' => 'alipay' ], + 1 => ['name' => '微信', 'paytag' => 'wxpay'], + 2 => ['name' => '易宝', 'paytag' => 'yeepay'], + 3 => ['name' => '双乾', 'paytag' => 'sqpay'], + + ]; /** *保存设置 @@ -898,6 +905,376 @@ class ToolController extends ThinkController { } + public function limitPay($p=1) { + $page = intval(I('get.p', 0)); + $page = $page ? $page : 1; //默认显示第一页数据 + $row = empty($row) ? 10 : $row;//每页条数 + + $payType = $_REQUEST['pay_type']; + $limit_type = $_REQUEST['limit_type']; + + $limit_time_type = $_REQUEST['limit_time_type']; + $map = []; + if (!empty($payType)) { + $map['pay_type'] = $payType; + $parameter['pay_type'] = $payType; + } + + if (!empty($limit_type)) { + $map['limit_type'] = $limit_type; + $parameter['limit_type'] = $limit_type; + } + $datas = M('pay_limit_conf', 'tab_') + ->where($map) + ->order('id desc') + ->page($page, $row) + ->select(); + + /* 查询记录总数 */ + $count = M('pay_limit_conf', 'tab_') + ->where($map) + ->count(); + foreach ($datas as $key => $data) { + $limit_rule = ''; + if ( $data['user_total_limit']) { + $limit_rule .= '玩家全渠道总流水限额'.$data['user_total_limit']; + } + if ( $data['total_limit']) { + $limit_rule .= '全渠道总流水限额'.$data['total_limit']; + } + if ( $data['user_one_limit']) { + $limit_rule .= '玩家单笔限制'.$data['user_one_limit']; + } + if ($limit_rule == '') { + $limit_rule = '暂无规则'; + } + if ($data['limit_time_type'] == 'day') { + $data['limit_time_type'] = '每日,'; + } + if ($data['limit_time_type'] == 'week') { + $data['limit_time_type'] = '每周,'; + } + if ($data['limit_time_type'] == 'month') { + $data['limit_time_type'] = '每月,'; + } + if ($data['limit_time_type'] == 'fix') { + $data['limit_time_type'] = '特殊,'; + } + if ($data['limit_type'] == 'force') { + $datas[$key]['limit_type'] = '强制模式'; + } + if ($data['limit_type'] == 'obstacles') { + $datas[$key]['limit_type'] = '障碍模式'; + } + if ($data['pay_type'] == 'alipay') { + $pay_type = '支付宝'; + } + if ($data['pay_type'] == 'wxpay') { + $pay_type = '微信'; + } + if ($data['pay_type'] == 'yeepay') { + $pay_type = '易宝'; + } + if ($data['pay_type'] == 'sqpay') { + $pay_type = '双乾'; + } + $start_timeArr = str_split($data['start_time'], 1); + $startTimeStr = ''; + foreach ($start_timeArr as $timeKey => $start_time) { + if ($timeKey == 1 || $timeKey == 3) { + $startTimeStr .= $start_time.':'; + }else { + $startTimeStr .= $start_time; + } + + } + + $end_timeArr = str_split($data['end_time'], 1); + $endTimeStr = ''; + foreach ($end_timeArr as $timeKey1 => $end_time) { + if ($timeKey1 == 1 || $timeKey1 == 3) { + $endTimeStr .= $end_time. ':'; + }else { + $endTimeStr .= $end_time; + } + + } + $datas[$key]['pay_type'] = $pay_type; + $datas[$key]['limit_rule'] = $limit_rule; + $datas[$key]['limit_time'] = $data['limit_time_type'] .$data['limit_time_type_remark'].' '.$startTimeStr.'~'.$endTimeStr; + + } + //分页 + $parameter['p'] = $page; + $parameter['row'] = $row; + $page = set_pagination($count, $row, $parameter); + if ($page) { + $this->assign('_page', $page); + } + var_dump($payType); + if (empty($payType)) { + $this->assign('pay_type', " "); + }else { + $this->assign('pay_type', $payType); + } + if (empty($limit_type)) { + $this->assign('limit_type', " "); + }else { + $this->assign('limit_type', $limit_type); + } + $this->assign('datas', $datas); + $this->display(); + } + + + public function addLimitPay() { + if ($_POST) { + $pay_type = $_REQUEST['pay_type']; + $total_limit = empty($_REQUEST['total_limit']) ? 0 : $_REQUEST['total_limit']; + $user_total_limit = empty($_REQUEST['user_total_limit']) ? 0 : $_REQUEST['user_total_limit']; + $user_one_limit = empty($_REQUEST['user_one_limit']) ? 0 : $_REQUEST['user_one_limit']; + $limit_type = $_REQUEST['limit_type']; + $status = $_REQUEST['status']; + $startTime = ''; + $endTime = ''; + if (empty($pay_type)) { + return $this->error('限制支付渠道不能为空'); + } + if (empty($limit_type)) { + return $this->error('限制方式不能为空'); + } + + $paramsName = $status.'_start'; + for ($i = 1; $i < 13; $i++) { + $name = $paramsName.$i; + if (empty($_REQUEST[$name])) { + return $this->error('时间选择不能为空'); + }else { + if ($i < 7) { + $startTime .= $_REQUEST[$name]; + }else { + $endTime .= $_REQUEST[$name]; + } + } + + $this->checkTimeFormat($i, $startTime, $endTime, $_REQUEST[$name]); + + } + switch($status) { + case 'daily': + $limit_time_type = 'day'; + break; + case 'week': + $limit_time_type = 'week'; + if (empty($_REQUEST['week_remark'])) { + return $this->error('每周限制时间未确定'); + }else { + $data['limit_time_type_remark'] = $_REQUEST['week_remark']; + } + break; + case 'month': + $limit_time_type = 'month'; + if (empty($_REQUEST['month_remark'])) { + return $this->error('每月限制时间未确定'); + }else { + $data['limit_time_type_remark'] = $_REQUEST['month_remark']; + } + break; + case 'day': + $limit_time_type = 'fix'; + if (empty($_REQUEST['day_remark'])) { + return $this->error('每月限制时间未确定'); + }else { + $data['limit_time_type_remark'] = $_REQUEST['day_remark']; + } + break; + } + if (!is_numeric($startTime) || !is_numeric($endTime)) { + $this->error('时间格式出错'); + } + + $data['pay_type'] = $pay_type; + $data['limit_type'] = $limit_type; + $data['limit_time_type'] = $limit_time_type; + $data['start_time'] = $startTime; + $data['end_time'] = $endTime; + $data['total_limit'] = $total_limit; + $data['user_total_limit'] = $user_total_limit; + $data['user_one_limit'] = $user_one_limit; + $data['create_time'] = time(); + $res = M('pay_limit_conf', 'tab_')->add($data); + + if($res) { + $this->success('新增成功',U('limitPay')); + } + }else { + // $id = $_REQUEST['id']; + // $limitConf = M('pay_limit_conf', 'tab_')->where(['id'=>$id])->find(); + // if (empty($limitConf)) { + // return $this->error('未找到该条信息'); + // } + // foreach ($limitConf as $key => $conf) { + + // } + + $monthDay = $this->getMonthDay(); + $this->assign('monthday', $monthDay); + $this->display(); + } + + + + } + + public function editLimitPay() { + if ($_POST) { + $id = $_REQUEST['id']; + $pay_type = $_POST['pay_type']; + $total_limit = $_POST['total_limit']; + $user_total_limit = $_POST['user_total_limit']; + $user_one_limit = $_POST['user_one_limit']; + $limit_type = $_POST['limit_type']; + $status = $_POST['status']; + $startTime = ''; + $endTime = ''; + if (empty($id)) { + return $this->error('编辑信息出错'); + } + + $confInfo = M('pay_limit_conf', 'tab_')->where(['id'=>$id])->find(); + $confInfo['pay_type'] = $pay_type; + $confInfo['total_limit'] = $total_limit; + $confInfo['user_total_limit'] = $user_total_limit; + $confInfo['user_one_limit'] = $user_one_limit; + $confInfo['limit_type'] = $limit_type; + $paramsName = $status.'_start'; + for ($i = 1; $i < 13; $i++) { + $name = $paramsName.$i; + if (empty($_REQUEST[$name])) { + return $this->error('时间选择不能为空'); + }else { + if ($i < 7) { + $startTime .= $_REQUEST[$name]; + }else { + $endTime .= $_REQUEST[$name]; + } + } + + $this->checkTimeFormat($i, $startTime, $endTime, $_REQUEST[$name]); + + + } + $confInfo['start_time'] = $startTime; + $confInfo['end_time'] = $endTime; + switch($status) { + case 'daily': + $limit_time_type = 'day'; + $confInfo['limit_time_type_remark'] = ""; + break; + case 'week': + $limit_time_type = 'week'; + if (empty($_REQUEST['week_remark'])) { + return $this->error('每周限制时间未确定'); + }else { + $confInfo['limit_time_type_remark'] = $_REQUEST['week_remark']; + } + break; + case 'month': + $limit_time_type = 'month'; + if (empty($_REQUEST['month_remark'])) { + return $this->error('每月限制时间未确定'); + }else { + $confInfo['limit_time_type_remark'] = $_REQUEST['month_remark']; + } + break; + case 'day': + $limit_time_type = 'fix'; + if (empty($_REQUEST['day_remark'])) { + return $this->error('每月限制时间未确定'); + }else { + $confInfo['limit_time_type_remark'] = $_REQUEST['day_remark']; + } + $confInfo['limit_time_type_remark'] = $_REQUEST['day_remark']; + break; + } + $confInfo['limit_time_type'] = $limit_time_type; + $update = M('pay_limit_conf', 'tab_')->where(['id'=>$id])->save($confInfo); + if ($update) { + $this->success('编辑成功',U('limitPay')); + }else { + $this->error('未修改资料,请确认'); + } + + }else { + $id = $_REQUEST['id']; + $data = M('pay_limit_conf', 'tab_')->where(['id'=>$id])->find(); + $start_time = $data['start_time']; + + $end_time = $data['end_time']; + $monthDay = $this->getMonthDay(); + $this->assign('monthday', $monthDay); + $this->assign('startTime', $start_time); + $this->assign('endTime', $end_time); + $this->assign('data', $data); + // var_dump($this->pay_type);die(); + $this->assign('pay_type', $this->pay_type); + $this->display(); + } + } + + + + public function delLimitPay($id) { + $res = M('pay_limit_conf', 'tab_')->where(['id'=>$id])->delete(); + if($res) { + $this->success('删除成功',U('limitPay')); + } + } + + public function getMonthDay() { + $arr = []; + for ($i = 1;$i < 32; $i++ ) { + $arr[] = $i.'号'; + } + return $arr; + + } + + public function checkTimeFormat($i, $startTime = '' , $endTime = '', $name) { + if ($i == 2) { + if ($startTime < 0 || $startTime > 23) { + return $this->error("时间选择出错"); + } + } + + if ($i == 3 || $i == 5) { + if ($name < 0 || $name > 5) { + return $this->error("时间选择出错"); + } + } + if ($i == 4 || $i == 6) { + if ($name < 0 || $name > 9) { + return $this->error("时间选择出错"); + } + } + + if ($i == 8) { + if ($endTime < 0 || $endTime > 23) { + return $this->error("时间选择出错"); + } + } + + if ($i == 9 || $i == 11) { + if ($name < 0 || $name > 5) { + return $this->error("时间选择出错"); + } + } + if ($i == 10 || $i == 12) { + if ($name < 0 || $name > 9) { + return $this->error("时间选择出错"); + } + } + } } diff --git a/Application/Admin/View/Tool/addLimitPay.html b/Application/Admin/View/Tool/addLimitPay.html new file mode 100644 index 000000000..22faced63 --- /dev/null +++ b/Application/Admin/View/Tool/addLimitPay.html @@ -0,0 +1,366 @@ + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
限制支付渠道 + + + +
限制规则 + + 说明:强制限制和支付体验障碍 +
全渠道总流水限制 + +
玩家全渠道总流水限制 + +
玩家单笔限制 + +
限制方式 + + + + 说明:强制限制和支付体验障碍 +
限制时间 + + +
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ 说明:时间格式(00:00:00) +
+ + + + + + +
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ +
+ + + + + +
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ + + : +
+ + + : +
+ + + +
+ +
+
+
+ +
+ + +
+ +
+
+
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ + + + + +
+ + + +
+
+ +
+ + + + +
+ + + + diff --git a/Application/Admin/View/Tool/editLimitPay.html b/Application/Admin/View/Tool/editLimitPay.html new file mode 100644 index 000000000..6f7150f09 --- /dev/null +++ b/Application/Admin/View/Tool/editLimitPay.html @@ -0,0 +1,448 @@ + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
限制支付渠道 + + + +
限制规则 + + 说明:强制限制和支付体验障碍 +
全渠道总流水限制 + +
玩家全渠道总流水限制 + +
玩家单笔限制 + +
限制方式 + + + + 说明:强制限制和支付体验障碍 +
限制时间 + + +
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ 说明:时间格式(00:00:00) +
+ + + + + + +
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ +
+ + + + + +
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ + + : +
+ + + : +
+ + + +
+ +
+
+
+ +
+ + +
+ +
+
+
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ + + : +
+ + + : +
+ + + +
+ +
+
+ +
+ + + + + +
+ + + +
+
+ +
+ + + + +
+ + + + + diff --git a/Application/Admin/View/Tool/limitPay.html b/Application/Admin/View/Tool/limitPay.html new file mode 100644 index 000000000..7ee611f1e --- /dev/null +++ b/Application/Admin/View/Tool/limitPay.html @@ -0,0 +1,144 @@ + + + + + + + + + +
+
+ 新增规则 + + +
+ +
+
+ +
+
+ +
+
+ + 搜索 +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
限制序号限制支付渠道限制规则限制方式限制时间操作
{$data.id}{$data.pay_type}{$data.limit_rule}{$data.limit_type}{$data.limit_time} + 编辑 + 删除 +
aOh! 暂时还没有内容!
+ +
+ {$_page} +
+
+ + + +
+ + + + \ No newline at end of file