Browse Source

Merge branch 'raccount' of 39.97.239.116:gyfl/xyzshop into raccount

stanley-king 3 years atrás
parent
commit
4ddfc94ab9

+ 80 - 0
admin/control/refill_error.php

@@ -0,0 +1,80 @@
+<?php
+
+class refill_errorControl extends SystemControl
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function indexOp()
+    {
+        $mod = Model('refill_error');
+        $condition = [];
+        $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00");
+        $start_unixtime = intval(strtotime($_GET['query_start_time']));
+        $end_unixtime = intval(strtotime($_GET['query_end_time']));
+        if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
+            $condition['add_time'] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
+        } elseif ($start_unixtime > 0) {
+            $condition['add_time'] = ['egt', $start_unixtime];
+        } elseif ($end_unixtime > 0) {
+            $condition['add_time'] = ['lt', $end_unixtime];
+        } else {
+            $start = strtotime(date('Y-m-d', time()));
+            $condition['add_time'] = ['egt', $start];
+        }
+
+        if(!empty($_GET['mchid'])) {
+            $condition['mchid'] = $_GET['mchid'];
+        }
+        if(in_array($_GET['handled'], ['0', '1'])) {
+            $condition['handled'] = $_GET['handled'];
+        }
+        if (!empty($_GET['mch_orders'])) {
+            $mch_orders = rtrim($_GET['mch_orders'],',');
+            $condition['mch_order'] = ['in', $mch_orders];
+        }
+        $list = $mod->getRefillErrorlList($condition, 200, 1000);
+
+        $merchants = [];
+        $merchant_list = $this->merchants();
+        foreach ($merchant_list as  $value) {
+            $merchants[$value['mchid']] = $value;
+        }
+
+        $list = $this->DataFormat($list, $merchants);
+        Tpl::output('merchant_list', $merchant_list);
+        Tpl::output('list', $list);
+        Tpl::output('show_page', $mod->showpage());
+        Tpl::showpage('refill.error');
+    }
+
+    private function DataFormat($list,$merchants)
+    {
+        foreach ($list as $key => $value) {
+            $list[$key]['company_name'] = $merchants[$value['mchid']]['company_name'];
+            if($value['handled'] == 0) {
+                $list[$key]['handled_text'] = '未处理';
+            } else {
+                $list[$key]['handled_text'] = '已处理';
+            }
+        }
+        return $list;
+    }
+
+    public function handledOp()
+    {
+        $mod = Model('refill_error');
+
+        $id = $_GET['error_id'];
+        $condition['error_id'] = ['in',$id];
+        $condition['handled'] = 0;
+
+        $resp = $mod->where($condition)->update(['handled' => 1]);
+        if(!$resp) {
+            showMessage('操作失败', 'index.php?act=refill_error&op=index');
+        }
+        showMessage('操作成功', 'index.php?act=refill_error&op=index');
+    }
+}

+ 1 - 0
admin/include/limit.php

@@ -51,6 +51,7 @@ $_limit =  array(
         array('name'=> '接单查询', 'op'=>null, 'act'=>'refill_detail'),
         array('name'=> '通道价格明细', 'op'=>null, 'act'=>'provider_price'),
         array('name'=> '任务列表', 'op'=>null, 'act'=>'task'),
+        array('name'=> '异常订单列表', 'op'=>null, 'act'=>'refill_error'),
     )),
 	array('name'=>$lang['nc_store'], 'child'=>array(
 		array('name'=>$lang['nc_store_manage'], 'op'=>null, 'act'=>'store'),

+ 1 - 0
admin/include/menu.php

@@ -115,6 +115,7 @@ $arr = array(
 					array('args'=>'index,refill_detail,merchant',			'text'=>'接单查询'),
 					array('args'=>'index,provider_price&card_type=2,merchant',			'text'=>'通道价格明细'),
 					array('args'=>'index,task,merchant',					'text'=>'任务列表'),
+					array('args'=>'index,refill_error,merchant',			'text'=>'异常订单列表'),
 				)
 			),
 			4 => array(

+ 301 - 0
admin/templates/default/refill.error.php

@@ -0,0 +1,301 @@
+<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="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_error"/>
+        <input type="hidden" name="op" value="index"/>
+        <table class="tb-type1 noborder search">
+            <tr>
+                <th><label>客户名称</label></th>
+                <td class="layui-form">
+                    <select name="mchid" class="querySelect" lay-verify="">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <?php foreach ($output['merchant_list'] as $merchant) { ?>
+                            <option value="<?php echo $merchant['mchid'] ?>"<?php if ($_GET['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name']; ?></option>
+                        <?php } ?>
+                    </select>
+                </td>
+
+                <th><label for="query_start_time">异常记录时间</label></th>
+                <td>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
+                    <label for="query_start_time">~</label>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
+                </td>
+
+                <th><label class="query_ors">商家单号(多行查询)</label></th>
+                <td><textarea name="mch_orders" id="mch_orders" cols="30" rows="10"><?php echo $_GET['mch_orders'];?></textarea></td>
+
+                <th><label>处理状态</label></th>
+                <td>
+
+                    <select name="handled" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="0"
+                                <?php if ($_GET['handled'] == '0'){ ?>selected<?php } ?>>未处理
+                        </option>
+                        <option value="1"
+                                <?php if ($_GET['handled'] == '1'){ ?>selected<?php } ?>>已处理
+                        </option>
+                    </select>
+                </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" onclick="hCopyOrder(event)">
+                        <span><i class="icon-edit"></i>拷贝客户单号</span>
+                    </a>
+                    <a href="#" class="btns"  id="hHandled">
+                        <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-left">编号</th>
+            <th class="align-left">机构编号</th>
+            <th class="align-left">机构名称</th>
+            <th class="align-left">商家单号</th>
+            <th class="align-left">订单下单日期</th>
+            <th class="align-left">异常记录日期</th>
+            <th class="align-left">异常信息</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['list']) > 0) { ?>
+            <?php
+            foreach ($output['list'] as $key => $order) { ?>
+                <tr class="hover trFlex">
+                    <td class="align-center">
+                    <input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $order['error_id'];?>">
+                    </td>
+                    <td class="align-left"><?php echo $key+1;?></td>
+                    <td class="align-left"><?php echo $order['mchid']; ?></td>
+                    <td class="align-left"><?php echo $order['company_name'];?></td>
+                    <td class="align-left"><?php echo $order['mch_order']; ?></td>
+                    <td class="align-left"><?php echo date('Y-m-d H:i:s', $order['order_time']) ?? '/'; ?></td>
+                    <td class="align-left"><?php echo date('Y-m-d H:i:s', $order['add_time']) ?? '/'; ?></td>
+                    <td class="align-left"><?php echo $order['msg']; ?></td>
+                    <td class="align-center">
+                        <?php if($order['handled'] == 0){?>
+                        <span style="color: red">
+                        <?php }else{?>
+                        <span style="color: green">
+                        <?php }?>
+                            <?php echo $order['handled_text']; ?>
+                        </span>
+                    </td>
+                    <td class="align-center">
+                        <?php if($order['handled'] == 0){?>
+                        <a href="index.php?act=refill_error&op=handled&error_id=<?php echo $order['error_id']; ?>">
+                        处理</a>
+                        <?php }?>
+                    </td>
+                </tr>
+            <?php } ?>
+        <?php } else { ?>
+            <tr class="no_data">
+                <td colspan="10"><?php echo $lang['nc_no_record']; ?></td>
+            </tr>
+        <?php } ?>
+        </tbody>
+        <tfoot>
+        <tr class="tfoot">
+            <td colspan="10" id="dataFuncs">
+                <div class="pagination"> <?php echo $output['show_page']; ?> </div>
+            </td>
+        </tr>
+        </tfoot>
+    </table>
+    <!-- 预警提示 -->
+    <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
+</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();
+        });
+        $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
+        $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+          //全选
+        $('#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;
+              })
+          }
+            })
+
+        //过滤
+        $("#mch_orders").blur(function () {
+            let test_mch =  $("#mch_orders").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(",")
+        }
+
+        //批量处理
+        $('#hHandled').click(function () {
+            layer.confirm('您确定要批量处理', {
+                btn: ['确定', '取消'],
+                title: '批量处理'
+            }, function () {
+                const batch = get_sel_id();
+                window.location.href = `index.php?act=refill_error&op=handled&error_id= ${batch ? batch : ''}`
+            }, function () {
+                layer.msg('取消成功')
+            });
+        })
+
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).css('background', '#fff')
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            }, function () {
+                $(this).css('background', '#fff')
+            })
+        })
+    });
+    function hCopyOrder(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let res = $(this).find('td').eq(4).text()
+            str += res + '\n'
+        })
+        let oInput = document.createElement("textarea");
+        oInput.style.border = "0 none";
+        oInput.style.color = "transparent";
+        oInput.value = str;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        oInput.parentNode.removeChild(oInput)
+    }
+
+</script> 

+ 1 - 1
admin/templates/default/third.product.add.php

@@ -5,7 +5,7 @@
         <div class="item-title">
             <h3>增值业务管理</h3>
             <ul class="tab-base">
-                <li><a href="index.php?act=refill_third&op=index"><span><?php echo $lang['nc_manage'] ?></span></a></li>
+                <li><a href="index.php?act=refill_third&op=index"><span>增值产品列表</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span><?php echo $lang['nc_new'] ?>产品</span></a></li>
             </ul>
         </div>

+ 1 - 1
admin/templates/default/third.product.edit.php

@@ -5,7 +5,7 @@
         <div class="item-title">
             <h3>增值业务管理</h3>
             <ul class="tab-base">
-                <li><a href="index.php?act=refill_third&op=index"><span><?php echo $lang['nc_manage'] ?></span></a></li>
+                <li><a href="index.php?act=refill_third&op=index"><span>增值产品列表</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span><?php echo $lang['nc_update'] ?></span></a></li>
             </ul>
         </div>

+ 9 - 9
data/config/xyz/refill.ini.php

@@ -961,24 +961,24 @@ $yunsuoyao_phone = ['name' => 'yunsuoyao', 'store_id' => 55, 'qualitys' => '1',
 //            ['goods_id' => 6572, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinatelecom']
 //        ],
         30 => [
-            ['goods_id' => 6573, 'price' => 28.56, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6573, 'price' => 28.86, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6573, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6573, 'price' => 28.68, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6573, 'price' => 28.56, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 6574, 'price' => 47.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6574, 'price' => 48.1, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6574, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6574, 'price' => 47.8, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6574, 'price' => 47.6, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 6575, 'price' => 95.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6575, 'price' => 96.2, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6575, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6575, 'price' => 95.6, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6575, 'price' => 95.2, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6576, 'price' => 190.4, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6576, 'price' => 192.4, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6576, 'price' => 190.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 6576, 'price' => 191.2, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 6576, 'price' => 190.4, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
 
         300 => [
@@ -3146,7 +3146,7 @@ $feimingyu_phone = ['name' => 'feimingyu', 'store_id' => 147, 'qualitys' => '1',
             ['goods_id' => 7261, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinatelecom']
         ],
         50 => [
-            ['goods_id' => 7262, 'price' => 47.15, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7262, 'price' => 48.15, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 7262, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7262, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinatelecom'],
         ],

+ 18 - 0
data/model/refill_error.model.php

@@ -0,0 +1,18 @@
+<?php
+
+defined('InShopNC') or exit('Access Invalid!');
+
+class refill_errorModel extends Model
+{
+    public function __construct()
+    {
+        parent::__construct('refill_error');
+    }
+
+    public function getRefillErrorlList($condition, $pagesize = '',$total = 0, $field = '*', $order = 'add_time desc', $limit = '', $master = false)
+    {
+        $list = $this->field($field)->where($condition)->page($pagesize,$total)->order($order)->limit($limit)->master($master)->select();
+        if (empty($list)) return [];
+        return $list;
+    }
+}

+ 4 - 6
helper/refill/api/xyz/huoshenguo_high/config.php

@@ -29,12 +29,10 @@ class config
             200 => 100037,
         ],
         mtopcard\ChinaTelecomCard => [
-            30  => 100012,
-            50  => 100010,
-            100 => 100011,
-            200 => 100017,
-            300 => 100048,
-            500 => 100049,
+            30  => 100090,
+            50  => 100091,
+            100 => 100092,
+            200 => 100093,
         ],
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];

+ 7 - 1
helper/refill/api/xyz/huoshenguo_high/开户信息.txt

@@ -43,4 +43,10 @@ appSecret:PfeOsZRoMsAcmweP
 100034	快充联通30
 100035	快充联通50
 100036	快充联通100
-100037	快充联通200
+100037	快充联通200
+
+2022.2.25更改电信编码
+100090 WX电信30
+100091 WX电信50
+100092  WX电信100
+100093  WX电信200