优化插件更新逻辑

This commit is contained in:
技术老胡
2024-09-05 15:26:03 +08:00
parent ce65756874
commit 461f574b9d
15 changed files with 84 additions and 73 deletions

View File

@@ -16,6 +16,6 @@ class IndexController
}
public function test()
{
return runtime_path();
return request()->domain();
}
}

View File

@@ -13,10 +13,7 @@ class OrderController extends BaseController
public function index()
{
$servertime = date('Y-m-d H:i:s', time());
// 加载配置文件
$option = \think\facade\Config::load("extendconfig/platform", 'extendconfig');
View::assign('servertime', $servertime);
View::assign('options', $option);
return View::fetch();
}
public function showOrder()

View File

@@ -234,6 +234,8 @@ class PayController
} else {
return '监听收款配置文件名错误';
}
// 当前站点
$user_config['host'] = \request()->domain();
// 实例化支付类
$Mpay = new \MpayClass($user_config);
// 获取订单

View File

@@ -15,9 +15,6 @@ class PayManageController extends BaseController
{
public function index()
{
// 加载配置文件
$option = \think\facade\Config::load("extendconfig/platform", 'extendconfig');
View::assign('options', $option);
return View::fetch();
}
// 编辑账号
@@ -25,11 +22,8 @@ class PayManageController extends BaseController
{
$id = $this->request->get('id');
$account = PayAccount::find($id);
// 加载配置文件
$option = \think\facade\Config::load("extendconfig/platform", 'extendconfig');
View::assign([
'id' => $id,
'options' => $option,
'platform' => $account->getData('platform'),
'account' => $account->account,
'password' => $account->password,
@@ -41,9 +35,6 @@ class PayManageController extends BaseController
// 添加账号
public function addAccount()
{
// 加载配置文件
$option = \think\facade\Config::load("extendconfig/platform", 'extendconfig');
View::assign(['options' => $option]);
return View::fetch();
}
// 添加收款终端

View File

@@ -31,4 +31,10 @@ class PluginController extends BaseController
return json(\backMsg(1, '失败'));
}
}
// 插件选项
public function pluginOption()
{
$option = Platform::field('platform,name')->where('state', 1)->select();
return json($option);
}
}