Bladeren bron

auto clear order and pd_log

stanley-king 3 jaren geleden
bovenliggende
commit
89f260d3c0

+ 14 - 3
crontab/control/date.php

@@ -18,7 +18,8 @@ require_once(BASE_DATA_PATH . '/mobile/omsid.php');
 require_once(BASE_HELPER_PATH . '/stat_helper.php');
 require_once(BASE_HELPER_PATH . '/message/publisher.php');
 
-
+require_once(BASE_HELPER_PATH . '/refill/ops/order_clear.php');
+require_once(BASE_HELPER_PATH . '/refill/ops/pdlog_clear.php');
 
 class dateControl extends BaseCronControl
 {
@@ -110,10 +111,20 @@ class dateControl extends BaseCronControl
         stat_helper::onDaiyBehavior(time() - 86400);
     }
 
-    public function forth_clockOp()
+    public function refill_clearOp()
     {
+        $end_date = strtotime(date('Y-m-d',time()));
+        $start_date  = $end_date - 86400;
+
+        $clear = new refill\order_clear();
+        $clear->clear($start_date,$end_date);
+
+        $sDate = date('Y-m-d',$start_date);
         $refill = new statistics\stat_refill();
-        $refill->run();
+        $refill->restat([$sDate]);
+
+        $clear = new refill\pdlog_clear();
+        $clear->clear($start_date,$end_date);
     }
 
     public function merchant_daytimeOp()

+ 1 - 1
docker/compose/lz/conf/crontab/root

@@ -6,7 +6,7 @@
 0	3	*	*	6	run-parts /etc/periodic/weekly
 0	5	1	*	*	run-parts /etc/periodic/monthly
 #0   3   *   *   *   php /var/www/html/crontab/index.php date index
-0   4   *   *   *   php /var/www/html/crontab/index.php date forth_clock
+0   1   *   *   *   php /var/www/html/crontab/index.php date refill_clear
 #0   9   *   *   *   php /var/www/html/crontab/index.php date nine_clock
 #0   10  *   *   *   php /var/www/html/crontab/index.php date ten_clock
 *    *   *   *   *   php /var/www/html/crontab/index.php minutes index

+ 2 - 2
docker/compose/xyz/conf/crontab/slave_root

@@ -6,7 +6,7 @@
 #0	3	*	*	6	run-parts /etc/periodic/weekly
 #0	5	1	*	*	run-parts /etc/periodic/monthly
 #0   3   *   *   *   php /var/www/html/crontab/index.php date index
-#0   4   *   *   *   php /var/www/html/crontab/index.php date forth_clock
+#0   1   *   *   *   php /var/www/html/crontab/index.php date refill_clear
 #0   9   *   *   *   php /var/www/html/crontab/index.php date nine_clock
 #0   10  *   *   *   php /var/www/html/crontab/index.php date ten_clock
 #0   10-20/1 *   *   *   php /var/www/html/crontab/index.php hour index
@@ -15,7 +15,7 @@
 #0   0    *   *   *   php /var/www/html/crontab/index.php date merchant_available
 
 */1    *   *   *   *   php /var/www/html/crontab/index.php minutes update_channel_balance
-0   4   *   *   *   php /var/www/html/crontab/index.php date forth_clock
+0   1   *   *   *   php /var/www/html/crontab/index.php date refill_clear
 1   0   *   *   *   php /var/www/html/crontab/index.php date merchant_nightime
 1   6   *   *   *   php /var/www/html/crontab/index.php date merchant_daytime
 0   0    *   *   *   php /var/www/html/crontab/index.php date merchant_available

+ 1 - 1
docker/compose/xyzip/conf/crontab/root

@@ -6,7 +6,7 @@
 0	3	*	*	6	run-parts /etc/periodic/weekly
 0	5	1	*	*	run-parts /etc/periodic/monthly
 #0   3   *   *   *   php /var/www/html/crontab/index.php date index
-0   4   *   *   *   php /var/www/html/crontab/index.php date forth_clock
+0   1   *   *   *   php /var/www/html/crontab/index.php date refill_clear
 #0   9   *   *   *   php /var/www/html/crontab/index.php date nine_clock
 #0   10  *   *   *   php /var/www/html/crontab/index.php date ten_clock
 *    *   *   *   *   php /var/www/html/crontab/index.php minutes index

+ 1 - 1
docker/compose/xyzt/conf/crontab/root

@@ -6,7 +6,7 @@
 0	3	*	*	6	run-parts /etc/periodic/weekly
 0	5	1	*	*	run-parts /etc/periodic/monthly
 #0   3   *   *   *   php /var/www/html/crontab/index.php date index
-0   4   *   *   *   php /var/www/html/crontab/index.php date forth_clock
+0   1   *   *   *   php /var/www/html/crontab/index.php date refill_clear
 #0   9   *   *   *   php /var/www/html/crontab/index.php date nine_clock
 #0   10  *   *   *   php /var/www/html/crontab/index.php date ten_clock
 *    *   *   *   *   php /var/www/html/crontab/index.php minutes index

+ 1 - 1
docker/conf/crontab/root

@@ -1,7 +1,7 @@
 # do daily/weekly/monthly maintenance
 # min	hour	day	month	weekday	command
 #0   3   *   *   *   php /var/www/html/crontab/index.php date index
-0   4   *   *   *   php /var/www/html/crontab/index.php date forth_clock
+0   1   *   *   *   php /var/www/html/crontab/index.php date refill_clear
 #0   9   *   *   *   php /var/www/html/crontab/index.php date nine_clock
 #0   10  *   *   *   php /var/www/html/crontab/index.php date ten_clock
 *    *   *   *   *   php /var/www/html/crontab/index.php minutes index

+ 19 - 1
test/TestRefillCommand.php

@@ -9,7 +9,9 @@ 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_ROOT_PATH . '/helper/statistics/stat_refill.php');
+
+require_once(BASE_HELPER_PATH . '/refill/ops/order_clear.php');
+require_once(BASE_HELPER_PATH . '/refill/ops/pdlog_clear.php');
 
 class TestRefillCommand extends TestCase
 {
@@ -27,4 +29,20 @@ class TestRefillCommand extends TestCase
         $refill = new statistics\stat_refill();
         $refill->restat($dates);
     }
+
+    public function testCurDate()
+    {
+        $end_date = strtotime(date('Y-m-d',time()));
+        $start_date  = $end_date - 86400;
+
+        $clear = new refill\order_clear();
+        $clear->clear($start_date,$end_date);
+
+        $sDate = date('Y-m-d',$start_date);
+        $refill = new statistics\stat_refill();
+        $refill->restat([$sDate]);
+
+        $clear = new refill\pdlog_clear();
+        $clear->clear($start_date,$end_date);
+    }
 }