|
@@ -81,6 +81,37 @@ class stat_refill
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public function restat($dates)
|
|
|
+ {
|
|
|
+ $deleter = function ($daystamp)
|
|
|
+ {
|
|
|
+ Model('')->table('refill_stats')->where(['time_stamp' => $daystamp])->delete();
|
|
|
+ };
|
|
|
+
|
|
|
+ $flag = strtotime('2021-01-01');
|
|
|
+ foreach ($dates as $date)
|
|
|
+ {
|
|
|
+ $time = strtotime($date);
|
|
|
+ $date = date('Ymd',$time);
|
|
|
+ $daystamp = strtotime($date);
|
|
|
+ if($daystamp < $flag) continue;
|
|
|
+
|
|
|
+ $deleter($daystamp);
|
|
|
+ $order_count = $this->system_stat($daystamp,'notify_time');
|
|
|
+ if ($order_count > 0) {
|
|
|
+ $this->merchant_stat($daystamp,'notify_time');
|
|
|
+ $this->provider_stat($daystamp,'notify_time');
|
|
|
+ }
|
|
|
+
|
|
|
+ $order_count = $this->system_stat($daystamp,'order_time');
|
|
|
+ if ($order_count > 0) {
|
|
|
+ $this->merchant_stat($daystamp,0,'order_time');
|
|
|
+ $this->provider_stat($daystamp,0,'order_time');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private function system_stat($day_time, $order_time_type='notify_time')
|
|
|
{
|
|
|
$end_time = $day_time + stat_refill::DaySecs;
|