mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
add cover to torrent
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user