You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
24
hyhproject/admin/validate/Attributes.php
Executable file
24
hyhproject/admin/validate/Attributes.php
Executable file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace wstmart\admin\validate;
|
||||
use think\Validate;
|
||||
/**
|
||||
* ============================================================================
|
||||
* 属性验证器
|
||||
*/
|
||||
class Attributes extends Validate{
|
||||
protected $rule = [
|
||||
['attrName', 'require|max:60', '请输入属性名称|属性名称不能超过20个字符'],
|
||||
['attrType','in:0,1,2','请选择属性类型'],
|
||||
['attrVal','checkattrVal:1','请输入发票说明'],
|
||||
['isShow','in:0,1','请选择是否显示']
|
||||
];
|
||||
protected $scene = [
|
||||
'add'=>['attrName'],
|
||||
'edit'=>['attrName'],
|
||||
];
|
||||
protected function checkattrVal(){
|
||||
if(input('post.attrType/d')!=0 && input('post.attrVal')=='')return '请输入属性选项';
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user