1234567891011121314151617181920212223242526 |
- <?php /** Created by Anton on 04.02.2020. */
- require '../yiiInit.php';
- $userId = Yii::$app->request->get('userId');
- $query = new \yii\db\Query();
- $query->select('tlog.tmc, t.employee as user, ttmc.title, tlog.issue_date')
- ->from(\app\models\entity\UserDevice::tableName() . ' t')
- ->leftJoin(\app\models\entity\Log::tableName() . ' tlog', 't.phone = tlog.id or t.camera = tlog.id or t.oil_meter = tlog.id')
- ->leftJoin(\app\models\entity\Tmc::tableName() . ' ttmc', 'ttmc.id = tlog.tmc')
- ->where(['t.employee' => $userId])
- ;
- $devices = $query->all();
- ?>
- <br>
- <h5>Выданные устройства:</h5>
- <?php if (!$devices): ?>
- <p><t class="loco_grey">Пользователю не выдано устройств</t></p>
- <?php endif; ?>
- <?php foreach ($devices as $device): ?>
- <p>
- <t class="loco_grey"><?= $device['title'] ?></t>
- <t class="loco_grey" style="float:right"><?= $device['issue_date'] ?></t>
- </p>
- <?php endforeach;
|