<?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];
    }
}