Quellcode durchsuchen

merchant ratios

xiaoyu vor 3 Jahren
Ursprung
Commit
3f88c0496c

+ 38 - 0
admin/control/refill_successful.php

@@ -110,4 +110,42 @@ class refill_successfulControl extends SystemControl
         echo(json_encode($result));
         exit;
     }
+
+    public function merchant_ratiosOp()
+    {
+        $ins = Cache::getInstance('cacheredis');
+        $json = $ins->get_org('merchant_ratios');
+        $data = json_decode($json);
+        $data = $this->object_array($data);
+        $result = [];
+        if(!empty($data)) {
+            $merchant_list = $this->merchants();
+            foreach ($merchant_list as $value) {
+                $mchid = $value['mchid'];
+                if(array_key_exists($mchid, $data) && is_array($data[$mchid])) {
+                    $result[$mchid]['ratio'] = $data[$mchid];
+                    $result[$mchid]['company_name'] = $value['company_name'];
+                }
+            }
+        }
+
+        Tpl::output('list', $result);
+        Tpl::showpage('merchant.ratios');
+    }
+
+    private function object_array($array)
+    {
+        if(is_object($array))
+        {
+            $array = (array)$array;
+        }
+        if(is_array($array))
+        {
+            foreach($array as $key=>$value)
+            {
+                $array[$key] = $this->object_array($value);
+            }
+        }
+        return $array;
+    }
 }

+ 123 - 0
admin/templates/default/merchant.ratios.php

@@ -0,0 +1,123 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<style>
+    .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:26px;
+    }
+    input::placeholder{ 
+        color:#333; 
+    }
+</style>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>成功率监控列表</h3>
+            <ul class="tab-base">
+                <li><a href="?index.php&act=refill_successful&op=index&type=provider"><span>通道成功率监控</span></a></li>
+                <li><a href="?index.php&act=refill_successful&op=index&type=system"><span>平台成功率监控</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current" ><span>机构成功率统计</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch" class="layui-form">
+        <input type="hidden" value="refill_refund" name="act">
+        <input type="hidden" value="merchant_ratios" name="op">
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+            </tr>
+            </tbody>
+        </table>
+    </form>
+    <form method="post" id="merchant_name_form">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <table class="table tb-type2">
+            <thead>
+            <tr class="thead">
+                <th class="align-center">机构编码</th>
+                <th class="align-center">机构名称</th>
+                <th class="align-center">15分钟</th>
+                <th class="align-center">30分钟</th>
+                <th class="align-center">1小时</th>
+                <th class="align-center">2小时</th>
+                <th class="align-center">当天</th>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
+                <?php foreach ($output['list'] as $k => $v) { ?>
+                    <tr class="trFlex">
+                        <td class="align-center"><?php echo $k; ?></td>
+                        <td class="align-center"><?php echo $v['company_name']; ?></td>
+                        <td class="align-center"><?php echo ($v['ratio'][900] * 100); ?>%</td>
+                        <td class="align-center"><?php echo ($v['ratio'][1800] * 100); ?>%</td>
+                        <td class="align-center"><?php echo ($v['ratio'][3600] * 100); ?>%</td>
+                        <td class="align-center"><?php echo ($v['ratio'][7200] * 100); ?>%</td>
+                        <td class="align-center"><?php echo ($v['ratio'][86400] * 100); ?>%</td>
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="7"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td></td>
+                <td colspan="7">
+                    <div class="pagination"><?php echo $output['show_page']; ?></div>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.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"/>
+<script>
+    $(function () {
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+        $('#ncsubmit').click(function () {
+            $('#formSearch').submit();
+        });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+        // 导出
+        $('#ncexport').click(function () {
+
+            $('input[name="export"]').val('1');
+            $('input[name="op"]').val('index');
+
+            $('#formSearch').submit();
+            $('input[name="export"]').val('');
+            var ii = layer.load();
+            setTimeout(function(){
+                layer.close(ii);
+            }, 800);
+        })
+    });
+</script>

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

@@ -5,6 +5,7 @@
             <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=system"><span>平台成功率监控</span></a></li>
+                <li><a href="?index.php&act=refill_successful&op=merchant_ratios"><span>机构成功率统计</span></a></li>
             </ul>
         </div>
     </div>

+ 1 - 0
admin/templates/default/system.successful.php

@@ -5,6 +5,7 @@
             <ul class="tab-base">
                 <li><a href="?index.php&act=refill_successful&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=refill_successful&op=merchant_ratios"><span>机构成功率统计</span></a></li>
             </ul>
         </div>
     </div>

+ 26 - 26
mobile/signature.php

@@ -1,27 +1,27 @@
-<?php
-
-//Log::record("This is signatrue file.");
-//
-//$signature = $_GET["signature"];
-//$timestamp = $_GET["timestamp"];
-//$nonce = $_GET["nonce"];
-//$echostr = $_GET["echostr"];
-$data = json_encode($_POST);
-$sign = $_SERVER['HTTP_SIGN'];
-Log::record("signature data : {$data}",Log::DEBUG);
-Log::record("HTTP_SIGN : {$sign}",Log::DEBUG);
-echo ('success');
-
-//echo("{$echostr}");
-//
-//$token = 'stanleykinghelloworld';
-//$tmpArr = [$token, $timestamp, $nonce];
-//sort($tmpArr, SORT_STRING);
-//$tmpStr = implode( $tmpArr );
-//$tmpStr = sha1( $tmpStr );
-//
-//if( $tmpStr == $signature ){
-//    return true;
-//}else{
-//    return false;
+<?php
+
+//Log::record("This is signatrue file.");
+//
+//$signature = $_GET["signature"];
+//$timestamp = $_GET["timestamp"];
+//$nonce = $_GET["nonce"];
+//$echostr = $_GET["echostr"];
+$data = json_encode($_POST);
+$sign = $_SERVER['HTTP_SIGN'];
+Log::record("signature data : {$data}",Log::DEBUG);
+Log::record("HTTP_SIGN : {$sign}",Log::DEBUG);
+echo ('SUCCESS');
+
+//echo("{$echostr}");
+//
+//$token = 'stanleykinghelloworld';
+//$tmpArr = [$token, $timestamp, $nonce];
+//sort($tmpArr, SORT_STRING);
+//$tmpStr = implode( $tmpArr );
+//$tmpStr = sha1( $tmpStr );
+//
+//if( $tmpStr == $signature ){
+//    return true;
+//}else{
+//    return false;
 //}