Browse Source

Merge branch 'oilrun' into refill_queue

stanley-king 4 years ago
parent
commit
69544c3b59

+ 11 - 3
admin/control/merchant.php

@@ -614,9 +614,6 @@ class merchantControl extends SystemControl
         if (!empty($_GET['card_no'])) {
             $condition['refill_order.card_no'] = $_GET['card_no'];
         }
-        if (in_array($_GET['order_state'], ['0', '10', '20', '30', '40'])) {
-            $condition['vr_order.order_state'] = $_GET['order_state'];
-        }
         if (in_array($_GET['refill_amount'], ['10', '20', '30', '50' , '100', '200', '300', '500' , '1000', '20000'])) {
             $condition['refill_order.refill_amount'] = $_GET['refill_amount'];
         }
@@ -627,6 +624,17 @@ class merchantControl extends SystemControl
         if ($start_unixtime || $end_unixtime) {
             $condition['refill_order.order_time'] = ['time', [$start_unixtime, $end_unixtime]];
         }
+        if (in_array($_GET['order_state'], ['0', '10', '20', '30', '40'])) {
+            $condition['vr_order.order_state'] = $_GET['order_state'];
+            if($_GET['order_state'] == ORDER_STATE_SEND) {
+                if($_GET['time'] == 1){
+                    $condition['refill_order.order_time'] = ['between', [(time() - 3600) , (time() - 1800)]];
+                }
+                if($_GET['time'] == 2){
+                    $condition['refill_order.order_time'] = ['lt', (time() - 3600)];
+                }
+            }
+        }
         $merchant_list = Model('')->table('merchant')->select();
         foreach ($merchant_list as $key =>$value) {
             $merchants[$value['mchid']] = $value;

+ 38 - 7
admin/templates/default/refill.order.index.php

@@ -1,5 +1,7 @@
 <?php defined('InShopNC') or exit('Access Invalid!'); ?>
-
+<style>
+    a.ncsc-btn { font: normal 12px/20px "microsoft yahei"; text-decoration: none; color: #333; background-color: #F5F5F5; text-align: center; vertical-align: middle; display: inline-block; height: 16px; line-height: 16px; padding: 4px 10px; border: solid 1px; border-color: #DCDCDC #DCDCDC #B3B3B3 #DCDCDC; cursor: pointer;}
+</style>
 <div class="page">
     <div class="fixed-bar">
         <div class="item-title">
@@ -94,9 +96,23 @@
                                 <?php if ($_GET['refill_amount'] == '2000'){ ?>selected<?php } ?>>2000</option>
                     </select>
                 </td>
-                <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
-                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
-
+                <th><label>充值耗时</label></th>
+                <td>
+                    <select name="time" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="1"
+                                <?php if ($_GET['time'] == '1'){ ?>selected<?php } ?>>耗时半小时</option>
+                        <option value="2"
+                                <?php if ($_GET['time'] == '2'){ ?>selected<?php } ?>>耗时一小时</option>
+                    </select>
+                </td>
+                <td>
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;
+                    </a>
+                </td>
+                <td>
+                    <a href="#" class="ncsc-btn" onclick="hCopyChannel(event)"><i class="icon-edit"></i>拷贝渠道单号</a>
                 </td>
             </tr>
             </tbody>
@@ -144,7 +160,7 @@
             <th class="align-center"><?php echo $lang['nc_handle']; ?></th>
         </tr>
         </thead>
-        <tbody>
+        <tbody id="tbody">
         <?php if (count($output['order_list']) > 0) { ?>
             <?php
             foreach ($output['order_list'] as $key => $order) { ?>
@@ -159,7 +175,7 @@
                     <td class="align-right"><?php echo date('Y-m-d H:i:s', $order['order_time']); ?></td>
                     <td class="align-right">
                         <?php if(empty($order['notify_time'])) {
-                            if($order['diff_time'] > 1800 && $order['diff_time'] < 3600) {
+                            if($order['diff_time'] >= 1800 && $order['diff_time'] <= 3600) {
                         ?>
                                 <span style="color: #fd9d0e"><?php echo $order['diff_time_text']?></span>
                             <?php }elseif($order['diff_time'] > 3600) {?>
@@ -176,7 +192,7 @@
                     <td class="align-left"><?php echo $order['err_msg']; ?></td>
                     <td class="align-left"><?php echo $order['mch_order']; ?></td>
                     <td class="align-center"><?php echo $order['mch_amount']; ?></td>
-                    <td class="align-left"><?php echo $order['ch_trade_no']; ?></td>
+                    <td class="align-left" class="ch_trade_no"><?php echo $order['ch_trade_no']; ?></td>
                     <td class="align-center"><?php echo $order['channel_name']; ?></td>
                     <td class="w144 align-center">
                         <a href="index.php?act=merchant&op=notify_merchant&order_id=<?php echo $order['order_id']; ?>">
@@ -214,4 +230,19 @@
             $('#formSearch').submit();
         });
     });
+    function hCopyChannel(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let res = $(this).find('td').eq(14).text()
+            str += res + '\n'
+        })
+        let oInput = document.createElement("textarea");
+        oInput.style.border = "0 none";
+        oInput.style.color = "transparent";
+        oInput.value = str;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        oInput.parentNode.removeChild(oInput)
+    }
 </script> 

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

@@ -31,7 +31,7 @@ $config['chat_site_url'] 		= $SRV_HOST.'/chat';
 $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'
+    '13911129867' , '18500608333' , '18500350111' , '15136908757' , '18510995608'
 ];
 
 if(defined('USE_REMOTE_IMAGE') && USE_REMOTE_IMAGE == true) {

+ 14 - 6
helper/refill/RefillFactory.php

@@ -6,9 +6,6 @@ namespace refill;
 require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
 require_once(BASE_HELPER_PATH . '/rbridge/RBridgeFactory.php');
 
-require_once(BASE_ROOT_PATH . '/helper/message/msgutil.php');
-require_once(BASE_ROOT_PATH . '/helper/message/subscriber.php');
-
 require_once(BASE_HELPER_PATH . '/refill/IRefill.php');
 require_once(BASE_HELPER_PATH . '/refill/IRefillOil.php');
 require_once(BASE_HELPER_PATH . '/refill/IRefillPhone.php');
@@ -91,10 +88,15 @@ class RefillFactory
             self::$stInstance = new RefillFactory();
         }
 
-        if(StatesHelper::fetch_state('channel')) {
-            Log::record("RefillFactory reload channel config.",Log::DEBUG);
-            self::$stInstance->load();
+        if(defined('MOBILE_SERVER') && MOBILE_SERVER === true)
+        {
+            Log::record("MOBILE_SERVER defined call load",Log::DEBUG);
+            if(StatesHelper::fetch_state('channel')) {
+                Log::record("RefillFactory reload channel config.",Log::DEBUG);
+                self::$stInstance->load();
+            }
         }
+
         return self::$stInstance;
     }
 
@@ -104,6 +106,12 @@ class RefillFactory
 
     private function __construct()
     {
+        if (defined('MOBILE_SERVER') && MOBILE_SERVER === false) {
+            Log::record("MOBILE_SERVER defined dont call load",Log::DEBUG);
+        } else {
+            Log::record("MOBILE_SERVER has not defined and call load",Log::DEBUG);
+            $this->load();
+        }
     }
 
     public function goods()

+ 1 - 1
test/TestSms.php

@@ -45,7 +45,7 @@ class TestSms extends TestCase
 
         $merchants = Model('merchant')->getMerchantList([],'','','merchant.*,member.available_predeposit');
         foreach ($merchants as $merchant){
-            if($merchant['available_predeposit'] < $merchant['alarm_amount'] || $merchant['available_predeposit'] < 10000 && !empty($merchant['contact_phone']))
+            if(($merchant['available_predeposit'] < $merchant['alarm_amount'] && !empty($merchant['contact_phone']))|| $merchant['available_predeposit'] < 10000)
             {
                 QueueClient::push('sendSMS', ['mobile'=>$merchant['contact_phone'],'type'=>'balance_warning','datas' => [date("m月d日H时") , $merchant['available_predeposit']]]);
             }