Browse Source

Merge branch 'raccount' of 39.97.239.116:gyfl/xyzshop into raccount

stanley-king 3 năm trước cách đây
mục cha
commit
a762947869

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

@@ -38,6 +38,9 @@
     .scrollTable .fixed-bar {
         top: 115px!important;
     }
+    .tbodyd tr:last-child   {
+        margin-bottom: 550px;
+    }
 </style>
 <div class="page">
     <div class="fixed-bar">

+ 31 - 5
admin/templates/default/refill.order.index.php

@@ -537,7 +537,7 @@
                     <td class="align-center"><?php echo $order['commit_times']; ?></td>
                     <td class="align-center"><?php echo $order['org_quality_text']; ?></td>
                     <!--                    <td class="align-center">--><?php //echo $order['mch_amount']; ?><!--</td>-->
-                    <td class="align-center">
+                    <td class="align-center" id="Manual">
 
                         <?php if( ($order['order_state'] == ORDER_STATE_CANCEL || $order['order_state'] == ORDER_STATE_SUCCESS) && $order['is_retrying'] == 0){?>
                         <a class="covercolor" href="index.php?act=merchant&op=notify_merchant&order_id=<?php echo $order['order_id']; ?>">
@@ -545,16 +545,16 @@
                         <?php }?>
 
                         <?php if($order['order_state'] == ORDER_STATE_SEND){?>
-                            <a class="covercolor" href="index.php?act=merchant&op=notify_manual_merchant&type=cancel&order_id=<?php echo $order['order_id']; ?>">
+                            <a class="covercolor" id="cancel" order_id="<?php echo $order['order_id']; ?>" href="#">
                                 手动失败</a>
                             |
-                            <a class="covercolor" href="index.php?act=merchant&op=notify_manual_merchant&type=success&order_id=<?php echo $order['order_id']; ?>">
+                            <a class="covercolor" id="success" order_id="<?php echo $order['order_id']; ?>" href="#">
                                 手动成功</a>
                         <?php }?>
 
                         <?php if($order['card_type'] == mtopcard\ThirdRefillCard){?>
                             |
-                            <a class="covercolor" href="#" class="examine" data-order="<?php echo $order['order_id']; ?>">
+                            <a class="covercolor" href="#" id="examine" data-order="<?php echo $order['order_id']; ?>">
                                 查看</a>
                         <?php }?>
                     </td>
@@ -589,7 +589,7 @@
 <script type="text/javascript">
     $(function () {
         //查看
-    $('.examine').click(function () {
+    $('#examine').click(function () {
       let order_id = $(this).attr('data-order')
       $.get('index.php?act=refill_order&op=refill_third_info',
         {
@@ -669,6 +669,32 @@
       }
     })
   })
+    // 手动失败 成功
+    $('#Manual #cancel').each(function (index, item) {
+        $(item).click(function () {
+            let order_id = $(this).attr("order_id")
+            layer.confirm('您确实要手动失败', {
+                btn: ['确定', '取消'],
+                title: '手动失败'
+            }, function () {
+                window.location.href = `index.php?act=merchant&op=notify_manual_merchant&type=cancel&order_id= ${order_id}`
+            }, function() {}
+            )
+        })
+    })
+    // 手动成功
+    $('#Manual #success').each(function (index, item) {
+        $(item).click(function () {
+            let order_id = $(this).attr("order_id")
+            layer.confirm('您确实要手动成功', {
+                btn: ['确定', '取消'],
+                title: '手动成功'
+            }, function () {
+                window.location.href = `index.php?act=merchant&op=notify_manual_merchant&type=success&order_id= ${order_id}`
+            }, function() {}
+            )
+        })
+    })
 
      // 获取不包含客户
     let selest_nc

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

@@ -126,11 +126,11 @@
                     <td class="align-center"><?php echo $order['quality_text']; ?></td>
                     <td class="align-center"><?php echo $order['org_quality_text']; ?></td>
 <!--                    <td class="align-center">--><?php //echo $order['mch_amount']; ?><!--</td>-->
-                    <td class="w144 align-center">
-                        <a href="index.php?act=refill_order_manual&op=notify_manual_merchant&type=cancel&order_id=<?php echo $order['order_id']; ?>">
+                    <td class="w144 align-center" id="Manual">
+                        <a id="cancel" order_id="<?php echo $order['order_id']; ?>" href="#">
                             手动失败</a>
                         |
-                        <a href="index.php?act=refill_order_manual&op=notify_manual_merchant&type=success&order_id=<?php echo $order['order_id']; ?>">
+                        <a id="success" order_id="<?php echo $order['order_id']; ?>" href="#">
                             手动成功</a>
                     </td>
 
@@ -173,5 +173,31 @@
                 $(this)[0].style.backgroundColor = '#fff'
             })
         })
+    // 手动失败 成功
+    $('#Manual #cancel').each(function (index, item) {
+        $(item).click(function () {
+            let order_id = $(this).attr("order_id")
+            layer.confirm('您确实要手动失败', {
+                btn: ['确定', '取消'],
+                title: '手动失败'
+            }, function () {
+                window.location.href = `index.php?act=refill_order_manual&op=notify_manual_merchant&type=cancel&order_id= ${order_id}`
+            }, function() {}
+            )
+        })
+    })
+    // 手动成功
+    $('#Manual #success').each(function (index, item) {
+        $(item).click(function () {
+            let order_id = $(this).attr("order_id")
+            layer.confirm('您确实要手动成功', {
+                btn: ['确定', '取消'],
+                title: '手动成功'
+            }, function () {
+                window.location.href = `index.php?act=refill_order_manual&op=notify_manual_merchant&type=success&order_id=  ${order_id}`
+            }, function() {}
+            )
+        })
+    })
     })
 </script> 

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

@@ -2395,38 +2395,38 @@ $guochuang_nation_phone = ['name' => 'guochuang_nation', 'store_id' => 121, 'qua
             ['goods_id' => 7054, 'price' => 4.124, 'quality' => 2, 'card_type' => 'chinaunicom']
         ],
         5  => [
-            ['goods_id' => 7055, 'price' => 5.205, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7055, 'price' => 5.255, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7055, 'price' => 5.155, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7055, 'price' => 5.205, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7055, 'price' => 5.255, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         6  => [
-            ['goods_id' => 7056, 'price' => 6.2064, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7056, 'price' => 6.2562, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7056, 'price' => 6.186, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7056, 'price' => 6.246, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7056, 'price' => 6.2562, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         7  => [
-            ['goods_id' => 7057, 'price' => 7.2072, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7057, 'price' => 7.2569, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7057, 'price' => 7.217, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7057, 'price' => 7.287, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7057, 'price' => 7.2569, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         8  => [
-            ['goods_id' => 7058, 'price' => 8.208, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7058, 'price' => 8.2584, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7058, 'price' => 8.248, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7058, 'price' => 8.328, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7058, 'price' => 8.2584, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         9  => [
-            ['goods_id' => 7059, 'price' => 9.2088, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7059, 'price' => 9.2592, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7059, 'price' => 9.279, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7059, 'price' => 9.369, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7059, 'price' => 9.2592, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         10 => [
-            ['goods_id' => 7060, 'price' => 10.24, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7060, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7060, 'price' => 10.26, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7060, 'price' => 10.045, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7060, 'price' => 10.26, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 7061, 'price' => 20.48, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7061, 'price' => 20.27, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7061, 'price' => 20.52, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7061, 'price' => 20.62, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],

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

@@ -2395,38 +2395,38 @@ $guochuang_nation_phone = ['name' => 'guochuang_nation', 'store_id' => 121, 'qua
             ['goods_id' => 7054, 'price' => 4.124, 'quality' => 2, 'card_type' => 'chinaunicom']
         ],
         5  => [
-            ['goods_id' => 7055, 'price' => 5.205, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7055, 'price' => 5.255, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7055, 'price' => 5.155, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7055, 'price' => 5.205, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7055, 'price' => 5.255, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         6  => [
-            ['goods_id' => 7056, 'price' => 6.2064, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7056, 'price' => 6.2562, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7056, 'price' => 6.186, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7056, 'price' => 6.246, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7056, 'price' => 6.2562, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         7  => [
-            ['goods_id' => 7057, 'price' => 7.2072, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7057, 'price' => 7.2569, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7057, 'price' => 7.217, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7057, 'price' => 7.287, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7057, 'price' => 7.2569, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         8  => [
-            ['goods_id' => 7058, 'price' => 8.208, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7058, 'price' => 8.2584, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7058, 'price' => 8.248, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7058, 'price' => 8.328, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7058, 'price' => 8.2584, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         9  => [
-            ['goods_id' => 7059, 'price' => 9.2088, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7059, 'price' => 9.2592, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7059, 'price' => 9.279, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7059, 'price' => 9.369, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7059, 'price' => 9.2592, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         10 => [
-            ['goods_id' => 7060, 'price' => 10.24, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7060, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7060, 'price' => 10.26, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7060, 'price' => 10.045, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7060, 'price' => 10.26, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 7061, 'price' => 20.48, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7061, 'price' => 20.27, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7061, 'price' => 20.52, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7061, 'price' => 20.62, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],

+ 13 - 13
data/config/xyzadm/refill.ini.php

@@ -2395,38 +2395,38 @@ $guochuang_nation_phone = ['name' => 'guochuang_nation', 'store_id' => 121, 'qua
             ['goods_id' => 7054, 'price' => 4.124, 'quality' => 2, 'card_type' => 'chinaunicom']
         ],
         5  => [
-            ['goods_id' => 7055, 'price' => 5.205, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7055, 'price' => 5.255, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7055, 'price' => 5.155, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7055, 'price' => 5.205, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7055, 'price' => 5.255, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         6  => [
-            ['goods_id' => 7056, 'price' => 6.2064, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7056, 'price' => 6.2562, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7056, 'price' => 6.186, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7056, 'price' => 6.246, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7056, 'price' => 6.2562, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         7  => [
-            ['goods_id' => 7057, 'price' => 7.2072, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7057, 'price' => 7.2569, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7057, 'price' => 7.217, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7057, 'price' => 7.287, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7057, 'price' => 7.2569, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         8  => [
-            ['goods_id' => 7058, 'price' => 8.208, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7058, 'price' => 8.2584, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7058, 'price' => 8.248, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7058, 'price' => 8.328, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7058, 'price' => 8.2584, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         9  => [
-            ['goods_id' => 7059, 'price' => 9.2088, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7059, 'price' => 9.2592, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7059, 'price' => 9.279, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 7059, 'price' => 9.369, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 7059, 'price' => 9.2592, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         10 => [
-            ['goods_id' => 7060, 'price' => 10.24, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7060, 'price' => 10.07, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7060, 'price' => 10.26, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7060, 'price' => 10.045, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7060, 'price' => 10.26, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         20 => [
-            ['goods_id' => 7061, 'price' => 20.48, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7061, 'price' => 20.27, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 7061, 'price' => 20.52, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7061, 'price' => 20.62, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],

BIN
helper/refill/api/xyz/guochuang_nation/20211104电信.png


BIN
helper/refill/api/xyz/guochuang_nation/20211104移动.png


+ 4 - 1
helper/refill/api/xyz/yunling/RefillPhone.php

@@ -53,6 +53,9 @@ class RefillPhone extends refill\IRefillPhone
             $resultno = intval($resp['resultno']);
             if (in_array($resultno, [0,2])) {
                 return [true, $resp['orderid'], false];
+            } elseif (in_array($resultno, [5006, 9999])){
+                $net_errno = "HTTP-{$resultno}";
+                return [false, $resultno, true];
             } else {
                 return [false, $resultno, false];
             }
@@ -85,7 +88,7 @@ class RefillPhone extends refill\IRefillPhone
                 $order_state = ORDER_STATE_CANCEL;
             } elseif (in_array($resultno, [0,2])) {
                 $order_state = ORDER_STATE_SEND;
-            } elseif ($resultno === 5007) {
+            } elseif ($resultno === 5007 && (time() - $refill_info['commit_time'] >= 600)) {
                 $order_state = ORDER_STATE_NOEXIST;
             } else {
                 return [false, $resp['message']];

+ 4 - 2
helper/refill/api/xyz/yunlingfs/RefillPhone.php

@@ -50,6 +50,9 @@ class RefillPhone extends refill\IRefillPhone
             $resultno = intval($resp['resultno']);
             if (in_array($resultno, [0,2])) {
                 return [true, $resp['orderid'], false];
+            } elseif (in_array($resultno, [5006, 9999])){
+                $net_errno = "HTTP-{$resultno}";
+                return [false, $resultno, true];
             } else {
                 return [false, $resultno, false];
             }
@@ -73,7 +76,6 @@ class RefillPhone extends refill\IRefillPhone
             if (empty($resp)) {
                 return [false, '网络错误'];
             }
-
             $resultno = intval($resp['resultno']);
             if ($resultno === 1) {
                 $order_state = ORDER_STATE_SUCCESS;
@@ -83,7 +85,7 @@ class RefillPhone extends refill\IRefillPhone
                 $order_state = ORDER_STATE_CANCEL;
             } elseif (in_array($resultno, [0,2])) {
                 $order_state = ORDER_STATE_SEND;
-            } elseif ($resultno === 5007) {
+            } elseif ($resultno === 5007 && (time() - $refill_info['commit_time'] >= 600)) {
                 $order_state = ORDER_STATE_NOEXIST;
             } else {
                 return [false, $resp['message']];

+ 39 - 0
test/TestAccount.php

@@ -9,6 +9,7 @@ define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
 require_once(BASE_ROOT_PATH . '/global.php');
 require_once(BASE_CORE_PATH . '/lrlz.php');
 require_once(BASE_ROOT_PATH . '/fooder.php');
+require_once(BASE_HELPER_PATH . '/PHPExcel/PHPExcel.php');
 
 class TestAccount extends TestCase
 {
@@ -64,5 +65,43 @@ class TestAccount extends TestCase
 
         return $total_amount;
     }
+
+    public function testImportRefill()
+    {
+        $filename = BASE_ROOT_PATH . "/data/upload/recharge.xls";
+        if(!file_exists($filename)) {
+            Log::record("{$filename} not exists.",Log::ERR);
+            return false;
+        }
+        $fileType = PHPExcel_IOFactory::identify($filename);
+        $objReader = PHPExcel_IOFactory::createReader($fileType);
+        $objPHPExcel = $objReader->load($filename);
+
+        foreach ($objPHPExcel->getWorkSheetIterator() as $sheet)
+        {
+            foreach ($sheet->getRowIterator() as $row)
+            {
+                $index = $row->getRowIndex();
+                if ($index == 1) continue;
+                $items = [];
+                foreach ($row->getCellIterator() as $cell) {
+                    $items[] = $cell->getValue();
+                }
+                $card_no = intval($items[0]);
+                $amount = $items[1];
+            }
+        }
+    }
+
+    public function testFopenRefill()
+    {
+        $fn = fopen(BASE_ROOT_PATH . "/data/upload/recharge.xls", "r");
+
+        while (!feof($fn)) {
+            $line = trim(fgets($fn));
+        }
+
+        fclose($fn);
+    }
 }
 //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestAccount::testLog)( .*)?$/" --test-suffix TestAccount.php /var/www/html/test