| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\controllers;
- use app\modules\admin\models\PluginForm;
- class PluginController extends BaseController
- {
- /**
- * 插件列表
- */
- public function actionList() {
- // TODO:请求授权服务器,然后做缓存
- $pluginForm = new PluginForm();
- $pluginForm->store_id = get_store_id();
- $pluginForm->pageNo = (int)get_params('pageNo');
- $pluginForm->pageSize = (int)get_params('pageSize', \Yii::$app->params['pageSize']);
- return $this->asJson($pluginForm->getList());
- }
- /**
- * 状态更改
- */
- public function actionStatus() {
- $pluginForm = new PluginForm();
- $pluginForm->store_id = get_store_id();
- $pluginForm->id = post_params('id');
- $pluginForm->status = post_params('status');
- return $this->asJson($pluginForm->changeStatus());
- }
- /**
- * 下载安装
- */
- public function actionInstall() {
- $pluginForm = new PluginForm();
- $pluginForm->store_id = get_store_id();
- $pluginForm->key = post_params('key');
- $pluginForm->version = post_params('version');
- $pluginForm->main_version = post_params('main_version');
- $pluginForm->is_can_install = post_params('is_can_install');
- return $this->asJson($pluginForm->install());
- }
- /**
- * 更新
- */
- public function actionUpdate() {
- $pluginForm = new PluginForm();
- $pluginForm->store_id = get_store_id();
- $pluginForm->key = post_params('key');
- $pluginForm->version = post_params('version');
- $pluginForm->main_version = post_params('main_version');
- $pluginForm->is_can_update = post_params('is_can_update');
- return $this->asJson($pluginForm->update());
- }
- /**
- * 卸载
- */
- public function actionUninstall() {
- $pluginForm = new PluginForm();
- $pluginForm->store_id = get_store_id();
- $pluginForm->id = post_params('id');
- $pluginForm->status = post_params('status');
- return $this->asJson($pluginForm->changeStatus());
- }
- }
|