Sfoglia il codice sorgente

cardinfo set black

xiaoyu 3 anni fa
parent
commit
bcd02acf71

+ 53 - 20
admin/control/refill_config.php

@@ -8,26 +8,6 @@ class refill_configControl extends SystemControl
         parent::__construct();
     }
 
-    public function indexOp()
-    {
-        if (chksubmit()) {
-            foreach ($_POST as $key => $value) {
-                $cache[$key] = $value;
-            }
-            wcache('config', ['data' => serialize($_POST)], 'refill-');
-            showMessage('编辑成功');
-        } else {
-            $config = rcache('config', 'refill-');
-            if (empty($config)) {
-                $config = [];
-            } else {
-                $config = unserialize($config['data']);
-            }
-            Tpl::output('config', $config);
-            Tpl::showpage('refill.config');
-        }
-    }
-
     public function interceptOp()
     {
         $qualitys = [refill\Quality::Normal => '普充',
@@ -83,4 +63,57 @@ class refill_configControl extends SystemControl
             Tpl::showpage('refill.intercept');
         }
     }
+
+    public function card_infoOp()
+    {
+        $mod_card_info = Model('card_info');
+        $cond = [];
+        $card_list = [];
+        if(!empty($_GET['card_nos'])) {
+            $card_nos = trim($_GET['card_nos'], ',');
+            $cond['card_no'] = ['in', $card_nos];
+        }
+
+        if(!empty($cond)) {
+            $card_list = $mod_card_info->getCardInfoList($cond, 200);
+            $province_list = mtopcard\ProvinceList;
+            foreach ($card_list as $key => $card_info)
+            {
+                $card_list[$key]['card_type_text'] = $this->scard_type($card_info['card_type']);
+                if($card_info['regin'] > 0) {
+                    $card_list[$key]['regin'] = $province_list[$card_info['regin']];
+                }else{
+                    $card_list[$key]['regin'] = '/';
+                }
+            }
+            Tpl::output('show_page', $mod_card_info->showpage());
+        }
+
+        Tpl::output('card_list', $card_list);
+        Tpl::showpage('card.info.list');
+    }
+
+    public function set_black_noOp()
+    {
+        $type = $_GET['type'];
+        $card_nos = trim($_GET['card_nos'], ',');
+        $cond['card_no'] = ['in', $card_nos];
+        $mod_card_info = Model('card_info');
+        $resp = true;
+        if($type == 'set') {
+            $cond['black'] = 0;
+            $resp = $mod_card_info->SetBlackCard($cond);
+        }elseif ($type == 'unset') {
+            $cond['black'] = 1;
+            $resp = $mod_card_info->UnSetBlackCard($cond);
+        }else{
+            showMessage('操作类型有误');
+        }
+
+        if($resp) {
+            showMessage('设置成功');
+        }else{
+            showMessage('设置失败');
+        }
+    }
 }

+ 253 - 0
admin/templates/default/card.info.list.php

@@ -0,0 +1,253 @@
+<style>
+    th label {
+        display: inline-block;
+        width: 60px;
+        margin-left: 10px;
+    }
+    .lineLi {
+        display: inline-block;
+        min-width: 150px;
+        font-size: 14px;
+    }
+    .page .fixed-bar .item-title h3 {
+        margin-top: 18px !important;
+        margin-bottom: 10px !important;
+        font-weight: 700 !important;
+    }
+    .tab-base li span {
+        font-size: 12px !important;
+    }
+    .layui-form-select .layui-input {
+        height: 23px;
+        padding-left: 11px;
+        padding-right: 0 !important;
+    }
+    input::placeholder {
+        color: #333;
+    }
+    .layui-form-selected dl {
+        display: flex !important;
+        flex-wrap: wrap !important;
+    }
+    .layui-form-select dl {
+        top: 29px !important;
+        left: 4px !important;
+        min-width: 802% !important;
+        max-height: 280px !important;
+        padding: 14px 0 !important;
+    }
+    .layui-form-select dl dd.layui-this {
+        display: none;
+    }
+    .layui-form-select dl dd {
+        cursor: pointer;
+        width: 130px;
+    }
+    .lefto {
+        margin-left: 6px;
+    }
+    .db-right {
+        padding-right: 134px !important;
+        border-bottom: 1px solid #ccc;
+    }
+    .db-center {
+        padding: 9px 0;
+        border-bottom: 1px solid #ccc;
+    }
+    .db-top {
+        padding: 0 30px;
+    }
+    #selectAll {
+        cursor: pointer;
+    }
+    .query_ors {
+        width: 140px;
+    }
+</style>
+
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>充值拦截设置</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=refill_config&op=intercept"><span>订单强制处理</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>卡号列表</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" action="index.php" name="formSearch" id="formSearch">
+        <input type="hidden" name="act" value="refill_config"/>
+        <input type="hidden" name="op" value="card_info"/>
+        <table class="tb-type1 noborder search">
+            <tr>
+                <th><label class="query_ors">卡号(多行查询)</label></th>
+                <td><textarea name="card_nos" id="card_nos" cols="30" rows="10"><?php echo $_GET['card_nos'];?></textarea></td>
+                <td>
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;
+                    </a>
+                </td>
+            </tr>
+        </table>
+        <table class="tb-type1 noborder search">
+            <tr>
+                <td>
+                    <a href="#" class="btns"  id="hSet">
+                        <span><i class="icon-edit"></i>批量设置黑名单</span>
+                    </a>
+                    <a href="#" class="btns"  id="hUnset">
+                        <span><i class="icon-edit"></i>批量取消黑名单</span>
+                    </a>
+                </td>
+            </tr>
+        </table>
+    </form>
+    <table class="table tb-type2 nobdb">
+        <thead>
+        <tr class="thead">
+            <th class="align-center" id="selectAll">
+            <input type="checkbox" name="chbox" value="">
+            </th>
+            <th class="align-center">编号</th>
+            <th class="align-center">卡号</th>
+            <th class="align-center">卡类型</th>
+            <th class="align-center">是否转网(0非转网1转网)</th>
+            <th class="align-center">所属地</th>
+            <th class="align-center">黑名单状态</th>
+            <th class="align-center"><?php echo $lang['nc_handle']; ?></th>            
+        </tr>
+        </thead>
+        <tbody id="tbody">
+        <?php if (count($output['card_list']) > 0) { ?>
+            <?php
+            foreach ($output['card_list'] as $key => $value) { ?>
+                <tr class="hover trFlex">
+                    <td class="align-center">
+                        <input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $value['card_no'];?>">
+                    </td>
+                    <td class="align-center"><?php echo $key+1;?></td>
+                    <td class="align-center"><?php echo $value['card_no'];?></td>
+                    <td class="align-center"><?php echo $value['card_type_text'];?></td>
+                    <td class="align-center">
+                        <?php echo $value['transfer'];?>
+                    </td>
+                    <td class="align-center"><?php echo $value['regin'];?></td>
+                    <td class="align-center">
+                        <?php if($value['black'] == 0) {?>
+                            <span style="color: #0bb20c">否</span>
+                        <?php }elseif($value['black'] == 1){?>
+                            <span style="color: #f30707">是</span>
+                        <?php }?>
+                    </td>
+                    <td class="align-center">
+                        <?php if($value['black'] != 1){?>
+                            <a href="index.php?act=refill_config&op=set_black_no&type=set&card_nos=<?php echo $value['card_no']; ?>">
+                                设置黑名单</a>
+                        <?php }else{?>
+                            <a href="index.php?act=refill_config&op=set_black_no&type=unset&card_nos=<?php echo $value['card_no']; ?>">
+                                取消黑名单</a>
+                        <?php }?>
+                    </td>
+                </tr>
+            <?php } ?>
+        <?php } else { ?>
+            <tr class="no_data">
+                <td colspan="8"><?php echo $lang['nc_no_record'];?></td>
+            </tr>
+        <?php } ?>
+        </tbody>
+        <tfoot>
+        <tr class="tfoot">
+            <td colspan="8" id="dataFuncs">
+                <div class="pagination"> <?php echo $output['show_page'];?> </div>
+            </td>
+        </tr>
+        </tfoot>
+    </table>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
+        charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<link rel="stylesheet" type="text/css"
+      href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
+<script type="text/javascript">
+    $(function () {
+        $('#ncsubmit').click(function () {
+            $('#formSearch').submit();
+        });
+
+        //全选
+        $('#selectAll').click(function () {
+            if ($("input[name='chbox']").is(':checked')) {
+                $("input[name='checkbox']").each(function () {
+                    this.checked = true;
+                })
+            } else {
+                $("input[name='checkbox']").each(function () {
+                    this.checked = false;
+                })
+            }
+        })
+
+        //过滤
+        $("#card_nos").blur(function () {
+            let test_mch = $("#card_nos").val();
+            let result = test_mch.replace(/[\  \r\n\,]+/g, ",");
+            $(this).val(result)
+        })
+
+        let get_sel_id = function (){
+            let arr = [];
+            $("input:checkbox:checked").each(function () {
+                let sel_id = $(this).val();
+                if(sel_id !== '') {
+                    arr.push(sel_id);
+                }
+            })
+            if (arr.length <= 0) { return}
+            return arr.join(",")
+        }
+
+        //批量设置
+        $('#hSet').click(function () {
+            layer.confirm('您确定要将卡号设置为黑名单吗', {
+                btn: ['确定', '取消'],
+                title: '设置黑名单'
+            }, function () {
+                const card_nos = get_sel_id();
+                window.location.href = `index.php?act=refill_config&op=set_black_no&type=set&card_nos= ${card_nos ? card_nos : ''}`
+            }, function () {
+                layer.msg('取消成功')
+            });
+        })
+        //批量取消
+        $('#hUnset').click(function () {
+            layer.confirm('您确定要将卡号从黑名单移除吗', {
+                btn: ['确定', '取消'],
+                title: '移除黑名单'
+            }, function () {
+                const card_nos = get_sel_id();
+                window.location.href = `index.php?act=refill_config&op=set_black_no&type=unset&card_nos= ${card_nos ? card_nos : ''}`
+            }, function () {
+                layer.msg('取消成功')
+            });
+        })
+
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            let data_color = $(this).attr('data-timeout_State');
+            $(this).css('background', '#fff')
+            $(this).hover(function () {
+            $(this)[0].style.backgroundColor = '#cbe9f3'
+            }, function () {
+                $(this).css('background', '#fff')
+            })
+        })
+    });
+</script> 

+ 1 - 1
admin/templates/default/refill.intercept.php

@@ -86,8 +86,8 @@
         <div class="item-title">
             <h3>充值拦截设置</h3>
             <ul class="tab-base">
-<!--                <li><a href="index.php?act=refill_config&op=index"><span>系统设置</span></a></li>-->
                 <li><a href="JavaScript:void(0);" class="current"><span>拦截设置</span></a></li>
+                <li><a href="index.php?act=refill_config&op=card_info"><span>卡号列表</span></a></li>
             </ul>
         </div>
     </div>

+ 15 - 0
data/model/card_info.model.php

@@ -127,4 +127,19 @@ class card_infoModel extends Model
         $card_no = intval($card_no);
         return $this->field('*')->where(['card_no' => $card_no])->find();
     }
+
+    public function getCardInfoList($cond, $pagesize = '', $total = 0, $field = '*')
+    {
+        return $this->field($field)->where($cond)->page($pagesize,$total)->select();
+    }
+
+    public function SetBlackCard($cond)
+    {
+        return $this->where($cond)->update(['black' => 1]);
+    }
+
+    public function UnSetBlackCard($cond)
+    {
+        return $this->where($cond)->update(['black' => 0]);
+    }
 }