27 lines
735 B
PHP
27 lines
735 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
namespace app\backend\validate;
|
|
|
|
use think\Validate;
|
|
|
|
class Ad extends Validate
|
|
{
|
|
protected $rule = [
|
|
'title' => 'require|max:200',
|
|
'type' => 'in:1,2,3',
|
|
'position' => 'in:home_top,home_side,popup,list_bottom,home_bottom,content_top,content_bottom,sidebar,float',
|
|
'content' => 'require',
|
|
'url' => 'max:255',
|
|
'image' => 'max:255',
|
|
'sort' => 'number',
|
|
'status' => 'in:0,1',
|
|
];
|
|
|
|
protected $message = [
|
|
];
|
|
|
|
protected $scene = [
|
|
'add' => ['title', 'type', 'position', 'content', 'url', 'image', 'sort', 'status'],
|
|
'edit' => ['title', 'type', 'position', 'content', 'url', 'image', 'sort', 'status'],
|
|
];
|
|
} |