kernel update

This commit is contained in:
2024-12-18 12:46:57 +03:00
parent 653e0bc983
commit 4ff9fa9ad3
56 changed files with 1023 additions and 84 deletions

View File

@ -0,0 +1,27 @@
<?php
namespace app\modules\module_shop\controllers;
use app\modules\module_shop\models\ModuleShop;
use JetBrains\PhpStorm\NoReturn;
use kernel\helpers\Debug;
use kernel\Request;
use kernel\RestController;
class KernelShopRestController extends RestController
{
public function __construct()
{
$this->model = new ModuleShop();
}
#[NoReturn] public function actionUpdate($id): void
{
$model = $this->model->where("id", $id)->first();
$model->installations++;
$model->save();
$this->renderApi($model->toArray());
}
}