12345678910111213141516171819202122 |
- <?php /** Created by Anton on 15.02.2020. */
- use yii\db\Query;
- use app\models\entity\Tmc;
- use app\models\entity\Storage;
- require '../yiiInit.php';
- $inventoryNum = (int)Yii::$app->request->post('num');
- $query = new Query();
- $query->select('ts.title')
- ->from(Tmc::tableName() . ' tt')
- ->leftJoin(Storage::tableName() . ' ts', 'tt.storage = ts.id')
- ->where(['inventory_num' => $inventoryNum])
- ;
- $result = $query->one();
- if ($result) {
- echo $result['title'];
- } else {
- echo '404';
- }
|