xiaoyu %!s(int64=3) %!d(string=hai) anos
pai
achega
da710f0f43

+ 37 - 12
admin/control/ordersendlist.php

@@ -68,19 +68,11 @@ class ordersendlistControl extends SystemControl
             ->on('refill_order.order_id=vr_order.order_id')
             ->field('count(*) as order_count ,sum(refill_amount) as refill_amounts, sum(channel_amount) as channel_amounts, sum(mch_amount) as mch_amounts')
             ->where($condition)->find();
-        $count = $this->refill_stat($condition,$time_cond);
+        $count = $this->refill_stats($condition,$time_cond);
 
         $merchant_list = Model('')->table('merchant')->limit(1000)->order('name asc')->select();
-        foreach ($merchant_list as $value) {
-            $merchants[$value['mchid']] = $value;
-        }
-        foreach ($order_list as $order_id => $order_info) {
-            $order_list[$order_id]['card_type_text'] = $this->scard_type($order_info['card_type']);
-            $order_list[$order_id]['mch_name'] = $merchants[$order_info['mchid']]['company_name'];
-            $order_list[$order_id]['diff_time_text'] = $this->elapse_time(time() - $order_info['order_time']);
-            $order_list[$order_id]['diff_time'] = time() - $order_info['order_time'];
-            $order_list[$order_id]['quality_text'] = $this->quality_format($order_info['quality'],$order_info['card_type']);
-        }
+
+        $order_list = $this->orderFormat($order_list,$merchant_list);
         $provider_list = Model('')->table('refill_provider,store')
             ->field('refill_provider.*,store.store_name')
             ->join('inner')
@@ -97,7 +89,7 @@ class ordersendlistControl extends SystemControl
         Tpl::showpage('refill.order.send.index');
     }
 
-    private function refill_stat($condition, $times)
+    private function refill_stats($condition, $times): array
     {
         $stat_order = function ($condition) {
             $stat = Model('')->table('refill_order,vr_order')->join('inner')
@@ -115,4 +107,37 @@ class ordersendlistControl extends SystemControl
         }
         return $result;
     }
+
+    public function neterr_orderOp()
+    {
+        $model_refill_order = Model('refill_order');
+        $condition['refill_order.inner_status'] = 0;
+        $condition['refill_order.neterr'] = 1;
+        $condition['vr_order.order_state'] = ORDER_STATE_PAY;
+
+        $order_list = $model_refill_order->getMerchantOrderList($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.order_time asc');
+        $merchant_list = Model('')->table('merchant')->limit(1000)->order('name asc')->select();
+        $order_list = $this->orderFormat($order_list,$merchant_list);
+
+        Tpl::output('order_list', $order_list);
+        Tpl::output('show_page', $model_refill_order->showpage());
+        Tpl::showpage('refill.order.neterr.index');
+    }
+
+    public function orderFormat($order_list, $merchant_list)
+    {
+        $merchants = [];
+        foreach ($merchant_list as $value) {
+            $merchants[$value['mchid']] = $value;
+        }
+        foreach ($order_list as $order_id => $order_info) {
+            $order_list[$order_id]['card_type_text'] = $this->scard_type($order_info['card_type']);
+            $order_list[$order_id]['mch_name'] = $merchants[$order_info['mchid']]['company_name'];
+            $order_list[$order_id]['diff_time_text'] = $this->elapse_time(time() - $order_info['order_time']);
+            $order_list[$order_id]['diff_time'] = time() - $order_info['order_time'];
+            $order_list[$order_id]['quality_text'] = $this->quality_format($order_info['quality'],$order_info['card_type']);
+        }
+
+        return $order_list;
+    }
 }

+ 1 - 1
admin/include/limit.php

@@ -35,7 +35,7 @@ $_limit =  array(
         array('name'=> '订单列表', 'op'=>null, 'act'=>'refill_order'),
         array('name'=> '通道列表', 'op'=>null, 'act'=>'provider'),
         array('name'=> '通道组管理', 'op'=> null, 'act'=>'provider_group'),
-        array('name'=> '超时订单管理', 'op'=>null, 'act'=>'ordersendlist'),
+        array('name'=> '问题订单监控', 'op'=>null, 'act'=>'ordersendlist'),
         array('name'=> '对账管理', 'op'=>null, 'act'=>'orderstats'),
         array('name'=> '卡密管理', 'op'=>null, 'act'=>'card_key'),
         array('name'=> '库存管理', 'op'=>null, 'act'=>'refill_stock'),

+ 1 - 1
admin/include/menu.php

@@ -98,7 +98,7 @@ $arr = array(
 					array('args'=>'index,refill_order,merchant',			'text'=>'订单列表'),
 					array('args'=>'index,provider,merchant',				'text'=>'通道列表'),
 					array('args'=>'index,provider_group,merchant',			'text'=>'通道组管理'),
-					array('args'=>'index,ordersendlist,merchant',			'text'=>'超时订单监控'),
+					array('args'=>'index,ordersendlist,merchant',			'text'=>'问题订单监控'),
 					array('args'=>'index,orderstats,merchant',				'text'=>'对账管理'),
 					array('args'=>'stats,card_key,merchant',				'text'=>'卡密管理'),
 					array('args'=>'index,refill_stock,merchant',			'text'=>'库存管理'),

+ 241 - 0
admin/templates/default/refill.order.neterr.index.php

@@ -0,0 +1,241 @@
+<style>
+    th label {
+        display: inline-block;
+        width: 60px;
+    }
+
+    .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;
+    }
+</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=ordersendlist&op=index"><span>超时订单监控</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>网络错误订单监控</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <table class="tb-type1 noborder search">
+        <tr>
+            <td>
+                <a href="#" class="btns" onclick="hCopyChannel(event)">
+                    <span><i class="icon-edit"></i>拷贝订单号</span>
+                </a>
+                <a href="#" class="btns" onclick="hCopyCardNo(event)">
+                    <span><i class="icon-edit"></i>拷贝充值卡号</span>
+                </a>
+            </td>
+        </tr>
+    </table>
+    <table class="table tb-type2 nobdb">
+        <thead>
+        <tr class="thead">
+            <th class="align-center">编号</th>
+            <th class="align-center">订单号</th>
+            <th class="align-center">机构编号</th>
+            <th class="align-center">机构名称</th>
+            <th class="align-center">充值卡号</th>
+            <th class="align-center">充值卡类型</th>
+            <th class="align-center">充值额度</th>
+            <th class="align-right">下单日期</th>
+            <th class="align-right">耗时</th>
+            <th class="align-center">订单状态</th>
+            <th class="align-center">通道质量</th>
+            <th class="align-center">失败原因</th>
+            <th class="align-center">商家单号</th>
+            <th class="align-center">扣款金额</th>
+            <th class="align-center">渠道单号</th>
+            <th class="align-center">渠道名称</th>
+        </tr>
+        </thead>
+        <tbody id="tbody">
+        <?php if (count($output['order_list']) > 0) { ?>
+            <?php
+            foreach ($output['order_list'] as $key => $order) { ?>
+                <tr class="hover trFlex">
+                    <td class="align-center"><?php echo $key + 1; ?></td>
+                    <td class="align-left"><?php echo $order['order_sn']; ?></td>
+                    <td class="align-center"><?php echo $order['mchid']; ?></td>
+                    <td class="align-center"><?php echo $order['mch_name']; ?></td>
+                    <td class="align-left"><?php echo $order['card_no']; ?></td>
+                    <td class="align-center"><?php echo $order['card_type_text']; ?></td>
+                    <td class="align-center"><?php echo $order['refill_amount']; ?></td>
+                    <td class="align-right"><?php echo date('Y-m-d H:i:s', $order['order_time']); ?></td>
+                    <td class="align-right">
+                        <?php if (empty($order['notify_time'])) {
+                            if ($order['diff_time'] >= 1800 && $order['diff_time'] <= 3600) {
+                                ?>
+                                <span style="color: #fd9d0e"><?php echo $order['diff_time_text'] ?></span>
+                            <?php } elseif ($order['diff_time'] > 3600) { ?>
+                                <span style="color: #f30707"><?php echo $order['diff_time_text'] ?></span>
+                            <?php } else {
+                                ?>
+                                <?php echo $order['diff_time_text'] ?>
+                            <?php } ?>
+                        <?php } else { ?>
+                            <?php echo $order['diff_time_text'] ?>
+                        <?php } ?>
+                    </td>
+                    <td class="align-center"><?php echo orderState($order); ?></td>
+                    <td class="align-left"><?php echo $order['quality_text']; ?></td>
+                    <td class="align-left"><?php echo $order['err_msg']; ?></td>
+                    <td class="align-left"><?php echo $order['mch_order']; ?></td>
+                    <td class="align-center"><?php echo $order['mch_amount']; ?></td>
+                    <td class="align-left" class="ch_trade_no"><?php echo $order['ch_trade_no']; ?></td>
+                    <td class="align-center"><?php echo $order['channel_name']; ?></td>
+                </tr>
+            <?php } ?>
+        <?php } else { ?>
+            <tr class="no_data">
+                <td colspan="15"><?php echo $lang['nc_no_record']; ?></td>
+            </tr>
+        <?php } ?>
+        </tbody>
+        <tfoot>
+        <tr class="tfoot">
+            <td colspan="15" 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'
+        });
+        let isWring = '<?php echo $output['count'][1];?>';
+        // console.log('isWring', Number(isWring));
+        let setTimer
+        let num
+        if (Number(isWring) > 0) {
+            window.clearTimeout(setTimer)
+            setTimer = setTimeout(function () {
+                $("#auto")[0].play();
+                // $("#auto").attr("src", '<?php echo RESOURCE_SITE_URL; ?>/warning.mp3');
+            }, 1000);
+            window.clearTimeout(num)
+            num = setTimeout(function () {
+                window.location.reload();
+            }, 60000);
+        }
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            }, function () {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+        // 供方名称颜色
+        $('.textColor').each(function () {
+            let color = $(this).attr('data-color')
+            if (color == '1') {
+                $(this).css('color', 'green')
+            } else {
+                $(this).css('color', 'red')
+            }
+        })
+    });
+
+    function hCopyChannel(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let res = $(this).find('td').eq(1).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)
+    }
+
+    function hCopyCardNo(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> 

+ 2 - 1
admin/templates/default/refill.order.send.index.php

@@ -53,9 +53,10 @@
 <div class="page">
     <div class="fixed-bar">
         <div class="item-title">
-            <h3>订单监控列表</h3>
+            <h3>问题订单监控</h3>
             <ul class="tab-base">
                 <li><a href="JavaScript:void(0);" class="current"><span>超时订单监控</span></a></li>
+                <li><a href="index.php?act=ordersendlist&op=neterr_order"><span>网络错误订单监控</span></a></li>
             </ul>
         </div>
     </div>