igfs/app/modules/module_shop/controllers/KernelShopRestController.php
2024-12-18 12:46:57 +03:00

27 lines
584 B
PHP

<?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());
}
}