1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace app\common\validate;
- use think\Db;
- use think\Validate;
- class SalaryApply extends Validate{
- protected $rule = [
- 'type|分类' => 'require|in:1,2,3,4,5,6,7,8,9',
- 'title|名称' => 'require',
- 'userids' => 'require|checkUser',
- 'cate|类型' => 'require|in:1,2,3,4,5',
- ];
- protected $message = [
- 'userids.require' => '未选择审核人员',
- ];
- protected $scene = [
- ];
- protected function checkUser($value,$rule,$data=[]){
- $users = explode(',',$value);
- $arr = [];
- foreach ($users as $v){
- if($v){
- $arr[] = $v;
- }
- }
- if(!$arr){
- return '未选择审核人员';
- }
- return true;
- }
- }
|