30 lines
		
	
	
		
			556 B
		
	
	
	
		
			PHP
		
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			556 B
		
	
	
	
		
			PHP
		
	
	
	
| <?php
 | |
| declare (strict_types=1);
 | |
| 
 | |
| namespace app\validate\admin;
 | |
| 
 | |
| use think\Validate;
 | |
| 
 | |
| 
 | |
| /**
 | |
|  * @author canny
 | |
|  * @date 2023/10/20 14:57
 | |
|  **/
 | |
| class ProductValidate extends Validate
 | |
| {
 | |
|     protected $rule = [
 | |
|         'id' => 'require|integer',
 | |
|         'name|资产名称' => 'require',
 | |
|         'unit|规格单位' => 'require',
 | |
|     ];
 | |
| 
 | |
|     public function sceneCreate(): \think\Validate
 | |
|     {
 | |
|         return $this->only(['name', 'unit']);
 | |
|     }
 | |
| 
 | |
|     public function sceneUpdate(): \think\Validate
 | |
|     {
 | |
|         return $this->only(['name', 'unit', 'id']);
 | |
|     }
 | |
| } |