stanley-king il y a 4 ans
Parent
commit
6cd5b67f60
3 fichiers modifiés avec 13 ajouts et 10 suppressions
  1. 3 2
      admin/control/merchant.php
  2. 8 8
      data/config/prod/refill.ini.php
  3. 2 0
      test/TestTime.php

+ 3 - 2
admin/control/merchant.php

@@ -174,7 +174,8 @@ class merchantControl extends SystemControl
         }else{
             $order_limit = unserialize($order_limit['data']);
         }
-        $default = function ($merchant) {
+
+        $initialiser = function ($merchant) {
             $amount = [
                 '100' => -1,
                 '200' => -1,
@@ -214,7 +215,7 @@ class merchantControl extends SystemControl
             if(array_key_exists($mchid , $order_limit)) {
                 $result[$mchid] = $order_limit[$mchid];
             }else{
-                $result[$mchid] = $default($merchant);
+                $result[$mchid] = $initialiser($merchant);
             }
             $start = $result[$mchid]['time'];
             $items = $reader($mchid,$start);

+ 8 - 8
data/config/prod/refill.ini.php

@@ -105,14 +105,14 @@ $bxtwt_phone = ['name' => 'bxtwt', 'store_id' => 10, 'card_type' => ['chinamobil
     'refill_type' => 'api'];
 
 $bjb_phone = ['name' => 'bjb', 'store_id' => 12, 'card_type' => ['chinamobile' ,'chinaunicom', 'chinatelecom'],
-    'amount' => [10 => ['goods_id' => 6305, 'price' => 9.55],
-        20 => ['goods_id' => 6306, 'price' => 19.1],
-        30 => ['goods_id' => 6301, 'price' => 28.65],
-        50 => ['goods_id' => 6302, 'price' => 47.75],
-        100 => ['goods_id' => 6303, 'price' => 95.5],
-        200 => ['goods_id' => 6304, 'price' => 191],
-        300 => ['goods_id' => 6327, 'price' => 286.5],
-        500 => ['goods_id' => 6328, 'price' => 477.5]],
+    'amount' => [10 => ['goods_id' => 6305, 'price' => 9.51],
+        20 => ['goods_id' => 6306, 'price' => 19.02],
+        30 => ['goods_id' => 6301, 'price' => 28.53],
+        50 => ['goods_id' => 6302, 'price' => 47.55],
+        100 => ['goods_id' => 6303, 'price' => 95.1],
+        200 => ['goods_id' => 6304, 'price' => 190.20],
+        300 => ['goods_id' => 6327, 'price' => 285.30],
+        500 => ['goods_id' => 6328, 'price' => 475.50]],
     'official_sn' => true, 'refill_type' => 'api'];
 
 $yifa_phone = ['name' => 'yifa', 'store_id' => 16, 'card_type' => ['chinamobile'],

+ 2 - 0
test/TestTime.php

@@ -126,9 +126,11 @@ class TestTime extends TestCase
     public function testFloat()
     {
         $t = intval("30.00" + 0.05);
+
         $x = 1.6;
         $y = 8;
         $t = $x == ($y - 6.4);
+        $z = $y - 6.4;
 
         $ta = round($x,2) == round($y - 6.4,2);
     }