'string|max:20', 'coupon_id' => 'required|integer|gt:0', 'page' => 'integer|gte:0', 'limit' => 'integer|gte:0', ]; } // 场景列表 protected $scenes = [ 'get_product' => ['coupon_id','page','limit'], ]; /** * 获取已定义验证规则的错误消息 * * @return array */ public function messages() { return [ 'coupon_id.required' => '请选择优惠券', 'coupon_id.integer' => '优惠券ID格式错误', 'coupon_id.gt' => '优惠券ID格式错误', 'page.integer' => '页码格式错误', 'page.gte' => '页码格式错误', 'limit.integer' => '取数格式错误', 'limit.gte' => '取数格式错误', ]; } }