|
@@ -48,11 +48,8 @@ class UpdateHbForm extends BaseForm
|
|
|
{
|
|
{
|
|
|
return [
|
|
return [
|
|
|
[['id'], 'required', 'message' => '红包ID不能为空'],
|
|
[['id'], 'required', 'message' => '红包ID不能为空'],
|
|
|
-
|
|
|
|
|
- [['remark'], 'default', 'value' => ''],
|
|
|
|
|
- [['remark'], 'filter', 'filter' => 'trim'],
|
|
|
|
|
-
|
|
|
|
|
[['id'], 'integer', 'min' => 1, 'tooSmall' => '红包ID参数错误'],
|
|
[['id'], 'integer', 'min' => 1, 'tooSmall' => '红包ID参数错误'],
|
|
|
|
|
+
|
|
|
[['status'], 'in', 'range' => [-1, 0, 1], 'message' => '红包状态不正确'],
|
|
[['status'], 'in', 'range' => [-1, 0, 1], 'message' => '红包状态不正确'],
|
|
|
[['beginTime', 'endTime', 'willTime'], 'integer', 'min' => 0, 'tooSmall' => '{attribute}必须大于等于0'],
|
|
[['beginTime', 'endTime', 'willTime'], 'integer', 'min' => 0, 'tooSmall' => '{attribute}必须大于等于0'],
|
|
|
[['duration'], 'integer', 'min' => 0, 'max' => 3650, 'tooSmall' => '有效天数必须大于等于0', 'tooBig' => '有效天数过大'],
|
|
[['duration'], 'integer', 'min' => 0, 'max' => 3650, 'tooSmall' => '有效天数必须大于等于0', 'tooBig' => '有效天数过大'],
|
|
@@ -60,12 +57,14 @@ class UpdateHbForm extends BaseForm
|
|
|
[['amount'], 'number', 'min' => 0.01, 'tooSmall' => '{attribute}不能小于0.01'],
|
|
[['amount'], 'number', 'min' => 0.01, 'tooSmall' => '{attribute}不能小于0.01'],
|
|
|
[['minConsume'], 'number', 'min' => 0.00, 'tooSmall' => '{attribute}不能小于0'],
|
|
[['minConsume'], 'number', 'min' => 0.00, 'tooSmall' => '{attribute}不能小于0'],
|
|
|
|
|
|
|
|
|
|
+ [['remark'], 'default', 'value' => ''],
|
|
|
|
|
+ [['remark'], 'filter', 'filter' => 'trim'],
|
|
|
[['remark'], 'string'],
|
|
[['remark'], 'string'],
|
|
|
|
|
|
|
|
//[['orderId'], 'default', 'value' => 0],
|
|
//[['orderId'], 'default', 'value' => 0],
|
|
|
[['orderId'], 'integer', 'min' => 1],
|
|
[['orderId'], 'integer', 'min' => 1],
|
|
|
[['orderId'], 'required', 'when' => function ($model) {
|
|
[['orderId'], 'required', 'when' => function ($model) {
|
|
|
- return $model->status == '0';
|
|
|
|
|
|
|
+ return $model->status == 0;
|
|
|
}, 'message' => '订单ID不能为空'],
|
|
}, 'message' => '订单ID不能为空'],
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|