123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace app\admin\validate\life;
- use think\Validate;
- class CinemaValidate extends Validate
- {
- protected $rule = [
- 'cinema_name' => 'require|max:20',
- 'cinema_id' => 'require',
- 'cinema_mold' => 'require',
- 'cinema_director' => 'require',
- 'cinema_price' => 'require',
- 'cinema_star' => 'require',
- 'cinema_introduction' => 'require',
- 'cinema_performers' => 'require',
- // 'cinema_video' => 'require',
- ];
- protected $message = [
- 'cinema_id.require' => '影片ID不能为空',
- 'cinema_name.require' => '影片名称不能为空',
- // 'cinema_video.require'=> '影片视频不能为空',
- 'cinema_mold.require' => '影片类型id不能为空',
- 'cinema_name.max' => '影片名称不能超过20字',
- 'cinema_director.require' => '影片导演不能为空',
- 'cinema_price.require' => '影片价格不能为空',
- 'cinema_star.require' => '影片主演不能为空',
- 'cinema_introduction.require' => '影片简介不能为空',
- 'cinema_performers.require' => '影片演职人员不能为空',
- ];
- //场景
- protected $scene = [
- 'create' => ['cinema_name','cinema_mold','cinema_director','cinema_price','cinema_star','cinema_introduction','cinema_performers'],
- 'update' => ['cinema_id'],
- 'info' => ['cinema_id']
- ];
- }
|