123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\common\validate;
- use think\Validate;
- /**
- * 领用信息验证
- */
- class ApproveUse extends Validate
- {
- /**
- * 验证规则
- */
- protected $rule = [
- 'use_goods' => 'require',
- 'reason' => 'require',
- 'approve_user' => 'require',
- ];
- /**
- * 提示消息
- */
- protected $message = [
- ];
- /**
- * 验证场景
- */
- protected $scene = [
- 'create' => ['use_goods','approve_user'],
- 'update' => ['use_goods','approve_user'],
- 'edit' => ['use_goods'],
- ];
- /**
- * 构造函数
- * @access public
- * @param array $rules 验证规则
- * @param array $message 验证提示信息
- * @param array $field 验证字段描述信息
- */
- public function __construct(array $rules = [], $message = [], $field = [])
- {
- $this->field = [
- 'use_goods' => '领用物品',
- 'reason' => '物品用途',
- 'approve_user' => '审批人',
- ];
- $this->message = array_merge($this->message, [
- 'apply_goods.require' => '请添加领用物品',
- ]);
- parent::__construct($rules, $message, $field);
- }
- }
|