|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
-
- namespace common\models;
-
- use common\components\ActiveRecordCommon;
- use Yii;
-
-
- class OrderStatusHistory extends ActiveRecordCommon
- {
-
-
- public static function tableName()
- {
- return 'order_status_history';
- }
-
-
-
- public function rules()
- {
- return [
- [['id_order', 'status', 'id_user', 'date', 'origin'], 'required'],
- [['id_order', 'id_user',], 'integer'],
- [['date'], 'safe'],
- ];
- }
-
-
-
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'id_order' => 'Commande',
- 'id_user' => 'Utilisateur',
- 'status' => 'Statut',
- 'origin' => 'Origine',
- 'date' => 'Date',
- ];
- }
-
-
-
-
- public function getOrder()
- {
- return $this->hasOne(User::className(), ['id' => 'id_order']);
- }
-
- public function getUser()
- {
- return $this->hasOne(User::className(), ['id' => 'id_user']);
- }
-
-
-
- public static function defaultOptionsSearch()
- {
- return [
- 'with' => [],
- 'join_with' => ['order', 'orderStatus'],
- 'orderby' => 'date ASC',
- 'attribute_id_producer' => ''
- ];
- }
- }
|