50 lines
1.2 KiB
PHP
Executable File
50 lines
1.2 KiB
PHP
Executable File
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | 宏驰云科技开发团队 版权所有 拥有最终解释权
|
|
// +----------------------------------------------------------------------
|
|
|
|
// | Author: HcyShop-kiki
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\admin\validate;
|
|
|
|
use think\Validate;
|
|
use think\Db;
|
|
|
|
class ScreenPrice extends Validate
|
|
{
|
|
|
|
protected $rule = [
|
|
'id' => 'require',
|
|
'name' => 'require|unique:screen_size,name^del',
|
|
'start_price'=>'require',
|
|
'end_price'=>'require',
|
|
'is_show'=>'require'
|
|
];
|
|
|
|
protected $message = [
|
|
'id.require' => 'id不可为空',
|
|
'name.require' => '名称不能为空!',
|
|
'name.unique' => '名称已存在',
|
|
'start_price.require'=>'开始价格不能空',
|
|
'end_price.require'=>'结束价格不能为空',
|
|
'is_show.require'=>'请选择显示状态'
|
|
];
|
|
protected function sceneAdd()
|
|
{
|
|
$this->only(['name','start_price','end_price']);
|
|
|
|
}
|
|
|
|
protected function sceneEdit()
|
|
{
|
|
$this->only(['id','name'])
|
|
->remove('id');
|
|
}
|
|
|
|
public function sceneDel()
|
|
{
|
|
$this->only(['id']);
|
|
}
|
|
|
|
} |