},
],
[
- 'label' => 'Отработанное время',
'attribute' => 'work_time',
+ 'format' => 'raw',
+ 'value' => function ($model) {
+ return intval($model->work_time);
+ },
],
[
'label' => 'Дата смены',
'format' => 'raw',
'value' => function ($model) {
if (!empty($model->checkin_end_id)) {
- return !empty($photo = $model->checkinStart->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+ return !empty($photo = $model->checkinEnd->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
};
},
],
<h1><?= Html::encode($this->title) ?></h1>
<p>
-<!-- --><?php //= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
-<!-- --><?php //= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [
-// 'class' => 'btn btn-danger',
-// 'data' => [
-// 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
-// 'method' => 'post',
-// ],
-// ]) ?>
+ <!-- --><?php //= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
+ <!-- --><?php //= Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], [
+ // 'class' => 'btn btn-danger',
+ // 'data' => [
+ // 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
+ // 'method' => 'post',
+ // ],
+ // ]) ?>
</p>
<?= DetailView::widget([
return Yii::$app->formatter->asDatetime($model->time_end, 'php:H:i:s');
},
],
- 'work_time',
+ [
+ 'attribute' => 'work_time',
+ 'format' => 'raw',
+ 'value' => function ($model) {
+ return intval($model->work_time);
+ },
+ ],
[
'attribute' => 'is_opening',
'format' => 'raw',
[
'attribute' => 'admin_group_id',
'value' => function ($data) {
- return $data->shift->name;
+ return !empty($data->shift_id) ? $data->shift->name : null;
}
],
[
'label' => 'Отметка о начале',
'format' => 'raw',
'value' => function ($model) {
- return !empty($photo = $model->checkinStart->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+ if (!empty($model->checkin_start_id)) {
+ return !empty($photo = $model->checkinStart->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+ };
},
],
[
'label' => 'Отметка о конце',
'format' => 'raw',
'value' => function ($model) {
- return !empty($photo = $model->checkinEnd->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+ if (!empty($model->checkin_end_id)) {
+ return !empty($photo = $model->checkinEnd->photo) ? Html::img($photo, ['alt' => 'selfie', 'height' => '100px']) : null;
+ };
},
- ],
- ],
- ]) ?>
+ ]
+ ]
+ ]);
+ ?>
</div>