27 lines
		
	
	
		
			584 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			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());
 | |
|     }
 | |
| 
 | |
| } |