1234567891011121314151617181920212223242526272829 |
- <?php
- namespace app\api\validate;
- use think\Validate;
- class Goods extends Validate
- {
- /**
- * 验证规则
- */
- protected $rule = [
- 'orderby' => 'in:weigh,sales,price,views,comments',
- ];
- /**
- * 提示消息
- */
- protected $message = [
- 'orderby.in' => '排序字段只能是权重、销量、价格、浏览数或评论数',
- ];
- /**
- * 验证场景
- */
- protected $scene = [
- 'lists' => ['orderby'],
- ];
- }
|