// +---------------------------------------------------------------------- namespace app\validate\admin; use think\Validate; class StoreActivityValidate extends Validate { protected $failException = true; protected $rule = [ "activity_name|活动名称" => 'require', "start_time|开始时间" => "require", "end_time|结束时间" => "require|checkEndTime", ]; protected function checkEndTime($value) { if (strtotime($value) <= time()) { return '结束时间必须大于当前时间'; } return true; } }