cmbYouku_Api/app/validate/admin/ProductValidate.php

30 lines
556 B
PHP
Raw Normal View History

2024-07-01 15:57:07 +08:00
<?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']);
}
}