| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\admin\validate;
- class IpConfigValidate extends BaseValidate
- {
- /**
- * 设置校验规则
- * @var string[]
- */
- protected $rule = [
- 'id' => 'require',
- 'ip' => 'require|ip',
- 'type' => 'require|in:1,2',
- 'status' => 'integer|in:0,1',
- 'remark' => 'length:0,200',
- ];
-
- /**
- * 参数描述
- * @var string[]
- */
- protected $field = [
- 'id' => 'id',
- 'ip' => 'IP地址',
- 'type' => '类型',
- 'status' => '状态',
- 'remark' => '备注',
- ];
- /**
- * @notes 编辑场景
- */
- public function sceneEdit()
- {
- return $this->only(['ip', 'type', 'status', 'remark']);
- }
- public function sceneId()
- {
- return $this->only(['id']);
- }
- public function sceneStatus()
- {
- return $this->only(['id', 'field']);
- }
- }
|