<?php
namespace app\admin\validate\life;

use think\Validate;

class BookCourseValidate extends Validate
{
    protected $rule =   [
        'course_name'  => 'require|max:20',
        'course_id'    => 'require',
        'course_time' => 'require',
        'course_book_id' => 'require',
        'course_price' => 'require',
        'course_status' => 'require',
    ];

    protected $message  =   [
        'course_id.require' => '课程目录ID不能为空',
        'course_name.require' => '课程目录名称不能为空',
        'course_time.require'   => '上课时间不能为空',
        'course_name.max'  => '课程目录名称不能超过20字',
        'course_book_id.require' => '所属课程id不能为空',
        'course_price.require' => '课程目录价格不能为空',
        'course_status.require' => '课程目录状态不能为空',
    ];

    //场景
    protected $scene = [
        'create'   => ['course_name','course_time','course_book_id','course_price','course_status'],
        'update'   => ['course_id','course_name','course_time','course_book_id','course_price','course_status'],
        'info'     => ['course_id']
    ];
}
