@@ -12,7 +12,7 @@ class refill_statsModel extends Model
public function latest_record_time()
{
- return $this->field('*')->where(['stat_id' => ['gt', 0], 'type' => 'system'])->order('stat_id desc')->limit(0)->find();
+ return $this->field('*')->where(['stat_id' => ['gt', 0], 'type' => 'system'])->order('time_stamp desc')->limit(0)->find();
}
public function getStatsInfo($condition = [], $fields = '*', $master = false, $lock = false)
@@ -21,15 +21,13 @@ class TestRefillCommand extends TestCase
//docker-compose run -d phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefillCommand::testRefillStat)( .*)?$/" --test-suffix TestRefillCommand.php /var/www/html/test
public function testRefillStat()
- $dates = ['2022-01-05',
- '2022-01-06',
- '2022-01-07',
- '2022-01-08',
- '2022-01-09',
+ $dates = [
'2022-01-10',
'2022-01-11',
'2022-01-12',
- '2022-01-14'];
+ '2022-01-14',
+ '2022-01-15'
+ ];
$refill = new statistics\stat_refill();
$refill->restat($dates);