Ver código fonte

Merge branch 'rmaster' into coqueue

stanley-king 4 anos atrás
pai
commit
1ccb9ca069

+ 44 - 1
admin/control/merchant.php

@@ -7,6 +7,7 @@
 defined('InShopNC') or exit('Access Invalid!');
 
 require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
+require_once(BASE_CONFIG_PATH . CONFIG_PREFIX . '/refill.ini.php');
 
 
 class merchantControl extends SystemControl
@@ -1210,7 +1211,13 @@ class merchantControl extends SystemControl
             };
 
             $provider_model = Model('refill_provider');
-            $providers = $provider_model->getProviderList(['type' => $type] , '1000' , 'provider_id,name' , 'provider_id asc');
+            $providers = Model('')->table('refill_provider,store')
+                ->field('refill_provider.*,store.store_name')
+                ->join('inner')
+                ->on('store.store_id=refill_provider.store_id')
+                ->where(['type' => $type])
+                ->limit(100)
+                ->select();
             if(empty($providers)) {
                 showMessage('暂无相关通道', 'index.php?act=merchant&op=provider');
             }
@@ -1447,4 +1454,40 @@ class merchantControl extends SystemControl
         Tpl::output('show_page', $model_refill_order->showpage());
         Tpl::showpage('refill.order.send.index');
     }
+
+    public function OrderStatsOp()
+    {
+        $type = $_GET['type'] ? $_GET['type'] : 'system';
+        $page = "{$type}.order.stats";
+        $model_refill_order = Model('refill_order');
+        $condition['type'] = $type;
+        if(!empty($_GET['cid'])) {
+            $condition['cid'] = $_GET['cid'];
+        }
+        $start_unixtime = intval(strtotime($_GET['query_start_time']));
+        $end_unixtime   = intval(strtotime($_GET['query_end_time']));
+        if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
+            $condition['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);
+
+        if($type == 'provider') {
+            $provider_list = Model('')->table('refill_provider,store')->field('refill_provider.store_id,store.store_name')->join('inner')
+                ->on('store.store_id=refill_provider.store_id')->limit(100)->select();
+            Tpl::output('provider_list', $provider_list);
+        }elseif ($type == 'merchant') {
+            $merchant_list = Model('')->table('merchant')->limit(100)->select();
+            Tpl::output('merchant_list', $merchant_list);
+        }
+        Tpl::output('stats_list', $stats_list);
+        Tpl::output('show_page', $model_refill_order->showpage());
+        Tpl::showpage($page);
+    }
 }

+ 2 - 1
admin/include/menu.php

@@ -97,7 +97,8 @@ $arr = array(
 					array('args'=>'refill_evidence,merchant,merchant',		'text'=>'充值申请'),
 					array('args'=>'refill_order,merchant,merchant',			'text'=>'订单列表'),
 					array('args'=>'provider,merchant,merchant',				'text'=>'通道列表'),
-					array('args'=>'OrderSendList,merchant,merchant',		'text'=>'超时订单监控')
+					array('args'=>'OrderSendList,merchant,merchant',		'text'=>'超时订单监控'),
+					array('args'=>'OrderStats,merchant,merchant',		'text'=>'对账管理')
 				)
 			),
 			4 => array(

+ 140 - 0
admin/templates/default/merchant.order.stats.php

@@ -0,0 +1,140 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>对账管理</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=merchant&op=OrderStats&type=system"><span>商户对账记录</span></a></li>
+                <li><a href="index.php?act=merchant&op=OrderStats&type=provider"><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">
+        <input type="hidden" value="merchant" name="act">
+        <input type="hidden" value="OrderStats" name="op">
+        <input type="hidden" value="merchant" name="type">
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <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="cid" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <?php foreach($output['merchant_list'] as $merchant){?>
+                            <option value="<?php echo $merchant['mchid']?>"
+                                    <?php if ($_GET['cid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name'];?>
+                            </option>
+                        <?php }?>
+                    </select>
+                </td>
+                <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                    <?php if ($output['mch_name'] != '') { ?>
+                        <a href="index.php?act=merchant&op=refill_evidence" class="btns "
+                           title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
+                    <?php } ?></td>
+            </tr>
+            </tbody>
+        </table>
+    </form>
+    <!--   <table class="table tb-type2" id="prompt">-->
+    <!--    <tbody>-->
+    <!--      <tr class="space odd">-->
+    <!--        <th colspan="12"><div class="title">-->
+    <!--            <h5>--><?php //echo $lang['nc_prompts'];?><!--</h5>-->
+    <!--            <span class="arrow"></span></div></th>-->
+    <!--      </tr>-->
+    <!--      <tr>-->
+    <!--        <td><ul>-->
+    <!--            <li>--><?php //echo $lang['store_help1'];?><!--</li>-->
+    <!--          </ul></td>-->
+    <!--      </tr>-->
+    <!--    </tbody>-->
+    <!--  </table>-->
+    <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>统计日期</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"><?php echo $lang['operation']; ?></th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['stats_list']) && is_array($output['stats_list'])) { ?>
+                <?php foreach ($output['stats_list'] as $k => $v) { ?>
+                    <tr>
+                        <td><?php echo $v['time_text']; ?></td>
+                        <td><?php echo $v['cname']; ?></td>
+                        <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['profit_amounts']; ?></td>
+                        <td class="align-center"><?php echo $v['service_amounts']; ?></td>
+                        <td class="align-center"><?php echo $v['order_count']; ?></td>
+                        <td class="align-center"><?php echo $v['cancel_count']; ?></td>
+                        <td class="align-center"><?php echo $v['success_ratio']; ?></td>
+                        <td class="align-center w200">
+                        </td>
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="15"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td></td>
+                <td colspan="16">
+                    <div class="pagination"><?php echo $output['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>
+    $(function () {
+        $('#ncsubmit').click(function () {
+            $('input[name="op"]').val('OrderStats');
+            $('#formSearch').submit();
+        });
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+    });
+</script>

+ 42 - 12
admin/templates/default/provider.amount.control.php

@@ -103,6 +103,19 @@
         margin-left:0px;
         padding-left:20px;
     }
+    /* .trFlex {
+        display: block;
+        padding-left:120px;
+    }
+    .tbFlex {
+        position: fixed;
+        left: 20px;
+        top: auto;
+        background-color: #fff;
+        z-index: 1;
+        height: 25px;
+        line-height: 25px; 
+    } */
 </style>
 <div class="page">
     <div class="fixed-bar">
@@ -133,24 +146,28 @@
             </tr>
             <tr class="noborder">
                 <table class="spec_table tb-type2" style="width: 100%;margin-top: 77px;display: block;">
-                    <tbody id="tableHread" style="position: fixed;top:138px;left:12px;background-color: #fff;z-index:999;width: 100%;">
+                    <tbody id="tableHread" style="position: fixed;top:138px;left:20px;background-color: #fff;z-index:999;width: 96.5%%;">
                         <tr class="w550">
-                            <th style="text-align: center;width: 120px;min-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: 160px;min-width:160px;padding-right:0;background-color: #fff"><?php echo $provider['name']?></th>
+                            <th style="text-align: center;width: 160px;min-width:160px;padding-right:0;background-color: #fff"><?php echo $provider['store_name']?>(<?php if($provider['opened'] == 1){?>
+                                <span style="color: #0bb20c">开启</span>
+                            <?php }?><?php if($provider['opened'] == 2){?>
+                                        <span style="color: #f30707">关闭</span>
+                            <?php }?>)
                             <?php }?>
                         </tr>
-                        <tr class="w500" style="disp;ay:block;padding-bottom:10px;">
-                            <td style="text-align: center;width: 120px;min-width:120px;"></td>
+                        <tr class="w500" style="display:block;">
+                            <td style="text-align: center;width: 120px;min-width:120px;height:16px"></td>
                             <?php foreach ($output['providers'] as $provider) { ?>
-                            <td style="text-align: center;width: 130px;min-width:130px;padding-right: 10px;background-color: #fff;" class="batch-td">
+                            <td style="text-align: center;width: 150px;min-width:150px;padding-right: 10px;background-color: #fff;" class="batch-td">
                                 <div style="width: 46px;display:inline-block">
                                     单量
                                 </div>
                                 <div style="width: 40px;display:inline-block">
                                     优先级
                                 </div>
-                                <div style="width: 35x;display:inline-block">
+                                <div style="width: 40px;display:inline-block">
                                     开关
                                 </div>
                             </td>
@@ -159,10 +176,10 @@
                         </tr>
 
                     </tbody>
-                    <tbody class="tbody tableContent" style="display: block;padding-top: 55px;">
+                    <tbody class="tbody tableContent" style="display: block;padding-top: 56px;">
                         <?php foreach ($output['form']['amountData'] as $key => $amount) { ?>
-                        <tr class="w500">
-                            <td style="text-align: center;width: 120px;min-width:120px;">
+                        <tr class="w500 trFlex">
+                            <td style="text-align: center;width: 120px;min-width:120px;" class="tbFlex">
                                 <?php echo $amount['text']?>
                             </td>
 
@@ -243,12 +260,25 @@
     $(function () {
         $(window).scroll(function() {
             let toLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
+            // let toTop = document.documentElement.scrollTop || document.body.scrollTop;
+            // console.log('toTop',toTop);
             if (toLeft>0) {
-                let headLeft = toLeft - 12
+                let headLeft = toLeft - 20
                 $('#tableHread')[0].style.left = '-'+headLeft+'px'
             } else if (toLeft == 0) {
-                $('#tableHread')[0].style.left = 12+'px'
+                $('#tableHread')[0].style.left = 20+'px'
             }
+            // if (toTop>0) {
+            //     console.log('11', $('.tbFlex')[0].offsetTop);
+            //     $('.tbFlex').each(function () {
+            //         let trTop = $(this)[0].offsetTop
+            //         $(this)[0].style.top = trTop - toTop + 'px'
+            //     })
+            // } else if (toTop == 0) {
+            //     $('.tbFlex').each(function () {
+            //         $(this)[0].style.top = 'auto'
+            //     })
+            // }
         });
         let isSubmit = true
         $('.input-one').blur(function () {

+ 140 - 0
admin/templates/default/provider.order.stats.php

@@ -0,0 +1,140 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>对账管理</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=merchant&op=OrderStats&type=system"><span>平台对账记录</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>通道对账记录</span></a></li>
+                <li><a href="index.php?act=merchant&op=OrderStats&type=merchant"><span>商户对账记录</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch">
+        <input type="hidden" value="merchant" name="act">
+        <input type="hidden" value="OrderStats" name="op">
+        <input type="hidden" value="provider" name="type">
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <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="cid" 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['cid'] == $provider['store_id']){ ?>selected<?php } ?>><?php echo $provider['store_name']?>
+                            </option>
+                        <?php }?>
+                    </select>
+                </td>
+                <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                    <?php if ($output['mch_name'] != '') { ?>
+                        <a href="index.php?act=merchant&op=refill_evidence" class="btns "
+                           title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
+                    <?php } ?></td>
+            </tr>
+            </tbody>
+        </table>
+    </form>
+    <!--   <table class="table tb-type2" id="prompt">-->
+    <!--    <tbody>-->
+    <!--      <tr class="space odd">-->
+    <!--        <th colspan="12"><div class="title">-->
+    <!--            <h5>--><?php //echo $lang['nc_prompts'];?><!--</h5>-->
+    <!--            <span class="arrow"></span></div></th>-->
+    <!--      </tr>-->
+    <!--      <tr>-->
+    <!--        <td><ul>-->
+    <!--            <li>--><?php //echo $lang['store_help1'];?><!--</li>-->
+    <!--          </ul></td>-->
+    <!--      </tr>-->
+    <!--    </tbody>-->
+    <!--  </table>-->
+    <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>统计日期</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"><?php echo $lang['operation']; ?></th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['stats_list']) && is_array($output['stats_list'])) { ?>
+                <?php foreach ($output['stats_list'] as $k => $v) { ?>
+                    <tr>
+                        <td><?php echo $v['time_text']; ?></td>
+                        <td><?php echo $v['cname']; ?></td>
+                        <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['profit_amounts']; ?></td>
+                        <td class="align-center"><?php echo $v['service_amounts']; ?></td>
+                        <td class="align-center"><?php echo $v['order_count']; ?></td>
+                        <td class="align-center"><?php echo $v['cancel_count']; ?></td>
+                        <td class="align-center"><?php echo $v['success_ratio']; ?></td>
+                        <td class="align-center w200">
+                        </td>
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="15"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td></td>
+                <td colspan="16">
+                    <div class="pagination"><?php echo $output['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>
+    $(function () {
+        $('#ncsubmit').click(function () {
+            $('input[name="op"]').val('OrderStats');
+            $('#formSearch').submit();
+        });
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+    });
+</script>

+ 127 - 0
admin/templates/default/system.order.stats.php

@@ -0,0 +1,127 @@
+<?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>
+                <li><a href="index.php?act=merchant&op=OrderStats&type=provider"><span>通道对账记录</span></a></li>
+                <li><a href="index.php?act=merchant&op=OrderStats&type=merchant"><span>商户对账记录</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch">
+        <input type="hidden" value="merchant" name="act">
+        <input type="hidden" value="OrderStats" name="op">
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <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>
+                <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                    <?php if ($output['mch_name'] != '') { ?>
+                        <a href="index.php?act=merchant&op=orderstats" class="btns "
+                           title="<?php echo $lang['nc_cancel_search']; ?>"><span><?php echo $lang['nc_cancel_search']; ?></span></a>
+                    <?php } ?></td>
+            </tr>
+            </tbody>
+        </table>
+    </form>
+    <!--   <table class="table tb-type2" id="prompt">-->
+    <!--    <tbody>-->
+    <!--      <tr class="space odd">-->
+    <!--        <th colspan="12"><div class="title">-->
+    <!--            <h5>--><?php //echo $lang['nc_prompts'];?><!--</h5>-->
+    <!--            <span class="arrow"></span></div></th>-->
+    <!--      </tr>-->
+    <!--      <tr>-->
+    <!--        <td><ul>-->
+    <!--            <li>--><?php //echo $lang['store_help1'];?><!--</li>-->
+    <!--          </ul></td>-->
+    <!--      </tr>-->
+    <!--    </tbody>-->
+    <!--  </table>-->
+    <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>统计日期</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"><?php echo $lang['operation']; ?></th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['stats_list']) && is_array($output['stats_list'])) { ?>
+                <?php foreach ($output['stats_list'] as $k => $v) { ?>
+                    <tr>
+                        <td><?php echo $v['time_text']; ?></td>
+                        <td><?php echo $v['cname']; ?></td>
+                        <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['profit_amounts']; ?></td>
+                        <td class="align-center"><?php echo $v['service_amounts']; ?></td>
+                        <td class="align-center"><?php echo $v['order_count']; ?></td>
+                        <td class="align-center"><?php echo $v['cancel_count']; ?></td>
+                        <td class="align-center"><?php echo $v['success_ratio']; ?></td>
+                        <td class="align-center w200">
+                        </td>
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="15"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td></td>
+                <td colspan="16">
+                    <div class="pagination"><?php echo $output['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>
+    $(function () {
+        $('#ncsubmit').click(function () {
+            $('input[name="op"]').val('OrderStats');
+            $('#formSearch').submit();
+        });
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+    });
+</script>

+ 199 - 0
crontab/control/date.php

@@ -1151,4 +1151,203 @@ class dateControl extends BaseCronControl
         }
         return $datas;
     }
+
+    //订单系统,通道,商户订单统计.
+    public function _order_stats()
+    {
+        $this->system_order_stats();
+        $this->provider_order_stats();
+        $this->merchant_order_stats();
+    }
+
+
+
+    private function day_order_stats($type , $condition , $start_time)
+    {
+        if($start_time == 0) {
+            $start_time = strtotime(date("Y-m-d" , strtotime("-1 day")));
+        }
+        $stats = Model('')->table('refill_stats')->where($condition)->find();
+
+        $end_time = $start_time + 3600*24;
+        $condition['refill_order.order_time'] = [ ['egt', $start_time] , ['lt', $end_time] , 'and'];
+        $condition['inner_status'] = 0;
+
+        $counts = 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, order_state')
+            ->where($condition)
+            ->group('order_state')
+            ->select();
+
+        $cancel_count = $success_count = $order_count = 0;
+        $success_refill_amounts = $success_channel_amounts = $success_mch_amounts = $profit_amounts = 0;
+        foreach ($counts as $count)
+        {
+            if ($count['order_state'] == ORDER_STATE_SUCCESS) {
+                $success_refill_amounts = $count['refill_amounts'];
+                $success_channel_amounts = $count['channel_amounts'];
+                $success_mch_amounts = $count['mch_amounts'];
+                $success_count = $count['order_count'];
+                $profit_amounts = ncPriceFormat($success_mch_amounts - $success_channel_amounts);
+            } elseif ($count['order_state'] == ORDER_STATE_CANCEL) {
+                $cancel_count = $count['order_count'];
+            }
+
+            $order_count += $count['order_count'];
+        }
+
+        $params['time_text'] = date("Y-m-d" , $start_time);
+        $params['time_stamp'] = $start_time;
+        $params['success_count'] = $success_count;
+        $params['success_refill_amounts'] = $success_refill_amounts;
+        $params['success_channel_amounts'] = $success_channel_amounts;
+        $params['success_mch_amounts'] = $success_mch_amounts;
+        $params['profit_amounts'] = $profit_amounts;
+        $params['order_count'] = $order_count;
+        $params['cancel_count'] = $cancel_count;
+        if($order_count == 0) {
+            $params['success_ratio'] = '0%';
+        }else{
+            $params['success_ratio'] = ncPriceFormat($success_count / $order_count) * 100 . '%';
+        }
+
+        return $params;
+    }
+
+    private function system_order_stats()
+    {
+        $type = 'system';
+        $start_time = strtotime(date("Y-m-d" , strtotime("-1 day")));
+
+        $system_stats = function($params , $type){
+            $params['type'] = $type;
+            $params['cid'] = 0;
+            $params['cname'] = $type;
+            $success_refill_amounts = $params['success_refill_amounts'];
+            if($success_refill_amounts > 0 && $success_refill_amounts <= 15000000) {
+                $params['service_amounts'] = ncPriceFormat($params['success_refill_amounts'] * 0.001);
+            }elseif ($success_refill_amounts > 15000000 && $success_refill_amounts <= 30000000) {
+                $params['service_amounts'] = 15000;
+            }else{
+                $params['service_amounts'] = ncPriceFormat($params['success_refill_amounts'] * 0.0005);
+            }
+            Model('')->table('refill_stats')->insert($params);
+        };
+
+        $need_init = $this->check_stats($type);
+
+        if($need_init == false){
+            $stats = Model('')->table('refill_stats')->where(['type' => $type , 'time_stamp' => $start_time])->find();
+            if(empty($stats)) {
+                $params = $this->day_order_stats($type , [] , $start_time);
+                $system_stats($params,$type);
+            }
+        }else{
+            Model('')->table('refill_stats')->where(['type' => $type])->delete();
+            foreach ($need_init as $date) {
+                $params = $this->day_order_stats($type , [] , strtotime($date));
+                $system_stats($params,$type);
+            }
+        }
+    }
+
+    private function provider_order_stats()
+    {
+        $type = 'provider';
+
+        $provider_list = Model('')->table('refill_provider,store')->field('refill_provider.store_id,store.store_name')->join('inner')
+            ->on('store.store_id=refill_provider.store_id')->limit(100)->select();
+        if(empty($provider_list)) {
+            return ;
+        }
+        $start_time = strtotime(date("Y-m-d" , strtotime("-1 day")));
+
+        $provider_stats = function($params , $type , $provider){
+            $params['type'] = $type;
+            $params['cid'] = $provider['store_id'];
+            $params['cname'] = $provider['store_name'];
+            $params['service_amounts'] = 0;
+            return $params;
+        };
+        $insert = [];
+        $need_init = $this->check_stats($type);
+
+        foreach ($provider_list as $provider) {
+            $store_id = $provider['store_id'];
+            $condition['store_id'] = $store_id;
+            if($need_init == false){
+                $stats = Model('')->table('refill_stats')->where(['type' => $type , 'time_stamp' => $start_time , 'cid' => $store_id])->find();
+                if(empty($stats)) {
+                    $params = $this->day_order_stats($type , $condition , $start_time);
+                    $insert[] = $provider_stats($params , $type , $provider);
+                }
+            }else {
+                Model('')->table('refill_stats')->where(['type' => $type])->delete();
+                foreach ($need_init as $date) {
+                    $params = $this->day_order_stats($type , $condition , strtotime($date));
+                    $insert[] = $provider_stats($params, $type , $provider);
+                }
+            }
+        }
+
+        Model('')->table('refill_stats')->insertAll($insert);
+    }
+
+    private function merchant_order_stats()
+    {
+        $type = 'merchant';
+        $merchant_list = Model('')->table('merchant')->limit(100)->select();
+        if(empty($merchant_list)) {
+            return ;
+        }
+        $start_time = strtotime(date("Y-m-d" , strtotime("-1 day")));
+
+        $merchant_stats = function($params , $type , $merchant){
+            $params['type'] = $type;
+            $params['cid'] = $merchant['mchid'];
+            $params['cname'] = $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name'];
+            $params['service_amounts'] = 0;
+            return $params;
+        };
+        $insert = [];
+        $need_init = $this->check_stats($type);
+
+        foreach ($merchant_list as $merchant) {
+            $mchid = $merchant['mchid'];
+            $condition['mchid'] = $mchid;
+            if($need_init == false){
+                $stats = Model('')->table('refill_stats')->where(['type' => $type , 'time_stamp' => $start_time , 'cid' => $mchid])->find();
+                if(empty($stats)) {
+                    $params = $this->day_order_stats($type , $condition , $start_time);
+                    $insert[] = $merchant_stats($params , $type , $merchant);
+                }
+            }else{
+                Model('')->table('refill_stats')->where(['type' => $type])->delete();
+                foreach ($need_init as $date) {
+                    $params = $this->day_order_stats($type , $condition , strtotime($date));
+                    $insert[] = $merchant_stats($params , $type , $merchant);
+                }
+            }
+        }
+        Model('')->table('refill_stats')->insertAll($insert);
+    }
+
+    //检测前天是否有统计
+    public function check_stats($type)
+    {
+        $date = strtotime(date("Y-m-d" , strtotime("-2 day")));
+        $condition['type'] = $type;
+        $condition['time_stamp'] = $date;
+        $stats = Model('')->table('refill_stats')->where($condition)->find();
+        if(empty($stats)) {
+            $first_order = Model('')->table('refill_order')->order('order_time asc')->find();
+            $days = (strtotime(date("Y-m-d")) - strtotime(date("Y-m-d" , $first_order['order_time']))) / (3600 * 24);
+            for ($i = $days; $i > 0; $i--) {
+                $dates[] = date("Y-m-d" , strtotime("-{$i}day"));
+            }
+            return $dates;
+        }
+        return false;
+    }
 }

+ 15 - 0
crontab/control/minutes.php

@@ -22,6 +22,7 @@ class minutesControl extends BaseCronControl
         $this->_web_index_update();
         $this->_check_merchant_alarm_amount();
 //      $this->_cron_mail_send();
+        $this->_SendOrderQuery();
         Log::record(__FUNCTION__ . " end",Log::DEBUG);
     }
 
@@ -469,4 +470,18 @@ class minutesControl extends BaseCronControl
 
         return $cronid;
     }
+    //查询超过5分钟的充值中订单
+    public function _SendOrderQuery()
+    {
+        $model_refill_order = Model('refill_order');
+        $condition['order_state'] = ORDER_STATE_SEND;
+        $condition['refill_order.order_time'] = ['lt', (time() - 300)];
+        $orders = $model_refill_order->getMerchantOrderList($condition, 1000, 'refill_order.order_id');
+        if(!empty($orders)) {
+            foreach ($orders as $order) {
+                $order_id = $order['order_id'];
+                QueueClient::push("QueryRefillState",['order_id' => $order_id]);
+            }
+        }
+    }
 }

+ 1 - 1
data/config/lingzh/base.ini.php

@@ -28,7 +28,7 @@ $config['node_site_url'] 		= 'http://127.0.0.1:8090';
 $config['delivery_site_url']    = SRV_HOST.'/delivery';
 
 $config['system_manager_phones'] = [
-    '13911129867' , '18500608333' , '18500350111' , '15136908757' , '18510995608'
+    '17335762432'
 ];
 
 if(defined('USE_REMOTE_IMAGE') && USE_REMOTE_IMAGE == true) {

+ 8 - 6
data/config/xyz/refill.ini.php

@@ -234,12 +234,14 @@ $afand_phone = ['name' => 'afand', 'store_id' => 26,
 
 $afandeng_phone = ['name' => 'afandeng', 'store_id' => 27,
     'amount' => [
-        30 => [['goods_id' => 6380, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 6381, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 6382, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 6383, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile']],
-        300 => [['goods_id' => 6384, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 6385, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile']]
+        10 => [['goods_id' => 6406, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6407, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6380, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6381, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6382, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6383, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6384, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6385, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 

+ 8 - 0
data/model/refill_order.model.php

@@ -33,4 +33,12 @@ class refill_orderModel extends Model
         if (empty($list)) return [];
         return $list;
     }
+
+    public function getOrderStatsList($condition, $pagesize = '', $field = '*', $order = 'time_stamp desc', $limit = '')
+    {
+        $list = $this->table('refill_stats')->field($field)
+            ->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
+        if (empty($list)) return [];
+        return $list;
+    }
 }

+ 21 - 1
docker/compose/lz-acc/docker-compose.yml

@@ -10,9 +10,29 @@ services:
       - ../../conf/etc/localtime:/etc/localtime:ro
       - /nfs/upload:/var/www/html/data/upload
       - /nfs/merchant:/var/www/html/merchant
-      - ../../conf/nginx/nginx-acc-http.conf:/etc/nginx/nginx.conf:ro
+      - ../../conf/nginx/nginx-linzh-http.conf:/etc/nginx/nginx.conf:ro
     container_name: "panda-nginx"
     command: [nginx,'-g','daemon off;']
+    extra_hosts:
+      - "docker.hostip:172.17.0.1"
+      - "eth.hostip:172.16.110.28"
+
+  nginxhttps:
+    image: nginx:alpine
+    ports:
+      - "443:443"
+    volumes:
+      - ../../../:/var/www/html
+      - ../../conf/etc/localtime:/etc/localtime:ro
+      - /nfs/upload:/var/www/html/data/upload
+      - /nfs/merchant:/var/www/html/merchant
+      - ../../conf/nginx/cert:/etc/nginx/cert
+      - ../../conf/nginx/nginx-linzh-https.conf:/etc/nginx/nginx.conf:ro
+    container_name: "panda-nginx-https"
+    command: [nginx,'-g','daemon off;']
+    extra_hosts:
+      - "docker.hostip:172.17.0.1"
+      - "eth.hostip:172.16.110.28"
 
   redisrv:
     image: redis:alpine

+ 133 - 0
docker/compose/xiaoyu/docker-compose.yml

@@ -0,0 +1,133 @@
+version: "3.7"
+
+services:
+  nginxsrv:
+    image: nginx:alpine
+    ports:
+      - "80:80"
+    volumes:
+      - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/etc/localtime:/etc/localtime:ro
+      - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/nginx/cert:/etc/nginx/cert
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/nginx/nginx-win-http.conf:/etc/nginx/nginx.conf:ro
+    links:
+      - mobilesrv
+      - websrv
+    container_name: "panda-nginx"
+    command: [nginx,'-g','daemon off;']
+
+  redisrv:
+    image: redis:alpine
+    ports:
+      - "6379:6379"
+    volumes:
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/etc/localtime:/etc/localtime:ro
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/redis/6379.conf:/etc/redis/redis.conf
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/redis:/var/redis
+    container_name: "panda-redis"
+    command: [redis-server,"/etc/redis/redis.conf"]
+  raccsrv:
+    image: php-zts-debug:7.3.18
+    ports:
+      - "9101:9101"
+    volumes:
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/etc/localtime:/etc/localtime:ro
+      - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/php/php-local-debug.ini:/usr/local/etc/php/php.ini
+      - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/php/racc-spwan-start:/usr/local/bin/docker-spwan-start
+    links:
+      - redisrv
+    container_name: "panda-racc"
+    command: [docker-spwan-start]
+    depends_on:
+      - "redisrv"
+
+  mobilesrv:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/etc/localtime:/etc/localtime:ro
+      - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/php/php-local-debug.ini:/usr/local/etc/php/php.ini
+      - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/php/mobile-spwan-start:/usr/local/bin/docker-spwan-start
+    links:
+      - redisrv
+    container_name: "panda-mobile"
+    command: [docker-spwan-start]
+    depends_on:
+      - "redisrv"
+      - "searcher"
+
+  websrv:
+    image: php-fpm:alpine
+    volumes:
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/etc/localtime:/etc/localtime:ro
+      - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
+      - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/php-fpm/php-local-debug.ini:/usr/local/etc/php/php.ini
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/php-fpm/php-fpm.conf:/usr/local/etc/php-fpm.conf
+    container_name: "panda-web"
+    command: [php-fpm]
+    depends_on:
+      - "redisrv"
+      - "searcher"
+
+  queuesrv:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/etc/localtime:/etc/localtime:ro
+      - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
+      - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/php/php-local-debug.ini:/usr/local/etc/php/php.ini
+    links:
+      - redisrv
+    container_name: "panda-queue"
+    command: [php,"/var/www/html/queue/index.php", "queue", "index"]
+    depends_on:
+      - "redisrv"
+
+  searcher:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/etc/localtime:/etc/localtime:ro
+      - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
+      - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/php/php-local-debug.ini:/usr/local/etc/php/php.ini
+    links:
+      - redisrv
+    container_name: "panda-searcher"
+    command: [php, "/var/www/html/searcher.php"]
+    depends_on:
+      - "redisrv"
+
+  crontabsrv:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/etc/localtime:/etc/localtime:ro
+      - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
+      - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/php/php-local-debug.ini:/usr/local/etc/php/php.ini
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/crontab/debug-root:/var/spool/cron/crontabs/root
+    links:
+      - redisrv
+    container_name: "panda-crontab"
+    command: [crond,"-f"]
+    depends_on:
+      - "redisrv"
+
+  phpcli:
+    image: php-zts-debug:7.3.18
+    volumes:
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/etc/localtime:/etc/localtime:ro
+      - /d/phpstudy_pro/WWW/xyzshop/docker/conf/php/php-debug.ini:/usr/local/etc/php/php.ini
+      - /d/phpstudy_pro/WWW/xyzshop:/var/www/html
+      - /d/phpstudy_pro/WWW/xyzshop/data/upload:/var/www/html/data/upload
+    links:
+      - redisrv
+    container_name: "panda-php"
+    depends_on:
+      - "redisrv"
+      - "websrv"
+      - "searcher"

+ 2 - 0
docker/conf/crontab/root

@@ -13,3 +13,5 @@
 0   3   1   */1 *   php /var/www/html/crontab/index.php month index
 *    *   *   *   *   echo "test" >> /var/test.log
 
+0   1   *   *   *   php /var/www/html/crontab/index.php date _order_stats
+

+ 27 - 0
docker/conf/nginx/cert/www.lzkj168.cn.key

@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAvCYPEagapLg56bqYH/s9K0qLsKFB9WEpYluLfEkCSaQ9EDSk
+awJ7OVX8acBEqpciScDPlfoSu2MSh9JViXHXA/P+Fhmkb7rY74Zp+lIdAXL7W5w1
+ob+bn4ys3jbZBdeEkrDT4hJ1KNmkUZj8rbSdIg7N4bd8drA+eug6vHVcr6j6BxlZ
+AkzZsVtqljSnGW/OczRu6Z+rrrry/F8T+KY4nBJXu/Ma0uTVuy7e/1pNAQw2Oria
+QZixOxHkVMcGefLDw/0EYJGyFqOeXaxC+o/NCPl1d6kzT5QaZaFV2UUJnqecSsFR
+vzWOrkAoy9W+cDJiAnh+YlSZ+0cZg/5t6bcZQwIDAQABAoIBABdpePiOfXo/vl0a
+LfHU1oC7jvRUrJt3Eqo9j/bQMuus9zg8BLWYInM5Aua52RGNKuQYjPwxmQEeS+EA
+yEoJE2NXiid/21lX28S6aheO/jL+9s4oevf8msXYwG4KTykN7149iLAZ8eA6bNsG
+eXK4BdGGHBJZPbCbL7sliKGIzRbCblw51ZZSGaHh2HEuJO7/ASmc9HeoZ49S9Dh1
+iGLP6IRv8C8lXwY0cCe7O7Ng6kJ5aooZBTD1y2F8owcg4iuqp40XCCOZNOnAZ1Hg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RwczovL3d3dy5kaWdpY2VydC5jb20vQ1BT
+MAgGBmeBDAECATANBgkqhkiG9w0BAQsFAAOCAQEAK3Gp6/aGq7aBZsxf/oQ+TD/B
+SwW3AU4ETK+GQf2kFzYZkby5SFrHdPomunx2HBzViUchGoofGgg7gHW0W3MlQAXW
+M0r5LUvStcr82QDWYNPaUy4taCQmyaJ+VB+6wxHstSigOlSNF2a6vg4rgexixeiV
+4YSB03Yqp2t3TeZHM9ESfkus74nQyW7pRGezj+TC44xCagCQQOzzNmzEAP2SnCrJ
+sNE2DpRVMnL8J6xBRdjmOsC3N6cQuKuRXbzByVBjCqAA8t1L0I+9wXJerLPyErjy
+rMKWaBFLmfK/AHNF4ZihwPGOc7w6UHczBZXH5RFzJNnww+WnKuTPI0HfnVH8lg==
+-----END CERTIFICATE-----

+ 3 - 3
docker/conf/nginx/nginx-acc-http.conf

@@ -73,7 +73,7 @@ http
 
         location ~ /mobile/[/\w]+\.php$ {
             root           $folder_name;
-            fastcgi_pass   172.16.110.28:9100;
+            fastcgi_pass   docker.hostip:9100;
             fastcgi_index  index.php;
             fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
             include fastcgi_params;
@@ -85,7 +85,7 @@ http
 
         location ~ /racc/[/\w]+\.php$ {
             root           $folder_name;
-            fastcgi_pass   172.16.110.28:9101;
+            fastcgi_pass   docker.hostip:9101;
             fastcgi_index  index.php;
             fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
             include fastcgi_params;
@@ -94,7 +94,7 @@ http
         location ~ \.php$ {
 	        add_header Cache-Control no-store;
             root           $folder_name;
-            fastcgi_pass   172.16.110.28:9000;
+            fastcgi_pass   docker.hostip:9000;
             fastcgi_index  index.php;
             fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
             include        fastcgi_params;

+ 110 - 0
docker/conf/nginx/nginx-linzh-https.conf

@@ -0,0 +1,110 @@
+user nginx;
+worker_processes  1;
+error_log   /var/error.log  info;
+worker_rlimit_nofile 1024;
+
+events {
+    worker_connections  1024;
+}
+
+http 
+{
+    include       mime.types;
+    default_type  application/octet-stream;
+    fastcgi_buffer_size 32k;
+    fastcgi_buffers 8 32k;
+    underscores_in_headers on;
+    client_max_body_size 1024M;
+
+    sendfile            on;
+    keepalive_timeout   65;
+
+    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+                      '$status $body_bytes_sent "$http_referer" '
+                      '"$http_user_agent" "$http_x_forwarded_for"';
+
+    server
+    {
+        listen       443 ssl;
+        set  $folder_name /var/www/html;
+        server_name www.lzkj168.cn;
+        root $folder_name;
+
+        ssl_certificate      cert/www.lzkj168.cn.pem;
+        ssl_certificate_key  cert/www.lzkj168.cn.key;
+
+        ssl_session_cache    shared:SSL:1m;
+        ssl_session_timeout  5m;
+
+        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;  #使用此加密套件。
+        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;   #使用该协议进行配置。
+        ssl_prefer_server_ciphers on;
+
+        index index.html index.php;
+        client_max_body_size 100m;
+        proxy_connect_timeout 500s;
+        proxy_read_timeout 500s;
+        proxy_send_timeout 500s;
+        fastcgi_connect_timeout 75;
+        fastcgi_read_timeout 600;
+        fastcgi_send_timeout 600;
+
+        charset utf-8;
+
+        location /logs {
+            deny all;
+            return 403;
+        }
+
+        location /data/log {
+            deny all;
+            return 403;
+        }
+        location / {
+            index  index.html index.htm index.php;
+        }
+
+        location /mshop {
+            root $folder_name;
+            autoindex on;
+            index  index.html index.htm index.php;
+            try_files $uri $uri/ /mshop/index.html;
+        }
+
+        location /merchant {
+            root $folder_name;
+            autoindex on;
+            index  index.html index.htm index.php;
+            try_files $uri $uri/ /merchant/index.html;
+        }
+
+        location ~ /mobile/[/\w]+\.php$ {
+            root           $folder_name;
+            fastcgi_pass   docker.hostip:9100;
+            fastcgi_index  index.php;
+            fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
+            include fastcgi_params;
+        }
+
+        location ~ /racc/[/\w]+\.php$ {
+            root           $folder_name;
+            fastcgi_pass   docker.hostip:9101;
+            fastcgi_index  index.php;
+            fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
+            include fastcgi_params;
+        }
+
+        location ~ /mobile/[/\w]+\.html$ {
+            try_files $uri $uri/ /mobile/index.html;
+        }
+
+        location ~ \.php$ {
+            add_header Cache-Control no-store;
+            root           $folder_name;
+            fastcgi_pass   docker.hostip:9000;
+            fastcgi_index  index.php;
+            fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
+            include        fastcgi_params;
+        }
+    }
+}

+ 0 - 2
helper/refill/ProviderManager.php

@@ -11,8 +11,6 @@ require_once(BASE_HELPER_PATH . '/refill/IRefillCallBack.php');
 require_once(BASE_HELPER_PATH . '/refill/CalcMerchantPrice.php');
 require_once(BASE_HELPER_PATH . '/refill/util.php');
 
-//require_once(BASE_HELPER_RAPI_PATH . '/api.php');
-
 use Log;
 use mtopcard;
 use Exception;

+ 3 - 3
helper/refill/api/lingzh/binghc/config.php

@@ -6,10 +6,10 @@ namespace refill\binghc;
 
 class config
 {
-    const ORDER_URL = 'http://8.136.201.63:9009/Order/Api/invest';
-    const QUERY_URL = 'http://8.136.201.63:9009/Order/Api/queryStatus';
+    const ORDER_URL = 'http://8.136.216.154:9009/Order/Api/invest';
+    const QUERY_URL = 'http://8.136.216.154:9009/Order/Api/queryStatus';
 
     const SID = '16133049250783350350';
     const KEY = 'f2vxbLarSpPfcpxPXqwfUYcFCvCiyj3a3jY0Lp292OgD1ic25AQUhlTQ9e7lV8O5';
-    const NOTIFY_URL = "http://121.89.212.167/racc/callback/lingzh/binghc.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/racc/callback/lingzh/binghc.php";
 }

+ 8 - 12
helper/refill/api/xyz/afandeng/RefillCallBack.php

@@ -13,7 +13,7 @@ class RefillCallBack implements refill\IRefillCallBack
     public function verify($params): bool
     {
         $sign = $this->sign($params);
-        if ($params['signstr'] == $sign) {
+        if ($params['sgn'] == $sign) {
             return true;
         } else {
             return false;
@@ -22,30 +22,26 @@ class RefillCallBack implements refill\IRefillCallBack
 
     private function sign($params)
     {
-        $content = $params['code'] . $params['tradeNoThird'] .$params['msg'] . $params['tradeNo'] . config::KEY;
-        if(empty($params['tradeNo'])) {
-            $content = $params['code'] . $params['tradeNoThird'] .$params['msg'] . config::KEY;
-        }
-        return md5($content);
+        $content = $params['ord'] . $params['state'] . config::KEY;
+        return strtoupper(md5($content));
     }
 
     public function notify($params)
     {
-        $status = intval($params['code']);
-        $order_sn = $params['tradeNoThird'];
+        $status = intval($params['state']);
+        $order_sn = $params['ord'];
         $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
         if (empty($order_info)) {
             return [false, false, false,false];
         }
         $order_id = $order_info['order_id'];
-        
-        $data['official_sn'] = strtolower($params['tradeNo']) == 'null' ? '' : $params['tradeNo'];
+        $data['official_sn'] = $params['bz'];
 
-        if ($status === 200) {
+        if ($status === 1) {
             Model('refill_order')->edit($order_id, $data);
             return [$order_id, true, false,true];
         }
-        elseif ($status === 300) {
+        elseif ($status === 2) {
             return [$order_id, false, true,true];
         }
         else {

+ 50 - 35
helper/refill/api/xyz/afandeng/RefillPhone.php

@@ -17,58 +17,73 @@ class RefillPhone extends refill\IRefillPhone
 
     private function req_params(int $phone, int $amount, string $order_sn)
     {
-        $params['merchantId'] = config::MCHID;
-        $params['orderType'] = 1;
-        $params['mobile'] = $phone;
-        $params['tradeNoThird'] = $order_sn;
-        $params['amount'] = sprintf("%.2f" , $amount);
-        $params['notifyUrl'] = config::NOTIFY_URL;
-
+        $params['usr'] = config::USR;
+        $params['mob'] = $phone;
+        $params['amt'] = $amount;
+        $params['ord'] = $order_sn;
+        $params['tim'] = date("YmdHis");
+        $params['yysid'] = 0;
+        $params['hmlx'] = 0;
         return $params;
+
     }
 
     public function add($card_no, $card_type, $amount, $params)
     {
-        $params = $this->req_params($card_no, $amount, $params['order_sn']);
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no,$amount,$order_sn);
         $sign = $this->sign($params);
-        $params['signstr'] = $sign;
+        $params['sgn'] = $sign;
+        $resp = http_request(config::PAY_PHONE_URL,$params,'GET');
+        if($resp === false) {
+            return [false,'系统错误',true];
+        }
+        else
+        {
+            Log::record($resp,Log::DEBUG);
+            $resp = ltrim($resp , '|');
 
-        $resp = http_request(config::ORDER_URL, $params , 'POST' , false , config::ExtHeaders);
-        if ($resp === false) {
-            return [false, '系统错误', true];
-        } else {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
-            if ($resp['code'] == 200) {
-                return [true, $resp['body']['tradeNoSelf'], false];
-            } else {
-                return [false, $resp['msg'], false];
+            $resp = explode('|' , $resp);
+            if(count($resp) != 3) {
+                return [false,'返回值错误', false];
+            }
+            elseif($resp[0] == 0) {
+                return [true,'', false];
+            }
+            else {
+                return [false,$resp[1], false];
             }
         }
     }
 
     public function query($refill_info)
     {
-        $params['merchantId'] = config::MCHID;
-        $params['tradeNoThird'] = $refill_info['order_sn'];
-        $content = $params['merchantId'] . $params['tradeNoThird'] . config::KEY;
-        $params['signstr'] = md5($content);
-        $resp = http_request(config::QUERY_URL, $params , 'GET' , false);
-        if ($resp === false) {
-            return [false, '系统错误'];
-        } else {
-            Log::record($resp, Log::DEBUG);
-            $resp = json_decode($resp, true);
+        $params['ord'] = $refill_info['order_sn'];
+        $params['usr'] = config::USR;
+        $content = $params['usr'] . $params['ord'] . config::KEY;
+        $params['sgn'] = strtoupper(md5($content));
+        $resp = http_request(config::QUERY_URL,$params);
+        if($resp === false) {
+            return [false,'系统错误'];
+        }
+        else
+        {
+            Log::record($resp,Log::DEBUG);
+            $resp = ltrim($resp , '|');
+            $resp = explode('|' , $resp);
+            if(count($resp) != 3) {
+                return [false,'返回值错误'];
+            }
             $order_state = -1;
-            if ($resp['code'] == 200) {
+            if ($resp[0] == 1) {
                 $order_state = ORDER_STATE_SUCCESS;
-            } elseif ($resp['code'] == 604) {
+            } elseif ($resp[0] == 2) {
                 $order_state = ORDER_STATE_CANCEL;
-            } elseif ($resp['code'] == 603){
+            } elseif ($resp[0] == 0){
                 $order_state = ORDER_STATE_SEND;
             }
             if ($order_state == -1) {
-                return [false, $resp['msg']];
+                return [false, $resp[0]];
             }
             return [true, $order_state];
         }
@@ -77,7 +92,7 @@ class RefillPhone extends refill\IRefillPhone
     private function sign($params)
     {
         $key = config::KEY;
-        $content = $params['merchantId'] . $params['orderType'] . $params['mobile'] . $params['tradeNoThird'] . $params['amount'] . $params['notifyUrl'] . $key;
-        return md5($content);
+        $content = $params['usr'] . $params['ord'] . $params['mob'] . $params['amt'] . $params['tim'] . $key;
+        return strtoupper(md5($content));
     }
 }

+ 4 - 7
helper/refill/api/xyz/afandeng/config.php

@@ -6,11 +6,8 @@ namespace refill\afandeng;
 
 class config
 {
-    const ORDER_URL = 'http://8.135.117.151:8124/supply/order/orderCheck';
-    const QUERY_URL = 'http://8.135.117.151:8124/supply/order/getSupplyOrderStatus';
-
-    const MCHID = 131;
-    const KEY = '4356f096d6ff947da4918e40bedc444e';
-    const NOTIFY_URL =  BASE_SITE_URL."/mobile/refill_afandeng.php";
-    const ExtHeaders = ['ContentType: application/x-www-form-urlencoded;charset=utf-8'];
+    const PAY_PHONE_URL = 'http://8.140.101.13:806/webInface/PayPhone.ashx';
+    const QUERY_URL= 'http://8.140.101.13:806/webInface/GetOrderState.ashx';
+    const USR= 'afandeng';
+    const KEY = 'd54e3cac95dec6839e74313740ce2ab1';
 }

+ 2 - 2
helper/refill/api/xyz/lingzh/config.php

@@ -6,8 +6,8 @@ namespace refill\lingzh;
 
 class config
 {
-    const PAY_PHONE_URL = 'http://121.89.212.167/racc/index.php';
-    const QUERY_URL= 'http://121.89.212.167/racc/index.php';
+    const PAY_PHONE_URL = 'https://www.lzkj168.cn/racc/index.php';
+    const QUERY_URL= 'https://www.lzkj168.cn/racc/index.php';
     const USR= 9618;
     const KEY = 'fa0a841bdb424b6e1ac76148e9fdc7a8';
     const API_IP = NET_IP;

+ 7 - 6
mobile/control/merchant_info.php

@@ -64,14 +64,14 @@ class merchant_infoControl extends mbMerchantControl
         $max = 0;
         foreach ($statistics as $key => $val){
             if($max == 0){
-                $max = $val['count'];
+                $max = $val['successAmounts'];
 
             }
-            if((int)$max < $val['count']){
-                $max = $val['count'];
+            if($max < $val['count']){
+                $max = $val['successAmounts'];
             }
         }
-        $result['max'] = ceil($max * 1.1);
+        $result['max'] = ncPriceFormat(ceil($max * 1.1));
         $week_month_stats = $this->refillStats();
         $result['month'] = $week_month_stats['month'];
         $result['week'] = $week_month_stats['week'];
@@ -188,9 +188,10 @@ class merchant_infoControl extends mbMerchantControl
         };
         $date = date("Y-m-d");
         $first = 1;
-        $w = date('w',strtotime($date)); ;
+        $w = date('w',strtotime($date));
         $week_start = strtotime(date('Y-m-d',strtotime("$date -".($w ? $w - $first : 6).' days')));
-        $week_end = strtotime(date('Y-m-d',strtotime("$week_start +7 days"))) - 1;
+        $w = 7 - $w + 1;
+        $week_end = strtotime(date('Y-m-d',strtotime("+{$w} days"))) - 1;
         $week = $reader($this->mchid(), $week_start,$week_end);
 
         $month_start = strtotime(date("Y-m-1"));

+ 5 - 6
rdispatcher/proxy.php

@@ -49,14 +49,13 @@ class proxy
 
             if($fNotify)
             {
-                if($order_id === 0)
+                if ($order_id === 0)
                 {
-                    $order_info = $this->latest_order($refill_order,$mchid,$mch_order);
-                    if(empty($order_info)) {
+                    $order_info = $this->latest_order($refill_order, $mchid, $mch_order);
+                    if (empty($order_info)) {
                         $order_id = refill\RefillFactory::instance()->zero_order($mchid, $buyer_id, $amount, $card_no,
-                            $mch_order, $idcard, $card_name, $notify_url,$quality, $order_time, $commit_times,$errmsg);
-                    }
-                    else {
+                            $mch_order, $idcard, $card_name, $notify_url, $quality, $order_time, $commit_times, $errmsg);
+                    } else {
                         $order_id = $order_info['order_id'];
                     }
                 }

+ 9 - 2
test/TestRefill.php

@@ -18,7 +18,7 @@ require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
 const LocalTest = 1;
 const NetTest = 2;
 
-const CurrentTest = NetTest;
+const CurrentTest = LocalTest;
 
 class TestRefill extends TestCase
 {
@@ -232,6 +232,12 @@ class TestRefill extends TestCase
 //        refill\RefillFactory::instance()->notify('amingyd',$data);
     }
 
+    public function testChukaPhone()
+    {
+        $providers = new refill\chuka\RefillPhone([]);
+        $resp = $providers->add('18500608333', 5, 20, ['order_sn' => $this->make_sn()]);
+    }
+
     public function testWeisPhone()
     {
         $providers = new refill\weisyd\RefillPhone([]);
@@ -256,7 +262,8 @@ class TestRefill extends TestCase
     public function testAfandengPhone()
     {
         $providers = new refill\afandeng\RefillPhone([]);
-        $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
+        $resp = $providers->add(18500608333, 4, 50, ['order_sn' => $this->make_sn()]);
+//        $resp = $providers->query(['order_sn' => '83941616065521341004']);
     }