public function getCreatedAdmin() {
return $this->hasOne(Admin::class, ['id' => 'created_admin_id']);
}
+
+
+ public function getStore() {
+ return $this->hasOne(CityStore::class, ['id' => 'store_id']);
+ }
}
'attributes' => [
'id',
'guid',
- 'status',
- 'store_id',
- 'store_guid',
+ [
+ 'format' => 'raw',
+ 'attribute' => 'status',
+ 'value' => function ($model) {
+ return $model->status == \yii_app\records\ReplacementInvoice::REPLACEMENT_ACTIONS ? 'Действия по замене' : $model->status;
+ }
+ ],
+ [
+ 'format' => 'raw',
+ 'attribute' => 'store_id',
+ 'value' => function ($model) {
+ return $model->store->name;
+ }
+ ],
'number',
'number_1c',
- 'date',
+ [
+ 'attribute' => 'date',
+ 'format' => 'datetime',
+ ],
'comment',
- 'created_at::datetime',
[
+ 'attribute' => 'created_at',
+ 'format' => 'datetime',
+ ],
+ [
+ 'format' => 'raw',
'attribute' => 'created_admin_id',
'value' => function ($model) {
return $model->createdAdmin->name_full;