|
|
@@ -103,6 +103,9 @@ class Producer extends ActiveRecordCommon |
|
|
|
{ |
|
|
|
return [ |
|
|
|
[['name','type'], 'required'], |
|
|
|
[['tiller_provider_token','tiller_restaurant_token'], 'required', 'when' => function($model) { |
|
|
|
return $model->tiller == true ; |
|
|
|
}], |
|
|
|
[['order_deadline', 'order_delay'], 'integer'], |
|
|
|
['order_deadline', 'in', 'range' => [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]], |
|
|
|
['order_delay', 'in', 'range' => [1, 2, 3, 4, 5, 6, 7]], |
|
|
@@ -113,8 +116,8 @@ class Producer extends ActiveRecordCommon |
|
|
|
$this->addError($attribute, 'Ce code est déjà utilisé par un autre producteur.'); |
|
|
|
} |
|
|
|
}], |
|
|
|
[['description','mentions','gcs','order_infos','slug','secret_key_payplug','background_color_logo','option_behavior_cancel_order'], 'string'], |
|
|
|
[['negative_balance', 'credit', 'active','online_payment','user_manage_subscription', 'option_allow_user_gift','use_credit_checked_default'], 'boolean'], |
|
|
|
[['description','mentions','gcs','order_infos','slug','secret_key_payplug','background_color_logo','option_behavior_cancel_order','tiller_provider_token','tiller_restaurant_token'], 'string'], |
|
|
|
[['negative_balance', 'credit', 'active','online_payment','user_manage_subscription', 'option_allow_user_gift','use_credit_checked_default','tiller'], 'boolean'], |
|
|
|
[['name', 'siret', 'logo', 'photo', 'postcode', 'city', 'code','type','credit_functioning','option_behavior_cancel_order'], 'string', 'max' => 255], |
|
|
|
[['free_price', 'credit_limit_reminder','credit_limit'], 'double'], |
|
|
|
['free_price', 'compare', 'compareValue' => 0, 'operator' => '>=', 'type' => 'number', 'message' => 'Prix libre doit être supérieur ou égal à 0'], |
|
|
@@ -157,6 +160,9 @@ class Producer extends ActiveRecordCommon |
|
|
|
'use_credit_checked_default' => 'Cocher par défaut l\'option "Utiliser mon crédit" lors de la commande de l\'utilisateur', |
|
|
|
'background_color_logo' => 'Couleur de fond du logo', |
|
|
|
'option_behavior_cancel_order' => 'Comportement lors de la suppression d\'une commande', |
|
|
|
'tiller' => 'Tiller', |
|
|
|
'tiller_provider_token' => 'Token provider', |
|
|
|
'tiller_restaurant_token' => 'Token restaurant', |
|
|
|
]; |
|
|
|
} |
|
|
|
|