[api] reward + thanks

This commit is contained in:
xiaomlove
2022-03-30 15:37:11 +08:00
parent b613a46b8d
commit 3e4a5766c4
38 changed files with 983 additions and 64 deletions
+45
View File
@@ -6,6 +6,7 @@ use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Database\Query\Expression;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
class NexusDB
{
@@ -286,6 +287,50 @@ class NexusDB
}
}
public static function cache_put($key, $value, $ttl = 3600)
{
if (IN_NEXUS) {
global $Cache;
return $Cache->cache_value($key, $value, $ttl);
} else {
return Cache::put($key, $value, $ttl);
}
}
public static function cache_get($key)
{
if (IN_NEXUS) {
global $Cache;
return $Cache->get_value($key);
} else {
return Cache::get($key);
}
}
public static function cache_del($key)
{
if (IN_NEXUS) {
global $Cache;
$Cache->delete_value($key, true);
} else {
Cache::forget($key);
$langList = get_langfolder_list();
foreach ($langList as $lf) {
Cache::forget($lf . '_' . $key);
}
}
}
public static function redis()
{
if (IN_NEXUS) {
global $Cache;
$Cache->getRedis();
} else {
Redis::connection()->client();
}
}
public static function getMysqlColumnInfo($table, $column)
{
static $driver;