stanley-king пре 2 година
родитељ
комит
6d1a166ccf
3 измењених фајлова са 9 додато и 7 уклоњено
  1. 2 2
      data/config/dev/base.ini.php
  2. 4 3
      helper/refill/ops/order_clear.php
  3. 3 2
      test/TestRefillClear.php

+ 2 - 2
data/config/dev/base.ini.php

@@ -55,14 +55,14 @@ if(SSH_TUNEL_PROD ==='local') {
     $config['db'][1]['dbport']       = '3306';
     $config['db'][1]['dbuser']       = 'root';
     $config['db'][1]['dbpwd']        = '55668899';
-    $config['db'][1]['dbname']       = 'ylshop';
+    $config['db'][1]['dbname']       = 'xyzshop';
     $config['db'][1]['dbcharset']    = 'UTF-8';
 
     $config['db']['slave'][0]['dbhost']     = SLAVE_DBHOST;
     $config['db']['slave'][0]['dbport']     = '3306';
     $config['db']['slave'][0]['dbuser']     = 'root';
     $config['db']['slave'][0]['dbpwd']      = '55668899';
-    $config['db']['slave'][0]['dbname']     = 'ylshop';
+    $config['db']['slave'][0]['dbname']     = 'xyzshop';
     $config['db']['slave'][0]['dbcharset']  = 'UTF-8';
 }
 elseif(SSH_TUNEL_PROD === 'xyz') {

+ 4 - 3
helper/refill/ops/order_clear.php

@@ -29,12 +29,13 @@ class order_clear
                 $i++;
 
                 if(empty($items)) break;
+
+                $last_item = end($items);
+                $order_id = intval($last_item['order_id']);
                 foreach ($items as $item) {
+                    unset($item['order_id']);
                     yield $item;
                 }
-
-                $order_id = end($items);
-
             }
         };
 

+ 3 - 2
test/TestRefillClear.php

@@ -23,10 +23,11 @@ class TestRefillClear extends TestCase
     //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillClear::testOrderClear)( .*)?$/" --test-suffix TestRefillClear.php /var/www/html/test
     public function testOrderClear()
     {
-        $start_date = strtotime('2021-09-11');
-        $end_date   = strtotime('2022-01-01');
+        $start_date = strtotime('2022-10-01');
+        $end_date   = strtotime('2022-10-02');
         $clear = new refill\order_clear();
         $clear->clear($start_date,$end_date);
+
     }
 
     //docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillClear::testOrderClearYL)( .*)?$/" --test-suffix TestRefillClear.php /var/www/html/test