|
|
@@ -53,6 +53,7 @@ use common\components\ActiveRecordCommon ; |
|
|
|
* @property integer $id_point_sale |
|
|
|
* @property integer $id_distribution |
|
|
|
* @property boolean $auto_payment |
|
|
|
* @property integer $id_subscription |
|
|
|
*/ |
|
|
|
class Order extends ActiveRecordCommon |
|
|
|
{ |
|
|
@@ -92,7 +93,7 @@ class Order extends ActiveRecordCommon |
|
|
|
{ |
|
|
|
return [ |
|
|
|
[['id_user', 'date', 'id_point_sale', 'id_distribution'], 'required', 'message' => ''], |
|
|
|
[['id_user', 'id_point_sale', 'id_distribution'], 'integer'], |
|
|
|
[['id_user', 'id_point_sale', 'id_distribution','id_subscription'], 'integer'], |
|
|
|
[['auto_payment'], 'boolean'], |
|
|
|
[['date', 'date_update', 'comment', 'comment_point_sale'], 'safe'] |
|
|
|
]; |
|
|
@@ -110,6 +111,7 @@ class Order extends ActiveRecordCommon |
|
|
|
'date_update' => 'Date de modification', |
|
|
|
'id_point_sale' => 'Point de vente', |
|
|
|
'id_distribution' => 'Date de distribution', |
|
|
|
'id_subscription' => 'Abonnement', |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
@@ -144,6 +146,12 @@ class Order extends ActiveRecordCommon |
|
|
|
{ |
|
|
|
return $this->hasMany(CreditHistory::className(), ['id_order' => 'id']); |
|
|
|
} |
|
|
|
|
|
|
|
public function getSubscription() |
|
|
|
{ |
|
|
|
return $this->hasOne(Subscription::className(), ['id' => 'id_subscription']) |
|
|
|
->with('productSubscription'); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Retourne les options de base nécessaires à la fonction de recherche. |