123456789101112131415161718192021222324252627282930 |
- <?php
- namespace app\admin\validate\coupon;
- use support\Validate;
- class CouponValidate extends Validate
- {
- /**
- * 规则
- * @var string[]
- */
- protected $rule = [
- 'coupon_id' => 'require|alphaDash',
- 'coupon_status|优惠券状态' => 'require|in:ACTIVED,DISABLED',
- 'coupon_category|分类' => 'max:32',
- 'coupon_name|名称' => 'require|max:32',
- 'coupon_begindate|启用日期' => 'require',
- 'coupon_enddate|过期时间' => 'require',
- ];
- /**
- * 场景
- * @var array[]
- */
- protected $scene = [
- 'add' => ['coupon_status', 'coupon_category', 'coupon_name', 'coupon_begindate', 'coupon_enddate'],
- 'update' => ['coupon_id', 'coupon_status', 'coupon_category', 'coupon_name', 'coupon_begindate', 'coupon_enddate'],
- ];
- }
|