stanley-king пре 3 година
родитељ
комит
bc4c6bdd8d

+ 3 - 2
admin/control/merchant.php

@@ -142,6 +142,7 @@ class merchantControl extends SystemControl
             $update['credit_bonus'] = ncPriceFormat($_POST['credit_bonus']);
             $update['time_out'] = intval($_POST['time_out']);
             $update['quality'] = intval($_POST['quality']);
+            $update['oil_quality'] = intval($_POST['oil_quality']);
             $member_id = $merchant['admin_id'];
             try {
                 $model_merchant = Model('merchant');
@@ -246,10 +247,10 @@ class merchantControl extends SystemControl
                     $model_merchant->insertPrices($inserts);
                 }
                 $trans->commit();
-                showMessage('操作成功', 'index.php?act=merchant&op=merchant');
+                showMessage('操作成功');
             } catch (Exception $e) {
                 $trans->rollback();
-                showMessage('操作失败', 'index.php?act=merchant&op=merchant', 'html', 'error');
+                showMessage('操作失败');
             }
         }
         $mchid = $_GET['mchid'] ?? 0;

+ 3 - 1
admin/control/ordersendlist.php

@@ -48,7 +48,7 @@ class ordersendlistControl extends SystemControl
             $time_cond[] = ['lt', (time() - 900)];
         }
         if (!empty($_GET['card_type'])) {
-            if (in_array($_GET['card_type'], ['1', '2', '4', '5', '6'])) {
+            if (in_array($_GET['card_type'], ['1', '2', '4', '5', '6', '7'])) {
                 $condition['refill_order.card_type'] = $_GET['card_type'];
             }
             if ($_GET['card_type'] == 'oil') {
@@ -109,6 +109,8 @@ class ordersendlistControl extends SystemControl
             return '中国联通';
         } elseif ($card_type == 6) { //中国电信
             return '中国电信';
+        } elseif ($card_type == 7) { //中国电信
+            return '增值业务';
         } else {
             return 'unknown';
         }

+ 44 - 2
admin/control/orderstats.php

@@ -37,18 +37,20 @@ class orderstatsControl extends SystemControl
             $merchant_list = Model('')->table('merchant')->limit(1000)->select();
             Tpl::output('merchant_list', $merchant_list);
         }
-        $success_count_total = $success_refill_amounts_total = $success_mch_amounts_toatl = $success_channel_amounts_total = 0;
+        $success_count_total = $success_refill_amounts_total = $success_mch_amounts_toatl = $success_channel_amounts_total = $profit_amounts_total = 0;
         foreach ($stats_list as $stats) {
             $success_count_total += $stats['success_count'];
             $success_refill_amounts_total += $stats['success_refill_amounts'];
             $success_mch_amounts_toatl += $stats['success_mch_amounts'];
             $success_channel_amounts_total += $stats['success_channel_amounts'];
+            $profit_amounts_total += $stats['profit_amounts'];
         }
         $total_stats = [
             'success_count_total' => $success_count_total,
             'success_refill_amounts_total' => $success_refill_amounts_total,
             'success_mch_amounts_toatl' => $success_mch_amounts_toatl,
-            'success_channel_amounts_total' => $success_channel_amounts_total
+            'success_channel_amounts_total' => $success_channel_amounts_total,
+            'profit_amounts_total' => $profit_amounts_total
         ];
         $check_text = ['未编辑', '匹配', '不匹配'];
         Tpl::output('total_stats', $total_stats);
@@ -57,4 +59,44 @@ class orderstatsControl extends SystemControl
         Tpl::output('show_page', $model_refill_order->showpage());
         Tpl::showpage($page);
     }
+
+    public function ExportDataOp()
+    {
+        $type = $_GET['type'] ? $_GET['type'] : 'system';
+        $model_refill_order = Model('refill_order');
+        $condition['type'] = $type;
+        if (!empty($_GET['cid'])) {
+            $condition['cid'] = $_GET['cid'];
+        }
+        $start_unixtime = intval($_GET['query_start_time']);
+        $end_unixtime = intval($_GET['query_end_time']);
+        if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
+            $condition['time_stamp'] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
+        } elseif ($start_unixtime > 0) {
+            $condition['time_stamp'] = ['egt', $start_unixtime];
+        } elseif ($end_unixtime > 0) {
+            $condition['time_stamp'] = ['lt', $end_unixtime];
+        }
+        $stats_list = $model_refill_order->getOrderStatsList($condition);
+
+        $success_count_total = $success_refill_amounts_total = $success_mch_amounts_toatl = $success_channel_amounts_total = $profit_amounts_total = 0;
+        foreach ($stats_list as $stats) {
+            $success_count_total += $stats['success_count'];
+            $success_refill_amounts_total += $stats['success_refill_amounts'];
+            $success_mch_amounts_toatl += $stats['success_mch_amounts'];
+            $success_channel_amounts_total += $stats['success_channel_amounts'];
+            $profit_amounts_total += $stats['profit_amounts'];
+        }
+        $total_stats = [
+            'success_count_total' => ncPriceFormat($success_count_total),
+            'success_refill_amounts_total' => ncPriceFormat($success_refill_amounts_total),
+            'success_mch_amounts_toatl' => ncPriceFormat($success_mch_amounts_toatl),
+            'success_channel_amounts_total' => ncPriceFormat($success_channel_amounts_total),
+            'profit_amounts_total' => ncPriceFormat($profit_amounts_total)
+        ];
+        $result['data'] = $stats_list;
+        $result['total_stats'] = $total_stats;
+        echo(json_encode($result));
+        exit;
+    }
 }

+ 1 - 1
admin/control/refill_order.php

@@ -53,7 +53,7 @@ class refill_orderControl extends SystemControl
         }
 
         if (!empty($_GET['card_type'])) {
-            if (in_array($_GET['card_type'], ['1', '2', '4', '5', '6'])) {
+            if (in_array($_GET['card_type'], ['1', '2', '4', '5', '6', '7'])) {
                 $condition['refill_order.card_type'] = intval($_GET['card_type']);
             }
             if ($_GET['card_type'] == 'oil') {

+ 4 - 2
admin/control/refill_successful.php

@@ -9,7 +9,7 @@ class refill_successfulControl extends SystemControl
         parent::__construct();
     }
 
-    public function provider_successfulOp()
+    public function indexOp()
     {
         $days = $this->successful_where();
         Tpl::output('days', $days);
@@ -66,7 +66,7 @@ class refill_successfulControl extends SystemControl
         ksort($card_typeData);
         $result['card_type'] = $card_typeData;
 
-        $quality_txt = [1=>'普充', 2=>'快充', 3=>'卡密', 4=>'三方', 5=>'慢充'];
+        $quality_txt = [1=>'普充', 2=>'快充', 3=>'卡密', 4=>'三方', 5=>'慢充二十四小时', 6=>'慢充六小时', 7=>'慢充两小时'];
         foreach (array_unique($qualitys) as $quality) {
             $qualityData[$quality] = $quality_txt[$quality];
         }
@@ -88,6 +88,8 @@ class refill_successfulControl extends SystemControl
             return '中国联通';
         } elseif ($card_type == 6) { //中国电信
             return '中国电信';
+        } elseif ($card_type == 7) { //中国电信
+            return '增值业务';
         } else {
             return 'unknown';
         }

+ 1 - 1
admin/include/menu.php

@@ -102,7 +102,7 @@ $arr = array(
 					array('args'=>'index,orderstats,merchant',				'text'=>'对账管理'),
 					array('args'=>'stats,card_key,merchant',				'text'=>'卡密管理'),
 					array('args'=>'index,refill_stock,merchant',			'text'=>'库存管理'),
-					array('args'=>'provider_successful,refill_successful,merchant',	'text'=>'成功率监控'),
+					array('args'=>'index,refill_successful,merchant',		'text'=>'成功率监控'),
 				)
 			),
 			4 => array(

+ 10 - 1
admin/templates/default/merchant.edit.php

@@ -59,7 +59,16 @@
                 <td class="vatop tips"></td>
             </tr>
             <tr>
-                <td colspan="2" class="required"><label class="validation" for="quality">通道质量:</label></td>
+                <td colspan="2" class="required"><label class="validation" for="oil_quality">油卡通道质量:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop">
+                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 1){ echo 'checked';}?> value="1" type="radio">普通
+                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 5){ echo 'checked';}?> value="5" type="radio">慢充
+                </td>
+            </tr>
+            <tr>
+                <td colspan="2" class="required"><label class="validation" for="quality">话费通道质量:</label></td>
             </tr>
             <tr class="noborder">
                 <td class="vatop">

+ 137 - 14
admin/templates/default/merchant.order.stats.php

@@ -7,9 +7,9 @@
             <ul class="tab-base">
                 <li><a href="index.php?act=merchant&op=provider_evidence"><span>上游充值申请记录</span></a></li>
                 <li><a href="index.php?act=merchant&op=provider_evidence_add"><span>新增上游充值申请</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=index&type=system"><span>商户对账记录</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>通道对账记录</span></a></li>
-                <li><a href="JavaScript:void(0);" class="current"><span>商户对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>下游对账记录</span></a></li>
             </ul>
         </div>
     </div>
@@ -46,6 +46,11 @@
                         <a href="index.php?act=OrderStats&op=index" class="btns "
                            title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
                     <?php } ?></td>
+                <td>
+                    <a href="javascript:void(0);" id="ncexport" class="btn">
+                        <span>导出</span>
+                    </a>
+                </td>
             </tr>
             </tbody>
         </table>
@@ -62,8 +67,8 @@
                 <ul>
                     <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['success_count_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['success_refill_amounts_total'] ?? 0?></li>
-                    <li class="lineLi" style="color:#000;">总计机构扣款金额:<?php echo $output['total_stats']['success_mch_amounts_toatl'] ?? 0?></li>
-                    <li class="lineLi" style="color:#000;">总计通道扣款金额:<?php echo $output['total_stats']['success_channel_amounts_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计下游扣款金额:<?php echo $output['total_stats']['success_mch_amounts_toatl'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计上游扣款金额:<?php echo $output['total_stats']['success_channel_amounts_total'] ?? 0?></li>
                 </ul>
             </td>
         </tr>
@@ -77,18 +82,18 @@
                 <th>统计日期</th>
                 <th>主体名称</th>
                 <th>主体ID</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">上游金额</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">成功订单金额误差</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['operation']; ?></th>
@@ -103,8 +108,8 @@
                         <td><?php echo $v['cid']; ?></td>
                         <td class="align-center"><?php echo $v['success_count']; ?></td>
                         <td class="align-center"><?php echo $v['success_refill_amounts']; ?></td>
-                        <td class="align-center"><?php echo $v['success_channel_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['success_mch_amounts']; ?></td>
+                        <td class="align-center"><?php echo $v['success_channel_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['profit_amounts']; ?></td>
                         <td class="align-center"><?php echo $v['order_count']; ?></td>
                         <td class="align-center"><?php echo $v['cancel_count']; ?></td>
@@ -171,5 +176,123 @@
                 $(this)[0].style.backgroundColor = '#fff'
             })
         })
+        function JSONToExcelConvertor(JSONData, FileName, ShowLabel, headData) { 
+            //先转化json 
+            var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData; 
+                
+            var excel = '<table>';   
+                
+            // 标题
+            for (const key in headData) {
+                var head = "<tr>";
+                var td = "<td colspan='12' style='font-size:16px;'>"+ headData[key] + '</td>';
+                excel += td + "</tr>";
+            }
+
+            //设置表头 
+            var row = "<tr>"; 
+            for (var i = 0, l = ShowLabel.length; i < l; i++) { 
+                row += "<th style='font-size:14px;'>" + ShowLabel[i].value + '</th>'; 
+            } 
+                
+                
+            //换行 
+            excel += row + "</tr>"; 
+                
+            //设置数据 
+            for (var i = 0; i < arrData.length; i++) { 
+                var row = "<tr>"; 
+                let code = i+1
+                row += "<td>" +code+ "</td>"
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].time_text + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cname + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cid + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_refill_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_mch_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_channel_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].profit_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].order_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cancel_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_ratio + '</td>';
+                excel += row + "</tr>"; 
+            } 
+            excel += "</table>"; 
+            var excelFile = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>"; 
+            excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">'; 
+            excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel'; 
+            excelFile += '; charset=UTF-8">'; 
+            excelFile += "<head>"; 
+            excelFile += "<!--[if gte mso 9]>"; 
+            excelFile += "<xml>"; 
+            excelFile += "<x:ExcelWorkbook>"; 
+            excelFile += "<x:ExcelWorksheets>"; 
+            excelFile += "<x:ExcelWorksheet>"; 
+            excelFile += "<x:Name>"; 
+            excelFile += "{worksheet}"; 
+            excelFile += "</x:Name>"; 
+            excelFile += "<x:WorksheetOptions>"; 
+            excelFile += "<x:DisplayGridlines/>"; 
+            excelFile += "</x:WorksheetOptions>"; 
+            excelFile += "</x:ExcelWorksheet>"; 
+            excelFile += "</x:ExcelWorksheets>"; 
+            excelFile += "</x:ExcelWorkbook>"; 
+            excelFile += "</xml>"; 
+            excelFile += "<![endif]-->"; 
+            excelFile += "</head>"; 
+            excelFile += "<body>"; 
+            excelFile += excel; 
+            excelFile += "</body>"; 
+            excelFile += "</html>"; 
+
+                
+            var uri = 'data:application/vnd.ms-excel;charset=utf-8,' + encodeURIComponent(excelFile); 
+                
+            var link = document.createElement("a");   
+            link.href = uri; 
+                
+            link.style = "visibility:hidden"; 
+            link.download = FileName + ".xls"; 
+                
+            document.body.appendChild(link); 
+            link.click(); 
+            document.body.removeChild(link); 
+        }
+        $('#ncexport').click(function () {
+            let starTime = new Date($('input[name="query_start_time"]').val()).getTime()/1000;
+            let endTime = new Date($('input[name="query_end_time"]').val()).getTime()/1000;
+            let cid = $('select').val()
+            let text = $('select option:selected').text()
+            $.get('index.php?act=orderstats&op=ExportData&type=merchant', {
+                query_start_time: starTime,
+                query_end_time: endTime,
+                cid: cid
+            }, function (data) {
+                data = JSON.parse(data)
+                if (data && data.data) {
+                    let head = ['北京椰子电子商务有限责任公司']
+                    let time = ''
+                    if (starTime && endTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()+' - '+$('input[name="query_end_time"]').val()
+                    } else if (starTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()
+                    }
+                    if (text && cid) {
+                        time += '   下游名称:'+text
+                    }
+                    if (time) {
+                        head.push(time)
+                    }
+                    head.push('总计成功订单量:' + data.total_stats.success_count_total)
+                    head.push('总计成功订单金额:' + data.total_stats.success_refill_amounts_total)
+                    head.push('总计下游扣款金额:' + data.total_stats.success_mch_amounts_toatl)
+                    head.push('总计上游扣款金额:' + data.total_stats.success_channel_amounts_total)
+                    head.push('总计利润金额:' + data.total_stats.profit_amounts_total)
+                    let title = [{value: "序号"},{value: "统计日期"},{value: "主体名称"},{value: "主体ID"},{value: "成功订单数"},{value: "成功金额"},{value: "下游金额"},{value: "上游金额"},{value: "利润"},{value: "订单总量"}, {value: "失败订单数量"},{value: "成功占比"}]
+                    JSONToExcelConvertor(data.data, '下游对账记录', title, head)
+                }
+                // console.log('data', data);
+            })
+        })
     });
 </script>

+ 2 - 2
admin/templates/default/merchant.sel.group.php

@@ -16,7 +16,7 @@
         <input type="hidden" name="form_submit" value="ok"/>
         <input type="hidden" name="mchid" value="<?php echo $output['merchant']['mchid'];?>"/>
         <table class="table tb-type2">
-            <tbody style="display:block;width:1000px;">
+            <tbody style="display:block;width:100%;">
             <tr class="noborder">
                 <td colspan="2" class="required"><label class="validation" for="name">机构名称:</label></td>
             </tr>
@@ -29,7 +29,7 @@
             <tr class="noborder" style="display:block;height:auto">
                 <?php if(!empty($output['group_list'])){?>
                 <?php foreach ($output['group_list'] as $group) {?>
-                    <td class="w60 mw60 inblock">
+                    <td class="w130 mw130 inblock">
                         <span>
                             <label>
                                 <?php echo $group['group_name'];?>:

+ 134 - 11
admin/templates/default/provider.order.stats.php

@@ -8,8 +8,8 @@
                 <li><a href="index.php?act=merchant&op=provider_evidence"><span>上游充值申请记录</span></a></li>
                 <li><a href="index.php?act=merchant&op=provider_evidence_add"><span>新增上游充值申请</span></a></li>
                 <li><a href="index.php?act=OrderStats&op=index&type=system"><span>平台对账记录</span></a></li>
-                <li><a href="JavaScript:void(0);" class="current"><span>通道对账记录</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>商户对账记录</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
             </ul>
         </div>
     </div>
@@ -46,6 +46,11 @@
                         <a href="index.php?act=OrderStats&op=index" class="btns "
                            title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
                     <?php } ?></td>
+                <td>
+                    <a href="javascript:void(0);" id="ncexport" class="btn">
+                        <span>导出</span>
+                    </a>
+                </td>
             </tr>
             </tbody>
         </table>
@@ -62,8 +67,8 @@
                 <ul>
                     <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['success_count_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['success_refill_amounts_total'] ?? 0?></li>
-                    <li class="lineLi" style="color:#000;">总计机构扣款金额:<?php echo $output['total_stats']['success_mch_amounts_toatl'] ?? 0?></li>
-                    <li class="lineLi" style="color:#000;">总计通道扣款金额:<?php echo $output['total_stats']['success_channel_amounts_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计下游扣款金额:<?php echo $output['total_stats']['success_mch_amounts_toatl'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计上游扣款金额:<?php echo $output['total_stats']['success_channel_amounts_total'] ?? 0?></li>
                 </ul>
             </td>
         </tr>
@@ -77,18 +82,18 @@
                 <th>统计日期</th>
                 <th>主体名称</th>
                 <th>主体ID</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">下游金额</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">成功订单金额误差</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['operation']; ?></th>
@@ -171,5 +176,123 @@
                 $(this)[0].style.backgroundColor = '#fff'
             })
         })
+        function JSONToExcelConvertor(JSONData, FileName, ShowLabel, headData) { 
+            //先转化json 
+            var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData; 
+                
+            var excel = '<table>';   
+                
+            // 标题
+            for (const key in headData) {
+                var head = "<tr>";
+                var td = "<td colspan='12' style='font-size:16px;'>"+ headData[key] + '</td>';
+                excel += td + "</tr>";
+            }
+
+            //设置表头 
+            var row = "<tr>"; 
+            for (var i = 0, l = ShowLabel.length; i < l; i++) { 
+                row += "<th style='font-size:14px;'>" + ShowLabel[i].value + '</th>'; 
+            } 
+                
+                
+            //换行 
+            excel += row + "</tr>"; 
+                
+            //设置数据 
+            for (var i = 0; i < arrData.length; i++) { 
+                var row = "<tr>"; 
+                let code = i+1
+                row += "<td>" +code+ "</td>"
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].time_text + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cname + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cid + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_refill_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_channel_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_mch_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].profit_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].order_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cancel_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_ratio + '</td>';
+                excel += row + "</tr>"; 
+            } 
+            excel += "</table>"; 
+            var excelFile = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>"; 
+            excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">'; 
+            excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel'; 
+            excelFile += '; charset=UTF-8">'; 
+            excelFile += "<head>"; 
+            excelFile += "<!--[if gte mso 9]>"; 
+            excelFile += "<xml>"; 
+            excelFile += "<x:ExcelWorkbook>"; 
+            excelFile += "<x:ExcelWorksheets>"; 
+            excelFile += "<x:ExcelWorksheet>"; 
+            excelFile += "<x:Name>"; 
+            excelFile += "{worksheet}"; 
+            excelFile += "</x:Name>"; 
+            excelFile += "<x:WorksheetOptions>"; 
+            excelFile += "<x:DisplayGridlines/>"; 
+            excelFile += "</x:WorksheetOptions>"; 
+            excelFile += "</x:ExcelWorksheet>"; 
+            excelFile += "</x:ExcelWorksheets>"; 
+            excelFile += "</x:ExcelWorkbook>"; 
+            excelFile += "</xml>"; 
+            excelFile += "<![endif]-->"; 
+            excelFile += "</head>"; 
+            excelFile += "<body>"; 
+            excelFile += excel; 
+            excelFile += "</body>"; 
+            excelFile += "</html>"; 
+
+                
+            var uri = 'data:application/vnd.ms-excel;charset=utf-8,' + encodeURIComponent(excelFile); 
+                
+            var link = document.createElement("a");   
+            link.href = uri; 
+                
+            link.style = "visibility:hidden"; 
+            link.download = FileName + ".xls"; 
+                
+            document.body.appendChild(link); 
+            link.click(); 
+            document.body.removeChild(link); 
+        }
+        $('#ncexport').click(function () {
+            let starTime = new Date($('input[name="query_start_time"]').val()).getTime()/1000;
+            let endTime = new Date($('input[name="query_end_time"]').val()).getTime()/1000;
+            let cid = $('select').val()
+            let text = $('select option:selected').text()
+            $.get('index.php?act=orderstats&op=ExportData&type=provider', {
+                query_start_time: starTime,
+                query_end_time: endTime,
+                cid: cid
+            }, function (data) {
+                data = JSON.parse(data)
+                if (data && data.data) {
+                    let head = ['北京椰子电子商务有限责任公司']
+                    let time = ''
+                    if (starTime && endTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()+' - '+$('input[name="query_end_time"]').val()
+                    } else if (starTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()
+                    }
+                    if (text && cid) {
+                        time += '         上游名称:'+text
+                    }
+                    if (time) {
+                        head.push(time)
+                    }
+                    head.push('总计成功订单量:' + data.total_stats.success_count_total)
+                    head.push('总计成功订单金额:' + data.total_stats.success_refill_amounts_total)
+                    head.push('总计下游扣款金额:' + data.total_stats.success_mch_amounts_toatl)
+                    head.push('总计上游扣款金额:' + data.total_stats.success_channel_amounts_total)
+                    head.push('总计利润金额:' + data.total_stats.profit_amounts_total)
+                    let title = [{value: "序号"},{value: "统计日期"},{value: "主体名称"},{value: "主体ID"},{value: "成功订单数"},{value: "成功金额"},{value: "上游金额"},{value: "下游金额"},{value: "利润"},{value: "订单总量"}, {value: "失败订单数量"},{value: "成功占比"}]
+                    JSONToExcelConvertor(data.data, '上游对账记录', title, head)
+                }
+                // console.log('data', data);
+            })
+        })
     });
 </script>

+ 11 - 1
admin/templates/default/provider.successful.php

@@ -3,7 +3,8 @@
         <div class="item-title">
             <h3>成功率监控列表</h3>
             <ul class="tab-base">
-                <li><a href="JavaScript:void(0);" class="current" ><span>通道成功率监控</span></a></li>
+                <li><a href="?index.php&act=refill_successful&op=index&type=provider" class="classA" data-type="provider" ><span>通道成功率监控</span></a></li>
+                <li><a href="?index.php&act=refill_successful&op=index&type=system" class="classA" data-type="system" ><span>平台成功率监控</span></a></li>
             </ul>
         </div>
     </div>
@@ -99,6 +100,15 @@
       href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
 <script type="text/javascript">
     $(function () {
+        // 开始获取当前地址
+        let type = '<?php echo $_GET['type'];?>';
+        $(".classA").each(function () {
+            if (type == $(this).attr("data-type")) {
+                $(this).addClass('current')
+                $(this).attr('href','JavaScript:void(0);')
+            }
+        })
+
         $("#Iframe").load(function(){
             $(this).css("min-height", '900px')
             $(this).css("min-width", '1650px')

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

@@ -65,7 +65,7 @@
           <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 rowform"><textarea name="pointsdesc" rows="6" class="tarea"></textarea></td>
           <td class="vatop tips">描述信息将显示在预存款明细相关页,充值申请页,会员和管理员都可见</td>
         </tr>
       </tbody>

+ 1 - 1
admin/templates/default/recharge.manual.edit.php

@@ -44,7 +44,7 @@
           <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 rowform"><textarea name="pointsdesc" rows="6" class="tarea"></textarea></td>
           <td class="vatop tips">描述信息将显示在预存款明细相关页,充值申请页,会员和管理员都可见</td>
         </tr>
       </tbody>

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

@@ -111,6 +111,8 @@
                                 <?php if ($_GET['card_type'] == '5'){ ?>selected<?php } ?>>中国联通</option>
                         <option value="6"
                                 <?php if ($_GET['card_type'] == '6'){ ?>selected<?php } ?>>中国电信</option>
+                        <option value="7"
+                                <?php if ($_GET['card_type'] == '7'){ ?>selected<?php } ?>>增值业务</option>
                         <option value="oil"
                                 <?php if ($_GET['card_type'] == 'oil'){ ?>selected<?php } ?>>油费</option>
                         <option value="phone"
@@ -224,7 +226,7 @@
           <tr>
             <td>
                 <ul>
-                    <?php if($output['admin_info']['id'] == 1){?>
+                    <?php if(COMPANY_NAME === 'LZKJ_COMPANY' || $output['admin_info']['id'] == 1){?>
                     <div>
                         <li class="lineLi">总计订单数量:<?php echo $output['stat']['all']['order_count'] ?? 0?></li>
                         <li class="lineLi">总计充值金额:<?php echo $output['stat']['all']['refill_amounts'] ?? 0?></li>

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

@@ -62,6 +62,8 @@
                                 <?php if ($_GET['card_type'] == '5'){ ?>selected<?php } ?>>中国联通</option>
                         <option value="6"
                                 <?php if ($_GET['card_type'] == '6'){ ?>selected<?php } ?>>中国电信</option>
+                        <option value="7"
+                                <?php if ($_GET['card_type'] == '7'){ ?>selected<?php } ?>>增值业务</option>
                         <option value="oil"
                                 <?php if ($_GET['card_type'] == 'oil'){ ?>selected<?php } ?>>油费</option>
                         <option value="phone"

+ 121 - 4
admin/templates/default/system.order.stats.php

@@ -8,8 +8,8 @@
                 <li><a href="index.php?act=merchant&op=provider_evidence"><span>上游充值申请记录</span></a></li>
                 <li><a href="index.php?act=merchant&op=provider_evidence_add"><span>新增上游充值申请</span></a></li>
                 <li><a href="JavaScript:void(0);" class="current"><span>平台对账记录</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>通道对账记录</span></a></li>
-                <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>商户对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=provider"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=OrderStats&op=index&type=merchant"><span>下游对账记录</span></a></li>
             </ul>
         </div>
     </div>
@@ -33,6 +33,11 @@
                         <a href="index.php?act=OrderStats&op=index" class="btns "
                            title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
                     <?php } ?></td>
+                <td>
+                    <a href="javascript:void(0);" id="ncexport" class="btn">
+                        <span>导出</span>
+                    </a>
+                </td>
             </tr>
             </tbody>
         </table>
@@ -49,8 +54,8 @@
                 <ul>
                     <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['success_count_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['success_refill_amounts_total'] ?? 0?></li>
-                    <li class="lineLi" style="color:#000;">总计机构扣款金额:<?php echo $output['total_stats']['success_mch_amounts_toatl'] ?? 0?></li>
-                    <li class="lineLi" style="color:#000;">总计通道扣款金额:<?php echo $output['total_stats']['success_channel_amounts_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计下游扣款金额:<?php echo $output['total_stats']['success_mch_amounts_toatl'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计上游扣款金额:<?php echo $output['total_stats']['success_channel_amounts_total'] ?? 0?></li>
                 </ul>
             </td>
           </tr>
@@ -139,5 +144,117 @@
                 $(this)[0].style.backgroundColor = '#fff'
             })
         })
+        function JSONToExcelConvertor(JSONData, FileName, ShowLabel, headData) { 
+            //先转化json 
+            var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData; 
+                
+            var excel = '<table>';   
+                
+            // 标题
+            for (const key in headData) {
+                var head = "<tr>";
+                var td = "<td colspan='13' style='font-size:16px;'>"+ headData[key] + '</td>';
+                excel += td + "</tr>";
+            }
+
+            //设置表头 
+            var row = "<tr>"; 
+            for (var i = 0, l = ShowLabel.length; i < l; i++) { 
+                row += "<th style='font-size:14px;'>" + ShowLabel[i].value + '</th>'; 
+            } 
+                
+                
+            //换行 
+            excel += row + "</tr>"; 
+                
+            //设置数据 
+            for (var i = 0; i < arrData.length; i++) { 
+                var row = "<tr>"; 
+                let code = i+1
+                row += "<td>" +code+ "</td>"
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].time_text + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cname + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cid + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_refill_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_mch_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_channel_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].profit_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].service_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].order_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cancel_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_ratio + '</td>';
+                excel += row + "</tr>"; 
+            } 
+            excel += "</table>"; 
+            var excelFile = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>"; 
+            excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">'; 
+            excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel'; 
+            excelFile += '; charset=UTF-8">'; 
+            excelFile += "<head>"; 
+            excelFile += "<!--[if gte mso 9]>"; 
+            excelFile += "<xml>"; 
+            excelFile += "<x:ExcelWorkbook>"; 
+            excelFile += "<x:ExcelWorksheets>"; 
+            excelFile += "<x:ExcelWorksheet>"; 
+            excelFile += "<x:Name>"; 
+            excelFile += "{worksheet}"; 
+            excelFile += "</x:Name>"; 
+            excelFile += "<x:WorksheetOptions>"; 
+            excelFile += "<x:DisplayGridlines/>"; 
+            excelFile += "</x:WorksheetOptions>"; 
+            excelFile += "</x:ExcelWorksheet>"; 
+            excelFile += "</x:ExcelWorksheets>"; 
+            excelFile += "</x:ExcelWorkbook>"; 
+            excelFile += "</xml>"; 
+            excelFile += "<![endif]-->"; 
+            excelFile += "</head>"; 
+            excelFile += "<body>"; 
+            excelFile += excel; 
+            excelFile += "</body>"; 
+            excelFile += "</html>"; 
+
+                
+            var uri = 'data:application/vnd.ms-excel;charset=utf-8,' + encodeURIComponent(excelFile); 
+                
+            var link = document.createElement("a");   
+            link.href = uri; 
+                
+            link.style = "visibility:hidden"; 
+            link.download = FileName + ".xls"; 
+                
+            document.body.appendChild(link); 
+            link.click(); 
+            document.body.removeChild(link); 
+        }
+        $('#ncexport').click(function () {
+            let starTime = new Date($('input[name="query_start_time"]').val()).getTime()/1000;
+            let endTime = new Date($('input[name="query_end_time"]').val()).getTime()/1000;
+            $.get('index.php?act=orderstats&op=ExportData', {
+                query_start_time: starTime,
+                query_end_time: endTime
+            }, function (data) {
+                data = JSON.parse(data)
+                if (data && data.data) {
+                    let head = ['北京椰子电子商务有限责任公司']
+                    let time = ''
+                    if (starTime && endTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()+' - '+$('input[name="query_end_time"]').val()
+                        head.push(time)
+                    } else if (starTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()
+                        head.push(time)
+                    }
+                    head.push('总计成功订单量:' + data.total_stats.success_count_total)
+                    head.push('总计成功订单金额:' + data.total_stats.success_refill_amounts_total)
+                    head.push('总计下游扣款金额:' + data.total_stats.success_mch_amounts_toatl)
+                    head.push('总计上游扣款金额:' + data.total_stats.success_channel_amounts_total)
+                    head.push('总计利润金额:' + data.total_stats.profit_amounts_total)
+                    let title = [{value: "序号"},{value: "统计日期"},{value: "主体名称"},{value: "主体ID"},{value: "成功订单数"},{value: "成功金额"},{value: "下游金额"},{value: "上游金额"},{value: "利润"},{value: "服务费"},{value: "订单总量"}, {value: "失败订单数量"},{value: "成功占比"}]
+                    JSONToExcelConvertor(data.data, '平台对账记录', title, head)
+                }
+                // console.log('data', data);
+            })
+        })
     });
 </script>

+ 6 - 6
data/config/win/refill.ini.php

@@ -125,11 +125,11 @@ $zeheng_oil = ['name' => 'zeheng', 'store_id' => 51,'qualitys' => '1',
 
 $lingzh_oil = ['name' => 'lingzhoil', 'store_id' => 56, 'qualitys' => '1',
     'amount' => [
-        100 => [['goods_id' => 6579, 'price' => 96.9, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
-        200 => [['goods_id' => 6580, 'price' => 193.8, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
-        500 => [['goods_id' => 6581, 'price' => 484.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
-        1000 => [['goods_id' => 6582, 'price' => 969, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
-        2000 => [['goods_id' => 6583, 'price' => 1938, 'quality' => 1, 'card_type' => 'sinopec,petrochina']]
+        100 => [['goods_id' => 6579, 'price' => 96.6, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        200 => [['goods_id' => 6580, 'price' => 193.2, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        500 => [['goods_id' => 6581, 'price' => 483, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        1000 => [['goods_id' => 6582, 'price' => 966, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        2000 => [['goods_id' => 6583, 'price' => 1932, 'quality' => 1, 'card_type' => 'sinopec,petrochina']]
     ],
     'period' => [], 'refill_type' => 'api'];
 
@@ -808,7 +808,7 @@ $phone_providers = [
     ['name' => 'jumikc', 'cfg' => $jumi_phone],
     ['name' => 'qianqian', 'cfg' => $qianqian_phone],
     ['name' => 'fengye', 'cfg' => $fengye_phone],
-//    ['name' => 'yunsuoyao', 'cfg' => $yunsuoyao_phone],
+    ['name' => 'yunsuoyao', 'cfg' => $yunsuoyao_phone],
     ['name' => 'afd', 'cfg' => $afd_phone],
     ['name' => 'qianqianman', 'cfg' => $qianqianman_phone],
 ];

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

@@ -808,7 +808,7 @@ $phone_providers = [
     ['name' => 'jumikc', 'cfg' => $jumi_phone],
     ['name' => 'qianqian', 'cfg' => $qianqian_phone],
     ['name' => 'fengye', 'cfg' => $fengye_phone],
-//    ['name' => 'yunsuoyao', 'cfg' => $yunsuoyao_phone],
+    ['name' => 'yunsuoyao', 'cfg' => $yunsuoyao_phone],
     ['name' => 'afd', 'cfg' => $afd_phone],
     ['name' => 'qianqianman', 'cfg' => $qianqianman_phone],
 ];

+ 1 - 2
helper/refill/api/lingzh/haohao/RefillCallBack.php

@@ -34,7 +34,7 @@ class RefillCallBack implements refill\IRefillCallBack
         return strtoupper(md5($body));
     }
 
-    private function check_empty($value)
+    protected function check_empty($value)
     {
         if (!isset($value))
             return true;
@@ -46,7 +46,6 @@ class RefillCallBack implements refill\IRefillCallBack
         return false;
     }
 
-
     public function notify($params)
     {
         $status = intval($params['directStatus']);

+ 1 - 1
helper/refill/api/xyz/lingzhoil/config.php

@@ -11,5 +11,5 @@ class config
     const USR= 9618;
     const KEY = 'fa0a841bdb424b6e1ac76148e9fdc7a8';
     const API_IP = NET_IP;
-    const NOTIFY_URL =  BASE_SITE_URL."/mobile/refill_lingzhoil.php";
+    const NOTIFY_URL =  BASE_SITE_URL."/mobile/callback/refill_lingzhoil.php";
 }

+ 1 - 1
helper/refill/api/xyz/yunsuoyao/RefillCallBack.php

@@ -32,7 +32,7 @@ class RefillCallBack implements refill\IRefillCallBack
         $order_sn = $params['sporderid'];
         $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
         if (empty($order_info)) {
-//            return [false, false, false,false];
+            return [false, false, false,false];
         }
         $order_id = $order_info['order_id'];
 

+ 2 - 2
helper/refill/api/xyz/yunsuoyao/RefillPhone.php

@@ -52,7 +52,7 @@ class RefillPhone extends refill\IRefillPhone
             if (in_array($resultno, [0,2])) {
                 return [true, $resp['orderid'], false];
             } else {
-                return [false, $resp['message'], false];
+                return [false, $resp['resultno'], false];
             }
         }
     }
@@ -87,7 +87,7 @@ class RefillPhone extends refill\IRefillPhone
                 } elseif (in_array($resultno, [0,2])) {
                     $order_state = ORDER_STATE_SEND;
                 } else {
-                    return [false, $resp['message']];
+                    return [false, $resultno];
                 }
                 return [true, $order_state];
             }

+ 1 - 2
helper/refill/api/xyz/yunsuoyao/config.php

@@ -11,8 +11,7 @@ class config
 
     const USER_ID= '10002501';
     const KEY = 'Q8JpDwe6zBiNhah4SYyRArt6fFRb3nZz';
-//    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yunsuoyao.php";
-    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yunsuoyao.php";
     const operator = [
         mtopcard\ChinaMobileCard  => 'yd',
         mtopcard\ChinaUnicomCard  => 'lt',

+ 2 - 0
mchsrv/control/merchant_order.php

@@ -187,6 +187,8 @@ class merchant_orderControl extends mbMerchantControl
             return '中国联通';
         } elseif ($card_type == mtopcard\ChinaTelecomCard) { //中国电信
             return '中国电信';
+        } elseif ($card_type == mtopcard\ThirdRefillCard) { //中国电信
+            return '增值业务';
         } else {
             return 'unknown';
         }

+ 2 - 0
mobile/control/merchant_order.php

@@ -172,6 +172,8 @@ class merchant_orderControl extends mbMerchantControl
             return '中国联通';
         } elseif ($card_type == mtopcard\ChinaTelecomCard) { //中国电信
             return '中国电信';
+        } elseif ($card_type == mtopcard\ThirdRefillCard) { //中国电信
+            return '增值业务';
         } else {
             return 'unknown';
         }

+ 14 - 6
test/TestRefill.php

@@ -383,9 +383,17 @@ class TestRefill extends TestCase
     {
         $providers = new refill\haohao\RefillOil([]);
 //        $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => $this->make_sn()]);
-        $data = '{"amount":"10000","mchId":"467253","mchOrderNo":"11951621246293101589","mobile":"","sign":"8EE6121AA7D640BC58C4C1131E79B3ED","operator":"4","number":"1000111100021211884","thirdOrderNo":"2316032626758635520","directStatus":"5"}';
-        $input = json_decode($data, true);
-        refill\RefillFactory::instance()->notify('haohao',$input);
+        $data['amount'] = 20000;
+        $data['mchId'] = 467253;
+        $data['mchOrderNo'] = '5514850674656058146707';
+        $data['mobile'] = '';
+        $data['sign'] = 'F282D68972A437F3CEB3516BB2FDD19A';
+        $data['operator'] = 4;
+        $data['number'] = '1000113200020348885';
+        $data['thirdOrderNo'] = '2317184088901537792';
+        $data['directStatus'] = 5;
+//        $input = json_decode($data, true);
+        refill\RefillFactory::instance()->notify('haohao',$data);
     }
 
     public function testZeheng()
@@ -652,10 +660,10 @@ class TestRefill extends TestCase
     {
         $providers = new refill\yunsuoyao\RefillPhone([]);
 //        $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
-//        $resp = $providers->query(['order_sn' => '58441621240148031464']);
-        $data = '{"orderid":"PAB21051716291937160","sporderid":"58441621240148031464","userid":"10002501","merchantsubmittime":"20210517163911","resultno":"9","parvalue":"30","remark1":"","payno":"","fundbalance":"-28.74","sign":"69202C564A6AC83819C1B14F2F5ABDF3"}';
+        $resp = $providers->query(['order_sn' => '20431621331092296201']);
+        $data = '{"orderid":"RLU21051817441937847","sporderid":"20431621331092296201","userid":"10002501","merchantsubmittime":"20210518174858","resultno":"9","parvalue":"30","remark1":"","payno":"","fundbalance":"-28.74","sign":"426EAC103B79505BAE7AB3F16886F1A8"}';
         $input = json_decode($data, true);
-        refill\RefillFactory::instance()->notify('yunsuoyao',$input);
+//        refill\RefillFactory::instance()->notify('yunsuoyao',$input);
     }
 
     public function testAfdPhone()