浏览代码

admin update

ayHaru 4 年之前
父节点
当前提交
f08687c9f0

+ 180 - 6
admin/control/merchant.php

@@ -169,7 +169,7 @@ class merchantControl extends SystemControl
         Tpl::showpage('merchant.edit');
     }
 
-    private function credit_save_money($money , $operatetype , $member_id)
+    private function credit_save_money($money , $operatetype , $member_id , $bz = '')
     {
         $obj_member = Model('member');
         $member_id = intval($member_id);
@@ -178,11 +178,11 @@ class merchantControl extends SystemControl
         switch ($operatetype) {
             case 1:
                 $admin_act = "sys_add_money";
-                $log_msg = "管理员【" . $admininfo['admin_name'] . "】操作会员【" . $member_info['member_name'] . "】授信额度,预存款【增加】,金额为" . $money ;
+                $log_msg = "管理员【" . $admininfo['admin_name'] . "】操作会员【" . $member_info['member_name'] . "】,预存款【增加】,金额为" . $money ;
                 break;
             case 2:
                 $admin_act = "sys_del_money";
-                $log_msg = "管理员【" . $admininfo['admin_name'] . "】操作会员【" . $member_info['member_name'] . "】授信额度,预存款【减少】,金额为" . $money;
+                $log_msg = "管理员【" . $admininfo['admin_name'] . "】操作会员【" . $member_info['member_name'] . "】,预存款【减少】,金额为" . $money;
                 break;
             default:
                 return [false , '调节类型错误'];
@@ -197,7 +197,7 @@ class merchantControl extends SystemControl
         $data['order_sn'] = '';
         $data['admin_name'] = $admininfo['name'];
         $data['pdr_sn'] = '';
-        $data['lg_desc'] = '管理员操作客户授信,更改会员余额。';
+        $data['lg_desc'] = $bz ? $bz : '管理员操作客户授信,更改会员余额。';
         $model_pd->changePd($admin_act, $data);
 
         $this->log($log_msg, 1);
@@ -581,6 +581,93 @@ class merchantControl extends SystemControl
         }
     }
 
+    public function recharge_manualOp()
+    {
+        if (chksubmit()) {
+            $obj_validate = new Validator();
+            $obj_validate->validateparam = [
+                ["input" => $_POST["mch_id"], "require" => "true", "message" => '机构号不能为空'],
+                ["input" => $_POST["bank_username"], "require" => "true", "message" => '开户人姓名不能为空'],
+                ["input" => $_POST["bank_name"], "require" => "true", "message" => '开户银行不能为空'],
+                ["input" => $_POST["pointsnum"], "require" => "true", "message" => '预存金额不能为空']
+            ];
+            $error = $obj_validate->validate();
+            if ($error != '') {
+                showMessage($error);
+            }
+            $mchid = $_POST["mch_id"];
+            $model_merchant = Model('merchant');
+            $merchant_info = $model_merchant->getMerchantInfo(['mchid' => $mchid]);
+            if(!$merchant_info) {
+                showMessage('对应机构不存在');
+            }
+            $pointsnum = $_POST['pointsnum'];
+            $money = abs($pointsnum);
+            if($money == 0) {
+                showMessage('预存金额错误');
+            }
+
+            try {
+                $model_merchant = Model('merchant');
+                $trans = new trans_wapper($model_merchant, __METHOD__);
+                $member_id = $merchant_info['admin_id'];
+                if($pointsnum > 0) {
+                    $bz = '管理员操作手动预存金额增加';
+                    $this->credit_save_money($money , 1 , $member_id , $bz);
+                }elseif ($pointsnum < 0) {
+                    $bz = '管理员操作手动预存金额减少';
+                    $this->credit_save_money($money , 2 , $member_id , $bz);
+                }else{
+                    showMessage('预存金额错误');
+                }
+                $result = $this->ct_refill_evidence($_POST,$merchant_info);
+                if(!$result) {
+                    $trans->rollback();
+                    showMessage('操作失败', 'index.php?act=merchant&op=merchant');
+                }
+                $trans->commit();
+                if ($merchant_info['alarm_amount'] < $merchant_info['available_predeposit'])
+                {
+                    //更新预警短信通知限制
+                    $mch_cache = rcache("merchant-notify" , 'refill-');
+                    $caches = empty($mch_cache['data']) ? [] : unserialize($mch_cache['data']);
+                    $caches[$mchid] = ['last_time' => 0, 'send_count' => 0];
+                    wcache("merchant-notify", ['data' => serialize($caches)], 'refill-');
+                }
+                showMessage('操作成功', 'index.php?act=merchant&op=refill_evidence');
+            } catch (Exception $e) {
+                $trans->rollback();
+                showMessage('操作失败', 'index.php?act=merchant&op=refill_evidence');
+            }
+        } else {
+
+            Tpl::showpage('recharge.manual.add');
+        }
+    }
+
+    private function ct_refill_evidence($params,$merchant_info)
+    {
+        $admininfo = $this->getAdminInfo();
+        $mem_info = Model('member')->getMemberInfo(['member_id' => $merchant_info['admin_id']]);
+        $input['mchid'] = $merchant_info['mchid'];
+        $input['mch_name'] = $merchant_info['name'];
+        $input['member_id'] = $merchant_info['admin_id'];
+        $input['amount'] = $params['pointsnum'];
+        $input['bank_username'] = $params['bank_username'];
+        $input['bank_name'] = $params['bank_name'];
+        $input['bz'] = $params['pointsdesc'];
+        $input['voucher_name'] = '/';
+        $input['status'] = 2;
+        $input['is_operation'] = 2;
+        $input['add_time'] = $input['check_time'] = time();
+        $input['after_available'] = ncPriceFormat($mem_info['available_predeposit'] + $params['pointsnum']);
+        $input['admin_name'] = $admininfo['name'];
+        $input['admin_id'] = $admininfo['id'];
+
+        $model_merchant = Model('merchant');
+        return $model_merchant->addRefillEvidence($input);
+    }
+
     public function add_money()
     {
         $obj_validate = new Validator();
@@ -1223,7 +1310,7 @@ class merchantControl extends SystemControl
     private function refill_stat($condition)
     {
         $model_refill_order = Model('refill_order');
-        $i = $half_count = $hour_count = 0;
+        $i = $half_count = $hour_count = $exceed_three = $exceed_five = 0;
         while (true)
         {
             $start = $i * 100000;
@@ -1240,6 +1327,12 @@ class merchantControl extends SystemControl
                 {
                     $order['diff_time'] = time() - $order['order_time'];
                     if($order['order_state'] == ORDER_STATE_SEND) {
+                        if($order['diff_time'] > 180 && $order['diff_time'] < 500) {
+                            $exceed_three++;
+                        }
+                        if($order['diff_time'] > 500) {
+                            $exceed_five++;
+                        }
                         if($order['diff_time'] > 1800 && $order['diff_time'] < 3600) {
                             $half_count++;
                         }
@@ -1254,6 +1347,87 @@ class merchantControl extends SystemControl
                 break;
             }
         }
-        return ['half_count' => $half_count , 'hour_count' => $hour_count];
+        return ['half_count' => $half_count , 'hour_count' => $hour_count , 'exceed_three' => $exceed_three , 'exceed_five' => $exceed_five];
+    }
+
+
+    public function OrderSendListOp()
+    {
+        $model_refill_order = Model('refill_order');
+        $condition['refill_order.inner_status'] = 0;
+        $condition['refill_order.order_time'] = ['time', [strtotime(date("Y-m-d")), strtotime(date("Y-m-d"))]];
+        $condition['vr_order.order_state'] = ORDER_STATE_SEND;
+        if (!empty($_GET['order_sn'])) {
+            $condition['refill_order.order_sn'] = $_GET['order_sn'];
+        }
+        if (!empty($_GET['mch_order'])) {
+            $condition['refill_order.mch_order'] = $_GET['mch_order'];
+        }
+        if (!empty($_GET['mchid'])) {
+            $condition['refill_order.mchid'] = $_GET['mchid'];
+        }
+        if (!empty($_GET['channel_name'])) {
+            $condition['refill_order.channel_name'] = $_GET['channel_name'];
+        }
+        if (!empty($_GET['store_id'])) {
+            $condition['vr_order.store_id'] = $_GET['store_id'];
+        }
+        if (!empty($_GET['card_type'])) {
+            if(in_array($_GET['card_type'] , ['1' , '2' , '4' , '5' , '6'])) {
+                $condition['refill_order.card_type'] = $_GET['card_type'];
+            }
+            if($_GET['card_type'] == 'oil') {
+                $condition['refill_order.card_type'] = ['in' , ['1' , '2']];
+            }
+            if($_GET['card_type'] == 'phone') {
+                $condition['refill_order.card_type'] = ['in' , ['4' , '5' , '6']];
+            }
+        }
+        if (!empty($_GET['ch_trade_no'])) {
+            $condition['refill_order.ch_trade_no'] = $_GET['ch_trade_no'];
+        }
+        if (!empty($_GET['card_no'])) {
+            $condition['refill_order.card_no'] = $_GET['card_no'];
+        }
+        if (in_array($_GET['refill_amount'], ['10', '20', '30', '50' , '100', '200', '300', '500' , '1000', '20000'])) {
+            $condition['refill_order.refill_amount'] = $_GET['refill_amount'];
+        }
+        $start_unixtime = strtotime($_GET['query_start_time']);
+        $end_unixtime = strtotime($_GET['query_end_time']);
+
+        if ($start_unixtime >0 && $end_unixtime >0) {
+            $condition['refill_order.order_time'] = ['time', [$start_unixtime, $end_unixtime]];
+        }
+        if($_GET['time'] == 1){
+            $condition['refill_order.order_time'] = ['between', [(time() - 600) , (time() - 180)]];
+        }
+        if($_GET['time'] == 2){
+            $condition['refill_order.order_time'] = ['lt', (time() - 600)];
+        }
+        $merchant_list = Model('')->table('merchant')->limit(1000)->select();
+        foreach ($merchant_list as $key =>$value) {
+            $merchants[$value['mchid']] = $value;
+        }
+
+        $order_list = $model_refill_order->getMerchantOrderList($condition, 50, 'refill_order.*,vr_order.order_state', 'refill_order.order_time desc');
+
+        $stat = Model('')->table('refill_order,vr_order')->join('inner')
+            ->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)->select();
+        $count = $this->refill_stat($condition);
+        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'];
+        }
+        $provider_list = Model('')->table('refill_provider')->limit(100)->select();
+        Tpl::output('stat', $stat[0]);
+        Tpl::output('count', $count);
+        Tpl::output('order_list', $order_list);
+        Tpl::output('provider_list', $provider_list);
+        Tpl::output('show_page', $model_refill_order->showpage());
+        Tpl::showpage('refill.order.send.index');
     }
 }

+ 3 - 2
admin/include/menu.php

@@ -91,12 +91,13 @@ $arr = array(
 			),
 			3 => array(
 				'nav' => 'merchant',
-				'text' => $lang['nc_merchant'],
+				'text' => '充值',
 				'list' => array(
 					array('args'=>'merchant,merchant,merchant',				'text'=>'机构管理'),
 					array('args'=>'refill_evidence,merchant,merchant',		'text'=>'充值申请'),
 					array('args'=>'refill_order,merchant,merchant',			'text'=>'订单列表'),
-					array('args'=>'provider,merchant,merchant',			'text'=>'通道列表')
+					array('args'=>'provider,merchant,merchant',				'text'=>'通道列表'),
+					array('args'=>'OrderSendList,merchant,merchant',		'text'=>'超时订单监控')
 				)
 			),
 			4 => array(

+ 5 - 1
admin/templates/default/merchant.refill.evidence_list.php

@@ -6,7 +6,7 @@
             <h3>充值申请</h3>
             <ul class="tab-base">
                 <li><a href="JavaScript:void(0);" class="current" class="current"><span>充值申请</span></a></li>
-                <li><a href="index.php?act=merchant&op=recharge"><span>预存</span></a></li>
+                <li><a href="index.php?act=merchant&op=recharge_manual"><span>手动预存</span></a></li>
             </ul>
         </div>
     </div>
@@ -68,6 +68,7 @@
                 <th class="align-center">预存状态</th>
                 <th class="align-center">申请日期</th>
                 <th class="align-center">审核日期</th>
+                <th class="align-center">审核管理员</th>
                 <th class="align-center"><?php echo $lang['operation']; ?></th>
             </tr>
             </thead>
@@ -114,9 +115,12 @@
                         </td>
                         <td class="nowarp align-center"><?php echo $v['add_time'] ? date('Y-m-d H:i', $v['add_time']) : $lang['no_limit']; ?></td>
                         <td class="nowarp align-center"><?php echo $v['check_time'] ? date('Y-m-d H:i', $v['check_time']) : $lang['no_limit']; ?></td>
+                        <td class="nowarp align-center"><?php echo $v['admin_name']?></td>
                         <td class="align-center w200">
+                            <?php if($v['voucher_name'] != '/') {?>
                             <a target="_blank"
                                href="<?php echo UPLOAD_SITE_URL . '/' . ATTACH_UPFILE . DS . $v['voucher_name']; ?>">预览</a>
+                            <?php }?>
                             <?php
                             if ($v['status'] == 1) {
                                 ?>

+ 7 - 7
admin/templates/default/provider.amount.control.php

@@ -125,19 +125,19 @@
             </tr>
             <tr class="noborder">
 
-                <table class="spec_table tb-type2" style="width: 1200px;">
+                <table class="spec_table tb-type2" style="width: 100%;">
                     <tbody style="position: fixed;top:138px;background-color: #fff;z-index:999;width: 100%;">
 
                         <tr class="w550">
-                            <th style="text-align: center;width: 120px;padding-right:0"></th>
+                            <th style="text-align: center;width: 120px;min-width:120px;padding-right:0"></th>
                             <?php foreach ($output['providers'] as $provider) { ?>
-                            <th style="text-align: center;width: 230px;padding-right:0"><?php echo $provider['name']?></th>
+                            <th style="text-align: center;width: 230px;min-width:230px;padding-right:0"><?php echo $provider['name']?></th>
                             <?php }?>
                         </tr>
                         <tr class="w500" style="disp;ay:block;padding-bottom:10px;">
-                            <td style="text-align: center;width: 120px;"></td>
+                            <td style="text-align: center;width: 120px;min-width:120px;"></td>
                             <?php foreach ($output['providers'] as $provider) { ?>
-                            <td style="text-align: center;width: 220px;" class="batch-td">
+                            <td style="text-align: center;width: 230px;min-width:230px;padding-right: 10px;" class="batch-td">
                                 <div style="width: 70px;display:inline-block">
                                     单量
                                 </div>
@@ -157,7 +157,7 @@
                         <?php foreach ($output['form']['amountData'] as $key => $amount) { ?>
                         <tr class="w500">
 
-                            <td style="text-align: center;width: 120px;">
+                            <td style="text-align: center;width: 120px;min-width:120px;">
                                 <?php echo $amount['text']?>
                             </td>
 
@@ -168,7 +168,7 @@
                                 <input type="hidden" name="amount[]" value="<?php echo $amount['amount'];?>">
                                 <input type="hidden" name="has[]" value="<?php echo $output['datas'][$provider['provider_id']][$key]['has'];?>">
 
-                            <td style="text-align: center;width: 230px;padding-right: 10px;" class="batch-td">
+                            <td style="text-align: center;width: 230px;min-width:230px;padding-right: 10px;" class="batch-td">
                                 <div style="width: 70px;display:inline-block">
                                     <input type="text" class="input-one styleOne" name="speed[]"
                                            value="<?php echo $output['datas'][$provider['provider_id']][$key]['speed']?>"

+ 1 - 1
admin/templates/default/recharge.add.php

@@ -6,7 +6,7 @@
       <h3>预存款</h3>
       <ul class="tab-base">
           <li><a href="index.php?act=merchant&op=refill_evidence"><span>充值申请</span></a></li>
-        <li><a href="index.php?act=merchant&op=recharge"  class="current"><span>预存</span></a></li>
+        <li><a href="index.php?act=merchant&op=recharge_manual"><span>手动预存</span></a></li>
       </ul>
     </div>
   </div>

+ 89 - 0
admin/templates/default/recharge.manual.add.php

@@ -0,0 +1,89 @@
+<?php defined('InShopNC') or exit('Access Invalid!');?>
+<!--//zmr>v20-->
+<div class="page">
+  <div class="fixed-bar">
+    <div class="item-title">
+      <h3>预存款</h3>
+      <ul class="tab-base">
+          <li><a href="index.php?act=merchant&op=refill_evidence"><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 id="points_form" method="post" name="form1">
+    <input type="hidden" name="form_submit" value="ok" />
+   
+    <table class="table tb-type2 nobdb">
+      <tbody>
+        <tr class="noborder">
+          <td colspan="2" class="required"><label class="validation">机构编号:</label></td>
+        </tr>
+        <tr class="noborder">
+          <td class="vatop rowform">
+            <input type="text" name="mch_id" id="mch_id" class="txt" value="">
+<!--            <input type="text" name="apply_id" id="apply_id" class="txt" value="--><?php //echo $output['apply_id'];?><!--" onchange="javascript:checkevidence();">-->
+          <td class="vatop tips"></td>
+        </tr>
+        <tr class="noborder">
+            <td colspan="2" class="required"><label class="validation">开户人姓名:</label></td>
+        </tr>
+        <tr class="noborder">
+            <td class="vatop rowform">
+                <input type="text" name="bank_username" id="bank_username" class="txt" value="">
+            <td class="vatop tips"></td>
+        </tr>
+        <tr class="noborder">
+            <td colspan="2" class="required"><label class="validation">银行名称:</label></td>
+        </tr>
+        <tr class="noborder">
+            <td class="vatop rowform">
+                <input type="text" name="bank_name" id="bank_name" class="txt" value="">
+            <td class="vatop tips"></td>
+        </tr>
+        <tr>
+          <td colspan="2" class="required"><label class="validation">金额:</label></td>
+        </tr>
+        <tr class="noborder">
+          <td class="vatop rowform"><input type="text" id="pointsnum" name="pointsnum" class="txt" ></td>
+          <td class="vatop tips"></td>
+        </tr>
+        <tr>
+          <td colspan="2" class="required"><label>描述信息:</label></td>
+        </tr>
+        <tr class="noborder">
+          <td class="vatop rowform"><textarea name="pointsdesc" rows="6" class="tarea">手动直接预存</textarea></td>
+          <td class="vatop tips">描述信息将显示在预存款明细相关页,充值申请页,会员和管理员都可见</td>
+        </tr>
+      </tbody>
+      <tfoot>
+        <tr class="tfoot">
+          <td colspan="2" ><a href="JavaScript:void(0);" class="btn" onclick="document.form1.submit()"><span><?php echo $lang['nc_submit'];?></span></a></td>
+        </tr>
+      </tfoot>
+    </table>
+  </form>
+</div>
+<script type="text/javascript">
+$(function(){
+	
+    $('#points_form').validate({
+        rules : {
+            apply_id: {
+				required : true
+			},
+            pointsnum   : {
+                required : true,
+            }
+        },
+        messages : {
+            apply_id: {
+				required : '请输入申请编号'
+			},
+            pointsnum  : {
+                required : '请添加预存款'
+            }
+        }
+    });
+});
+</script>

+ 304 - 0
admin/templates/default/refill.order.send.index.php

@@ -0,0 +1,304 @@
+<style>
+    th label { display: inline-block;width: 60px; }
+</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="merchant"/>
+        <input type="hidden" name="op" value="OrderSendList"/>
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <th><label>我方订单号</label></th>
+                <td><input class="txt2" type="text" name="order_sn" value="<?php echo $_GET['order_sn']; ?>"/></td>
+                <th><label>客户订单号</label></th>
+                <td><input class="txt2" type="text" name="mch_order" value="<?php echo $_GET['mch_order']; ?>"/></td>
+                <th><label>供方订单号</label></th>
+                <td><input class="txt2" type="text" name="ch_trade_no" value="<?php echo $_GET['ch_trade_no']; ?>"/></td>
+
+            </tr>
+            <tr>
+                <th><label>客户名称</label></th>
+                <td><input class="txt2" type="text" name="mchid" value="<?php echo $_GET['mchid']; ?>"/></td>
+                <th><label>供方名称</label></th>
+                <td>
+                    <select name="store_id" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <?php foreach($output['provider_list'] as $provider){?>
+                            <option value="<?php echo $provider['store_id']?>"
+                                    <?php if ($_GET['store_id'] == $provider['store_id']){ ?>selected<?php } ?>><?php echo $provider['name']?>
+                            </option>
+                        <?php }?>
+                    </select>
+                </td>
+            </tr>
+            <tr>
+                <th><label>充值卡卡号</label></th>
+                <td><input class="txt2" type="text" name="card_no" value="<?php echo $_GET['card_no']; ?>"/></td>
+            </tr>
+            <tr>
+
+                <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>充值类型</label></th>
+                <td>
+                    <select name="card_type" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="1"
+                                <?php if ($_GET['card_type'] == '1'){ ?>selected<?php } ?>>中石油</option>
+                        <option value="2"
+                                <?php if ($_GET['card_type'] == '2'){ ?>selected<?php } ?>>中石化</option>
+                        <option value="4"
+                                <?php if ($_GET['card_type'] == '4'){ ?>selected<?php } ?>>中国移动</option>
+                        <option value="5"
+                                <?php if ($_GET['card_type'] == '5'){ ?>selected<?php } ?>>中国联通</option>
+                        <option value="6"
+                                <?php if ($_GET['card_type'] == '6'){ ?>selected<?php } ?>>中国电信</option>
+                        <option value="oil"
+                                <?php if ($_GET['card_type'] == 'oil'){ ?>selected<?php } ?>>油费</option>
+                        <option value="phone"
+                                <?php if ($_GET['card_type'] == 'phone'){ ?>selected<?php } ?>>手机费</option>
+                    </select>
+                </td>
+                <th><label>交易面额</label></th>
+                <td>
+                    <select name="refill_amount" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="10"
+                                <?php if ($_GET['refill_amount'] == '10'){ ?>selected<?php } ?>>10</option>
+                        <option value="20"
+                                <?php if ($_GET['refill_amount'] == '20'){ ?>selected<?php } ?>>20</option>
+                        <option value="30"
+                                <?php if ($_GET['refill_amount'] == '30'){ ?>selected<?php } ?>>30</option>
+                        <option value="50"
+                                <?php if ($_GET['refill_amount'] == '50'){ ?>selected<?php } ?>>50</option>
+                        <option value="100"
+                                <?php if ($_GET['refill_amount'] == '100'){ ?>selected<?php } ?>>100</option>
+                        <option value="200"
+                                <?php if ($_GET['refill_amount'] == '200'){ ?>selected<?php } ?>>200</option>
+                        <option value="300"
+                                <?php if ($_GET['refill_amount'] == '300'){ ?>selected<?php } ?>>300</option>
+                        <option value="500"
+                                <?php if ($_GET['refill_amount'] == '500'){ ?>selected<?php } ?>>500</option>
+                        <option value="1000"
+                                <?php if ($_GET['refill_amount'] == '1000'){ ?>selected<?php } ?>>1000</option>
+                        <option value="2000"
+                                <?php if ($_GET['refill_amount'] == '2000'){ ?>selected<?php } ?>>2000</option>
+                    </select>
+                <label>充值耗时</label>
+                    <select name="time" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="1"
+                                <?php if ($_GET['time'] == '1'){ ?>selected<?php } ?>>耗时3分钟</option>
+                        <option value="2"
+                                <?php if ($_GET['time'] == '2'){ ?>selected<?php } ?>>耗时5分钟</option>
+                    </select>
+                </td>
+                <td>
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;
+                    </a>
+                </td>
+            </tr>
+            <tr>
+                <td></td>
+                <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>
+            </tbody>
+        </table>
+    </form>
+      <table class="table tb-type2" id="prompt">
+        <tbody>
+          <tr class="space odd">
+            <th colspan="12"><div class="title"><h5>
+    金额统计</h5><span class="arrow"></span></div></th>
+          </tr>
+          <tr>
+            <td>
+                <ul>
+                    <li>总计充值金额:<?php echo $output['stat']['refill_amounts'] ?? 0?></li>
+                    <li>总计供方扣款金额:<?php echo $output['stat']['channel_amounts'] ?? 0?></li>
+                    <li>总计客户扣款金额:<?php echo $output['stat']['mch_amounts'] ?? 0?></li>
+                    <li>总计利润:<?php echo ncPriceFormat($output['stat']['mch_amounts'] - $output['stat']['channel_amounts'])?></li>
+                    <li>总计订单数量:<?php echo $output['stat']['order_count'] ?? 0?></li>
+                    <li>超过3分钟订单数量:<?php echo $output['count']['exceed_three'] ?? 0?></li>
+                    <li>超过5分钟订单数量:<?php echo $output['count']['exceed_five'] ?? 0?></li>
+                </ul>
+            </td>
+          </tr>
+        </tbody>
+      </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>
+            <th class="align-center"><?php echo $lang['nc_handle']; ?></th>
+        </tr>
+        </thead>
+        <tbody id="tbody">
+        <?php if (count($output['order_list']) > 0) { ?>
+            <?php
+            foreach ($output['order_list'] as $key => $order) { ?>
+                <tr class="hover">
+                    <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'] >= 180 && $order['diff_time'] <= 300) {
+                        ?>
+                                <span style="color: #fd9d0e"><?php echo $order['diff_time_text']?></span>
+                            <?php }elseif($order['diff_time'] > 300) {?>
+                                <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['official_sn']; ?></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>
+                    <td class="w144 align-center">
+                        <a href="index.php?act=merchant&op=notify_merchant&order_id=<?php echo $order['order_id']; ?>">
+                                回调</a>
+                        |
+                        <a href="index.php?act=merchant&op=notify_manual_merchant&type=cancel&order_id=<?php echo $order['order_id']; ?>">
+                            手动失败</a>
+                        |
+                        <a href="index.php?act=merchant&op=notify_manual_merchant&type=success&order_id=<?php echo $order['order_id']; ?>">
+                            手动成功</a>
+                    </td>
+
+                </tr>
+            <?php } ?>
+        <?php } else { ?>
+            <tr class="no_data">
+                <td colspan="17"><?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>
+<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 () {
+        $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
+        $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
+        $('#ncsubmit').click(function () {
+            $('input[name="op"]').val('refill_order');
+            $('#formSearch').submit();
+        });
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+        let isWring = '<?php echo $output['count']['exceed_five'];?>';
+        console.log('isWring', Number(isWring));
+        var setTimer = '';
+        if (Number(isWring) > 0) {
+            clearInterval(setTimer)
+            setTimer = setInterval(function() {
+                $("#auto")[0].play();
+                window.location.reload();
+                console.log(22);
+            }, 5000);
+        }
+    });
+    function hCopyChannel(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let res = $(this).find('td').eq(14).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> 

二进制
data/resource/warning.mp3


+ 11 - 11
test/TestRefill.php

@@ -195,18 +195,18 @@ class TestRefill extends TestCase
 
     public function testWuchenPhone()
     {
-//        $providers = new refill\wuchen\RefillPhone([]);
-//        $resp = $providers->add('18500608333', 5, 30, ['order_sn' => $this->make_sn()]);
+        $providers = new refill\wuchen\RefillPhone([]);
+        $resp = $providers->add('13699279618', 5, 30, ['order_sn' => $this->make_sn()]);
 //        $resp = $providers->query(['order_sn' => '43101615277293035501']);
-        $input['app_id'] = '70016';
-        $input['message'] = 'fail';
-        $input['order_sn'] = '43101615277293035501';
-        $input['platform_order_id'] = '';
-        $input['sign'] = '5ea59f8ac51a518f2c622824d7db2a04';
-        $input['state'] = "fail";
-        $input['sys_sn'] = '202103091608231836913889';
-        $input['timestamp'] = '1615277361';
-        refill\RefillFactory::instance()->notify('wuchen',$input);
+//        $input['app_id'] = '70016';
+//        $input['message'] = 'fail';
+//        $input['order_sn'] = '43101615277293035501';
+//        $input['platform_order_id'] = '';
+//        $input['sign'] = '5ea59f8ac51a518f2c622824d7db2a04';
+//        $input['state'] = "fail";
+//        $input['sys_sn'] = '202103091608231836913889';
+//        $input['timestamp'] = '1615277361';
+//        refill\RefillFactory::instance()->notify('wuchen',$input);
     }
 
     public function testWeisPhone()