add cover to torrent

This commit is contained in:
xiaomlove
2022-05-03 23:58:27 +08:00
parent 71d10de4c2
commit 130051d648
9 changed files with 144 additions and 28 deletions
+3 -3
View File
@@ -150,12 +150,12 @@ class NexusDB
public static function insert($table, $data)
{
if (!IN_NEXUS) {
return DB::table($table)->insertGetId($data);
}
if (empty($table) || empty($data) || !is_array($data)) {
throw new DatabaseException("require table and data(array).");
}
if (!IN_NEXUS) {
return DB::table($table)->insertGetId($data);
}
$fields = array_map(function ($value) {return "`$value`";}, array_keys($data));
$values = array_map(function ($value) {return sqlesc($value);}, array_values($data));
$sql = sprintf("insert into `%s` (%s) values (%s)", $table, implode(', ', $fields), implode(', ', $values));