| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace mall\models\homePageConfig;
- use mall\models\BaseForm;
- /**
- * 首页模块「更多」商品列表分页
- */
- class GetSectionGoodsForm extends BaseForm
- {
- public $moduleKey;
- public $page;
- public $pageSize;
- /** 合法模块 key */
- const MODULE_KEYS = ['seckill', 'groupBuy', 'hot', 'new', 'pullGoods'];
- public function rules()
- {
- return [
- ['moduleKey', 'required', 'message' => '请选择模块'],
- ['moduleKey', 'in', 'range' => self::MODULE_KEYS, 'message' => '无效模块'],
- ['page', 'default', 'value' => 1],
- ['pageSize', 'default', 'value' => 10],
- ['page', 'integer', 'min' => 1, 'message' => '页码格式错误', 'tooSmall' => '页码格式错误'],
- ['pageSize', 'integer', 'min' => 1, 'max' => 100,
- 'message' => '每页数量格式错误',
- 'tooSmall' => '每页数量格式错误',
- 'tooBig' => '每页数量不能超过100',
- ],
- ];
- }
- public function attributeLabels()
- {
- return [
- 'moduleKey' => '模块',
- 'page' => '页码',
- 'pageSize' => '每页数量',
- ];
- }
- }
|