excel_handle/app/model/CrontabT.php

24 lines
445 B

<?php
namespace app\model;
use crontab\CronParser;
use think\Model;
/**
* Class CrontabT
* @property string $crontab_str
* @package crontab
*/
class CrontabT extends Model
{
public function getNextRunDate()
{
if (!CronParser::check($this->crontab_str)) {
return ['code' => 0, 'msg' => "格式错误: {$this->crontab_str}"];
}
return CronParser::formatToDate($this->crontab_str, 1)[0];
}
}