kernel update
This commit is contained in:
@ -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());
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user