|
|
|
|
|
|
|
|
* @property integer $id_point_sale |
|
|
* @property integer $id_point_sale |
|
|
* @property integer $id_distribution |
|
|
* @property integer $id_distribution |
|
|
* @property boolean $auto_payment |
|
|
* @property boolean $auto_payment |
|
|
|
|
|
* @property integer $id_subscription |
|
|
*/ |
|
|
*/ |
|
|
class Order extends ActiveRecordCommon |
|
|
class Order extends ActiveRecordCommon |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
return [ |
|
|
return [ |
|
|
[['id_user', 'date', 'id_point_sale', 'id_distribution'], 'required', 'message' => ''], |
|
|
[['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'], |
|
|
[['auto_payment'], 'boolean'], |
|
|
[['date', 'date_update', 'comment', 'comment_point_sale'], 'safe'] |
|
|
[['date', 'date_update', 'comment', 'comment_point_sale'], 'safe'] |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
'date_update' => 'Date de modification', |
|
|
'date_update' => 'Date de modification', |
|
|
'id_point_sale' => 'Point de vente', |
|
|
'id_point_sale' => 'Point de vente', |
|
|
'id_distribution' => 'Date de distribution', |
|
|
'id_distribution' => 'Date de distribution', |
|
|
|
|
|
'id_subscription' => 'Abonnement', |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
return $this->hasMany(CreditHistory::className(), ['id_order' => 'id']); |
|
|
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. |
|
|
* Retourne les options de base nécessaires à la fonction de recherche. |