think-orm

This commit is contained in:
2025-08-15 10:51:00 +08:00
parent b461dab6fb
commit dc60b38526
27 changed files with 169 additions and 49 deletions

View File

@@ -75,7 +75,7 @@ class Ajax extends Backend
public function getDatabaseConnectionList(): void
{
$quickSearch = $this->request->get("quickSearch/s", '');
$connections = config('database.connections');
$connections = config('think-orm.connections');
$desensitization = [];
foreach ($connections as $key => $connection) {
$connection = TableManager::getConnectionConfig($key);

View File

@@ -22,7 +22,7 @@ class Alioss extends Backend
if(empty($file)) {
$this->error('参数不能为空');
}
$commoninfo = Db::connect(config('database.search_library'));
$commoninfo = Db::connect(config('think-orm.search_library'));
$endpoint = $commoninfo->name('common_info')->where(['type' => 68])->find()['value'];
$accessKeyId = $commoninfo->name('common_info')->where(['type' => 69])->find()['value'];
$secretAccessKey = $commoninfo->name('common_info')->where(['type' => 70])->find()['value'];
@@ -54,7 +54,7 @@ class Alioss extends Backend
'Content-Encoding' => 'binary',
];
$res = $ossClient->putObject($bucket, $object, $content, $options);
Log::write('上传文件结果' . json_encode($res));
Log::info('上传文件结果' . json_encode($res));
if(!empty($res['info'])) {
return $this->ApiDataReturn(['data' => $befor_url . '/' . $object, 'msg' => 'success', 'code' => 0]);
}else {
@@ -68,7 +68,7 @@ class Alioss extends Backend
// 获取阿里云oss存储相关配置
public function getCredentials()
{
$commoninfo = Db::connect(config('database.search_library'));
$commoninfo = Db::connect(config('think-orm.search_library'));
$configItems = $commoninfo->name('common_info')->whereIn('type', [66, 67, 69, 70])
->column('value', 'type');
AlibabaCloud::accessKeyClient($configItems[69], $configItems[70])

View File

@@ -38,7 +38,7 @@ class Common extends Backend
if(empty($get['num'])) {
$this->error('type 不能为空');
}
$data = convertToCamelCase(Db::connect(config('database.search_library'))->name('common_info')->where('type', $get['num'])->find());
$data = convertToCamelCase(Db::connect(config('think-orm.search_library'))->name('common_info')->where('type', $get['num'])->find());
$this->success('ok', $data);
}
}

View File

@@ -139,7 +139,7 @@ class Sys extends Backend
->where('t.title', '签到奖励')
->group('t.by_user_id');
})->count();
$v_db_name = config('database.connections.' . get_slave_connect_name() . '.database');
$v_db_name = config('think-orm.connections.' . get_slave_connect_name() . '.database');
$result = DatabaseRoute::paginateAllDbBySqlAutoCount(function () use($userId, $v_db_name) {
return "select
t1.by_user_id as userId,
@@ -181,7 +181,7 @@ class Sys extends Backend
{
$params = $this->request->get();
$keywords = $params['keywords'];
$v_db_name = config('database.connections.' . get_slave_connect_name() . '.database');
$v_db_name = config('think-orm.connections.' . get_slave_connect_name() . '.database');
$result = DatabaseRoute::paginateAllDb('tb_user', function ($query) use($keywords, $v_db_name) {
return $query->alias('t1')
->field([
@@ -219,7 +219,7 @@ class Sys extends Backend
from v_disc_spinning_record t1
where t1.user_id = ".$userId);
$count = $count[0]['count'];
$v_db_name = config('database.connections.' . get_slave_connect_name() . '.database');
$v_db_name = config('think-orm.connections.' . get_slave_connect_name() . '.database');
$result = DatabaseRoute::paginateAllDbBySqlAutoCount(function () use($userId, $v_db_name) {
return "select
t1.id,

View File

@@ -486,7 +486,7 @@ class Crud extends Backend
{
$table = $this->request->get('table');
$connection = $this->request->get('connection');
$connection = $connection ?: config('database.default');
$connection = $connection ?: config('think-orm.default');
$crudLog = Db::name('crud_log')
->where('table_name', $table)