Commit 2e734f1e authored by Liu lu's avatar Liu lu

兼容前缀

parent 7574a3c7
......@@ -74,7 +74,7 @@ abstract class BaseModel extends Model
$where_str = implode(',', $where_arr);
$sql = "";
if ($keys_str && $datas_str && $where_str) {
$table = $this->getTable();
$table = env('DB_PREFIX','').$this->getTable();
$sql = " INSERT INTO $table ( $keys_str ) VALUES $datas_str ON DUPLICATE KEY UPDATE $where_str";
}
unset($keys_str, $where_str);
......@@ -125,7 +125,7 @@ abstract class BaseModel extends Model
$sql = sprintf(
"UPDATE `%s` SET %s WHERE `%s` IN (%s) ",
$this->getTable(), $updates, $field, $fields
env('DB_PREFIX','').$this->getTable(), $updates, $field, $fields
);
return $this->getConnection()->update($sql);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment