stanley-king 4 年 前
コミット
c05748cf9d
3 ファイル変更22 行追加249 行削除
  1. 1 1
      data/logic/queue.logic.php
  2. 0 247
      test/TestAddData.php
  3. 21 1
      test/TestMemberCard.php

+ 1 - 1
data/logic/queue.logic.php

@@ -1105,7 +1105,7 @@ class queueLogic
         $topcard = Model('topcard');
         $cards = $topcard->get_card($card_no);
         if(empty($cards))
-        {//卡不存在
+        {   //卡不存在
             //查询1000内是否有卡
             $items = $topcard->get_cards($card_no - 500,$card_no + 500);
             if(!empty($items)) {

+ 0 - 247
test/TestAddData.php

@@ -225,237 +225,6 @@ class TestAddData extends TestCase
         }
     }
 
-    public function test20200821_addCard()
-    {
-        $files = ['fen-p-200.xlsx','fen-p-500.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200902_addCard()
-    {
-        $files = ['fen-p-100-1.xlsx','fen-p-100-2.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-
-    public function test20200902_1_addCard()
-    {
-        $files = ['100-494-643.xlsx','200-779144-193.xlsx','200-779294-343.xlsx','500-794-843.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200903_addCard()
-    {
-        $files = ['100-895-943.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200904_addCard()
-    {
-        $files = ['100-644-743.xlsx','100-844-893.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200904_1_addCard()
-    {
-        $files = ['200-344-353.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200904_2_addCard()
-    {
-        $files = ['200-344-393.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200904_3_addCard()
-    {
-        $files = ['200-344-393.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200904_4_addCard()
-    {
-        $files = ['100-344-443.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-
-    public function test20200905_addCard()
-    {
-        $files = ['200-8344-8443.xlsx' , '100-144-243.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-
-    public function test20200905_1_addCard()
-    {
-        $files = ['100-294-343.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200905_2_addCard()
-    {
-        $files = ['200-244-343.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200905_3_addCard()
-    {
-        $files = ['100-669944-669993-670044-670093.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200906_addCard()
-    {
-        $files = ['200-807944-808043.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200906_1_addCard()
-    {
-        $files = ['100-1900000000669994-1900000000670043.xlsx' ,
-            '100-670844-893.xlsx' ,
-            '200-1900000000808194-1900000000808243.xlsx' ,
-            'p100-670-644-693.xlsx' ,
-            'p100-670894-943.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200907_addCard()
-    {
-        $files = ['p-100-670-544-593.xlsx',
-            'p-100-670-594-643.xlsx',
-            'p-100-670694-793.xlsx',
-            'p-100-670794-843.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-
-    public function test20200907_1_addCard()
-    {
-        $files = ['p200-807944-808043.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-
-    public function test20200908_addCard()
-    {
-        $files = ['话费100元670号段444-543.xlsx',
-                  '话费200元808系列094-143.xlsx',
-                  '话费200元808系列344-443.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200909_addCard()
-    {
-        $files = ['200元话费808系列895-943.xlsx','话费100元669列594-693.xlsx','话费100元669号段794-943.xlsx','话费100元699系列444-543.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-
-    public function test20200909_1_addCard()
-    {
-        $files = ['话费200元808系列444-543.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200910_addCard()
-    {
-        $files = ['100元话费669系列394-443.xlsx','100元话费699系列544-593.xlsx','200元话费808系列693-743.xlsx',
-                  '200元话费808系列744-843zn.xlsx','200元话费808系列844-893.xlsx','话费100元669号段694-793.xlsx',
-                  '话费200元808系列544-643.xlsx','话费100元668号段094-193zn.xlsx','话费100元 668号段444-493zn.xlsx'];
-
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200916_addCard()
-    {
-        $files = ['100元668044——093.xlsx','话费100元670系列094-143.xlsx',
-            '话费200元779244——779293.xlsx','话费200元808系列044-093.xlsx','话费200元808系列144-193.xlsx'];
-
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200917_addCard()
-    {
-        $files = ['加油1000元569202——250.xlsx','加油1000元569251——300.xlsx','话费100元670系列244-293.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200918_addCard()
-    {
-        $files = ['200元810344——443.xlsx','加油1000元569301——500(200张).xlsx',
-            '话费100元670系列244-293.xlsx',
-            '话费200元809系列944-810系列143.xlsx','话费200元810系列144-343.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200926_addCard()
-    {
-        $files = ['100元话费669系列144-293.xlsx','100元话费669系列294-393卡.xlsx',
-            '100元话费669系列394-443 50张.xlsx','100元话费669系列544-593 50张.xlsx',
-            '话费100元669系列444-543.xlsx','加油卡1000元569系列071-150.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200927_addCard()
-    {
-        $files = ['加油卡1000元569系列51-70.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-
-    public function test20200927_01_addCard()
-    {
-        $files = ['500油卡264851-950.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-
-
-    public function test20200928_addCard()
-    {
-        $files = ['liumin500油卡264651-750.xlsx','加油卡500元264系列751-850.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20200928_01_addCard()
-    {
-        $files = ['668 944-043.xlsx','话费100元 669号段044-143.xlsx','加油卡200元备用卡124251——124300.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-
     public function testCardSequence()
     {
         $card_key = Model('card_key');
@@ -588,22 +357,6 @@ class TestAddData extends TestCase
         }
     }
 
-
-    public function test20201013_addCard()
-    {
-        $files = ['p100-671594-671643.xlsx','话费100元671794-671843.xlsx','话费100元671844-671943.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-    public function test20201013_01_addCard()
-    {
-        $files = ['话费100元671系列444-493.xlsx','话费100元671系列494-593.xlsx','话费100元671系列644-693.xlsx','话费100元671系列694-793.xlsx'];
-        foreach ($files as $file) {
-            $this->addFile($file);
-        }
-    }
-
     public function testAddCard()
     {
         $finder = function ()

+ 21 - 1
test/TestMemberCard.php

@@ -363,9 +363,29 @@ class TestMemberCard extends TestCase
         vrorder_helper::extend_order_info($order);
     }
 
-    public function testStrict()
+    public function testAnalyseBuyer()
     {
+        $finder = function () {
+            $mid_amounts = [];
+            $path = BASE_DATA_PATH . "/cards/userids.txt";
+            $file = fopen($path,'r');
+            if(!is_resource($file)) {
+                Log::record(__METHOD__ . " {$path} file is not exist",Log::ERR);
+                return $mid_amounts;
+            }
+
+            while(!feof($file)) {
+                $line = fgets($file);
+                $kv = preg_split('/,/',$line);
+                if(count($kv) != 2) continue;
+                $mid_amounts[] = ['mid' => intval($kv[0]),'amount' => intval($kv[1])];
+            }
+            fclose($file);
+
+            return $mid_amounts;
+        };
     }
 }
 
+//docker-compose -f ./docker-compose-dev.yum run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestMemberCard::testAddMemberYearCard)( .*)?$/" --test-suffix TestMemberCard.php /var/www/html/test
 //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestMemberCard::testAddMemberYearCard)( .*)?$/" --test-suffix TestMemberCard.php /var/www/html/test