first commit

This commit is contained in:
2023-11-21 19:51:44 +03:00
commit b87eb71ca7
254 changed files with 15630 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<?php
namespace frontend\controllers;
use common\models\Order;
/**
* Product controller
*/
class OrderController extends BaseApiController
{
public function actionGetAll()
{
return Order::find()
->where(['user_id' => \Yii::$app->user->id])
->select(['id', 'strength', 'amount', 'table_id'])
->orderBy(['created_at' => SORT_DESC])
->with([
'table' => function (\yii\db\ActiveQuery $query) {
$query->select(['id', 'name']);
},
'products' => function (\yii\db\ActiveQuery $query) {
$query->select(['id', 'taste']);
},
])
->asArray()
->all();
}
}