1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace app\common\validate;
- use think\Db;
- use think\Validate;
- class AssetItems extends Validate{
- protected $rule = [
- 'title|名称' => 'require',
- 'price|原值' => 'require|egt:0',
- 'cate_id' => 'require|gt:0',
- 'class_id' => 'require|gt:0',
- 'unit_id' => 'require|gt:0',
- 'add_id' => 'require|gt:0',
- 'buy_time' => 'require|date',
- 'nums' => 'require|gt:0',
- ];
- protected $message = [
- 'price.require' => '请填写物品单价',
- 'price.egt' => '单价不能小于0',
- 'nums.require' => '数量不能为负值',
- 'nums.egt' => '数量不能为负值',
- 'cate_id.require' => '请选择物品分类',
- 'cate_id.gt' => '请选择物品分类',
- 'unit_id.require' => '请选择物品单位',
- 'unit_id.gt' => '请选择物品单位',
- 'buy_time.require' => '请选择购买日期',
- 'buy_time.date' => '购买日期格式不正确',
- 'class_id.require' => '请选择类别',
- 'class_id.gt' => '请选择类别',
- 'add_id.require' => '请选择增加方式',
- 'add_id.gt' => '请选择增加方式',
- ];
- protected $scene = [
- ];
- }
|