123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- namespace app\admin\controller\system;
-
- use app\admin\logic\system\UpgradeLogic;
- use app\admin\validate\UpgradeValidate;
- use app\common\basics\AdminBase;
- use app\common\server\JsonServer;
-
-
- class Upgrade extends AdminBase
- {
-
-
-
- public function index()
- {
- if ($this->request->isAjax()) {
- $page = $this->request->get('page/d', $this->page_no);
- $size = $this->request->get('limit/d', $this->page_size);
- $data = UpgradeLogic::index($page, $size);
- return JsonServer::success('', $data);
- }
- return view();
- }
-
-
-
-
- public function choosePage()
- {
- return view();
- }
-
-
-
-
- public function handleUpgrade()
- {
- if ($this->request->isAjax()) {
- (new UpgradeValidate())->goCheck();
- $post = $this->request->post();
- $post['update_type'] = 1;
- $post['link'] = "package_link";
- $res = UpgradeLogic::upgrade($post);
- if (true === $res) {
- return JsonServer::success('更新成功');
- } else {
- return JsonServer::error(UpgradeLogic::getError() ?? '系统错误');
- }
- }
- return JsonServer::error('更新失败');
- }
-
-
-
-
- public function getPkg()
- {
- $post = $this->request->post();
- $res = UpgradeLogic::getPkgLine($post);
- if($res === false) {
- return JsonServer::error(UpgradeLogic::getError() ?? '系统错误');
- }
- return JsonServer::success('', $res);
- }
-
-
- }
|