瀏覽代碼

save admin

ayHaru 4 年之前
父節點
當前提交
180b5d0c9f

+ 33 - 10
admin/control/merchant.php

@@ -654,6 +654,10 @@ class merchantControl extends SystemControl
             $condition['refill_order.channel_name'] = $_GET['channel_name'];
             unset($condition['refill_order.order_time']);
         }
+        if (!empty($_GET['store_id'])) {
+            $condition['vr_order.store_id'] = $_GET['store_id'];
+            unset($condition['refill_order.order_time']);
+        }
         if (!empty($_GET['card_type'])) {
             if(in_array($_GET['card_type'] , ['1' , '2' , '4' , '5' , '6'])) {
                 $condition['refill_order.card_type'] = $_GET['card_type'];
@@ -676,11 +680,11 @@ class merchantControl extends SystemControl
         if (in_array($_GET['refill_amount'], ['10', '20', '30', '50' , '100', '200', '300', '500' , '1000', '20000'])) {
             $condition['refill_order.refill_amount'] = $_GET['refill_amount'];
         }
-        $if_start_time = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $_GET['query_start_time']);
-        $if_end_time = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $_GET['query_end_time']);
-        $start_unixtime = $if_start_time ? strtotime($_GET['query_start_time']) : null;
-        $end_unixtime = $if_end_time ? strtotime($_GET['query_end_time']) : null;
-        if ($start_unixtime || $end_unixtime) {
+
+        $start_unixtime = strtotime($_GET['query_start_time']);
+        $end_unixtime = strtotime($_GET['query_end_time']);
+
+        if ($start_unixtime >0 && $end_unixtime >0) {
             $condition['refill_order.order_time'] = ['time', [$start_unixtime, $end_unixtime]];
         }
         if (in_array($_GET['order_state'], ['0', '10', '20', '30', '40'])) {
@@ -720,9 +724,11 @@ class merchantControl extends SystemControl
                 $order_list[$order_id]['diff_time'] = time() - $order_info['order_time'];
             }
         }
+        $provider_list = Model('')->table('refill_provider')->limit(100)->select();
         Tpl::output('stat', $stat[0]);
         Tpl::output('count', $count);
         Tpl::output('order_list', $order_list);
+        Tpl::output('provider_list', $provider_list);
         Tpl::output('show_page', $model_refill_order->showpage());
         Tpl::showpage('refill.order.index');
     }
@@ -759,6 +765,20 @@ class merchantControl extends SystemControl
         showMessage('操作成功', 'index.php?act=merchant&op=refill_order');
     }
 
+    public function providerStatsOp()
+    {
+        $provider_model = Model('refill_provider');
+        $condition = [];
+        $provider_list = $provider_model->getProviderList($condition, 100);
+        $opened_text = ['使用中', '已禁用'];
+        $type_text = ['油卡', '手机充值卡'];
+        Tpl::output('opened_text', $opened_text);
+        Tpl::output('type_text', $type_text);
+        Tpl::output('provider_list', $provider_list);
+        Tpl::output('show_page', $provider_model->showpage());
+        Tpl::showpage('provider.stats');
+    }
+
     public function providerOp()
     {
         $this->sync_cfgs();
@@ -771,7 +791,7 @@ class merchantControl extends SystemControl
         if (in_array($_GET['type'], [1, 2])) {
             $condition['type'] = $_GET['type'];
         }
-        $provider_list = $provider_model->getProviderList($condition, 25);
+        $provider_list = $provider_model->getProviderList($condition, 100);
         foreach ($provider_list as $key => $provider) {
             if(!empty($provider['start_period']) && !empty($provider['end_period'])){
                 $provider_list[$key]['period'] = $provider['start_period'] . '~' . $provider['end_period'];
@@ -801,20 +821,23 @@ class merchantControl extends SystemControl
 
         $match = function ($all,$cur)
         {
-            $insert = [];
+            $inserts = [];
             foreach ($all as $key => $value)
             {
+
                 if(!array_key_exists($key,$cur)) {
-                    $insert[] = $key;
+                    $insert['name'] = $key;
+                    $insert['store_id'] = $value['cfg']['store_id'];
+                    $inserts[] = $insert;
                 }
             }
-            return $insert;
+            return $inserts;
         };
 
         $inserter = function ($mod,$type,$names)
         {
             foreach ($names as $name) {
-                $data = ['name' => $name,'type' => $type];
+                $data = ['name' => $name['name'],'type' => $type,'store_id' => $name['store_id']];
                 $mod->insert($data);
             }
         };

+ 2 - 0
admin/templates/default/provider.index.php

@@ -63,6 +63,7 @@
                 <th>通道id</th>
                 <th>通道名称</th>
                 <th>通道类型</th>
+                <th>对应店铺ID</th>
                 <th class="align-center">排序</th>
                 <th class="align-center">通道状态</th>
                 <th class="align-center">每单间隔秒数</th>
@@ -79,6 +80,7 @@
                         <td><?php echo $v['provider_id']; ?></td>
                         <td><?php echo $v['name']; ?></td>
                         <td><?php echo $output['type_text'][$v['type']-1]; ?></td>
+                        <td><?php echo $v['store_id']; ?></td>
                         <td class="align-center"><?php echo $v['sort']; ?></td>
                         <td class="align-center">
                             <?php if($v['opened'] == 1){?>

+ 42 - 17
admin/templates/default/refill.order.index.php

@@ -19,24 +19,42 @@
         <table class="tb-type1 noborder search">
             <tbody>
             <tr>
-                <th><label>订单号</label></th>
+                <th><label>我方订单号</label></th>
                 <td><input class="txt2" type="text" name="order_sn" value="<?php echo $_GET['order_sn']; ?>"/></td>
-                <th><label>机构号</label></th>
+                <th><label>客户订单号</label></th>
+                <td><input class="txt2" type="text" name="mch_order" value="<?php echo $_GET['mch_order']; ?>"/></td>
+                <th><label>供方订单号</label></th>
+                <td><input class="txt2" type="text" name="ch_trade_no" value="<?php echo $_GET['ch_trade_no']; ?>"/></td>
+
+            </tr>
+            <tr>
+                <th><label>客户名称</label></th>
                 <td><input class="txt2" type="text" name="mchid" value="<?php echo $_GET['mchid']; ?>"/></td>
+                <th><label>供方名称</label></th>
+                <td>
+                    <select name="store_id" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <?php foreach($output['provider_list'] as $provider){?>
+                            <option value="<?php echo $provider['store_id']?>"
+                                    <?php if ($_GET['store_id'] == $provider['store_id']){ ?>selected<?php } ?>><?php echo $provider['name']?>
+                            </option>
+                        <?php }?>
+                    </select>
+                </td>
+            </tr>
+            <tr>
                 <th><label>充值卡卡号</label></th>
                 <td><input class="txt2" type="text" name="card_no" value="<?php echo $_GET['card_no']; ?>"/></td>
-                <th><label>渠道单号</label></th>
-                <td><input class="txt2" type="text" name="ch_trade_no" value="<?php echo $_GET['ch_trade_no']; ?>"/></td>
-                <th><label>商家单号</label></th>
-                <td><input class="txt2" type="text" name="mch_order" value="<?php echo $_GET['mch_order']; ?>"/></td>
             </tr>
             <tr>
+
                 <th><label for="query_start_time">下单时间</label></th>
-                <td><input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
-                           id="query_start_time" name="query_start_time">
+                <td>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                        id="startTime" name="query_start_time" autocomplete="off" />
                     <label for="query_start_time">~</label>
                     <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
-                           id="query_end_time" name="query_end_time"/></td>
+                           id="endTime" name="query_end_time" autocomplete="off"/></td>
                 <th><label>订单状态</label></th>
                 <td>
                     <select name="order_state" class="querySelect">
@@ -71,7 +89,7 @@
                                 <?php if ($_GET['card_type'] == 'phone'){ ?>selected<?php } ?>>手机费</option>
                     </select>
                 </td>
-                <th><label>充值额度</label></th>
+                <th><label>交易面额</label></th>
                 <td>
                     <select name="refill_amount" class="querySelect">
                         <option value=""><?php echo $lang['nc_please_choose']; ?></option>
@@ -105,10 +123,6 @@
                                 <?php if ($_GET['time'] == '2'){ ?>selected<?php } ?>>耗时一小时</option>
                     </select>
                 </td>
-                <th><label>渠道名称</label></th>
-                <td>
-                    <input class="txt2" type="text" name="channel_name" value="<?php echo $_GET['channel_name']; ?>"/>
-                </td>
                 <td>
                     <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
                        title="<?php echo $lang['nc_query']; ?>">&nbsp;
@@ -119,7 +133,7 @@
                 <td></td>
                 <td>
                     <a href="#" class="btns" onclick="hCopyChannel(event)">
-                        <span><i class="icon-edit"></i>拷贝渠道单号</span>
+                        <span><i class="icon-edit"></i>拷贝供方单号</span>
                     </a>
                     <a href="#" class="btns" onclick="hCopyCardNo(event)">
                         <span><i class="icon-edit"></i>拷贝充值卡号</span>
@@ -139,8 +153,9 @@
             <td>
                 <ul>
                     <li>总计充值金额:<?php echo $output['stat']['refill_amounts'] ?? 0?></li>
-<!--                    <li>总计渠道扣款金额:--><?php //echo $output['stat']['channel_amounts'] ?? 0?><!--</li>-->
-                    <li>总计机构扣款金额:<?php echo $output['stat']['mch_amounts'] ?? 0?></li>
+                    <li>总计供方扣款金额:<?php echo $output['stat']['channel_amounts'] ?? 0?></li>
+                    <li>总计客户扣款金额:<?php echo $output['stat']['mch_amounts'] ?? 0?></li>
+                    <li>总计利润:<?php echo ncPriceFormat($output['stat']['channel_amounts'] - $output['stat']['mch_amounts'])?></li>
                     <li>总计订单数量:<?php echo $output['stat']['order_count'] ?? 0?></li>
                     <li>超过半小时订单数量:<?php echo $output['count']['half_count'] ?? 0?></li>
                     <li>超过一小时订单数量:<?php echo $output['count']['hour_count'] ?? 0?></li>
@@ -233,6 +248,7 @@
         </tfoot>
     </table>
 </div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
 <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
 <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/i18n/zh-CN.js"
         charset="utf-8"></script>
@@ -246,6 +262,15 @@
             $('input[name="op"]').val('refill_order');
             $('#formSearch').submit();
         });
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
     });
     function hCopyChannel(e) {
         let str = ''

+ 20 - 0
data/resource/laydate/date.html

@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>Document</title>
+  <script src="./laydate.js"></script>
+</head>
+<body>
+  <input type="text" class="input" id="applytime" name="applytime"/>
+
+  <script>
+    laydate.render({
+     elem: '#applytime',  // 输出框id
+     type: 'datetime'
+    });
+  </script>
+</body>
+</html>

文件差異過大導致無法顯示
+ 2 - 0
data/resource/laydate/laydate.js


二進制
data/resource/laydate/theme/default/font/iconfont.eot


文件差異過大導致無法顯示
+ 45 - 0
data/resource/laydate/theme/default/font/iconfont.svg


二進制
data/resource/laydate/theme/default/font/iconfont.ttf


二進制
data/resource/laydate/theme/default/font/iconfont.woff


文件差異過大導致無法顯示
+ 2 - 0
data/resource/laydate/theme/default/laydate.css