summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/postgre
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-12-14 12:05:05 +0100
committerAndrey Andreev <narf@devilix.net>2016-12-14 12:05:05 +0100
commit867e8b56f752116fe1feae6c6db19020100458e3 (patch)
tree0b25fcb5cb6f2b9580db61dbe4e76e7ba6255536 /system/database/drivers/postgre
parent56d1efc5b14d7bd5a92800ba9394bf9201d48b61 (diff)
parent25aab832ff5b064166b5af4f5c4269407c56b338 (diff)
Merge branch '3.1-stable' into develop
Diffstat (limited to 'system/database/drivers/postgre')
-rw-r--r--system/database/drivers/postgre/postgre_driver.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index c7c827ea4..5cc6a421c 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -544,13 +544,13 @@ class CI_DB_postgre_driver extends CI_DB {
$ids = array();
foreach ($values as $key => $val)
{
- $ids[] = $val[$index];
+ $ids[] = $val[$index]['value'];
foreach (array_keys($val) as $field)
{
if ($field !== $index)
{
- $final[$field][] = 'WHEN '.$val[$index].' THEN '.$val[$field];
+ $final[$val[$field]['field']][] = 'WHEN '.$val[$index]['value'].' THEN '.$val[$field]['value'];
}
}
}
@@ -558,12 +558,12 @@ class CI_DB_postgre_driver extends CI_DB {
$cases = '';
foreach ($final as $k => $v)
{
- $cases .= $k.' = (CASE '.$index."\n"
+ $cases .= $k.' = (CASE '.$val[$index]['field']."\n"
.implode("\n", $v)."\n"
.'ELSE '.$k.' END), ';
}
- $this->where($index.' IN('.implode(',', $ids).')', NULL, FALSE);
+ $this->where($val[$index]['field'].' IN('.implode(',', $ids).')', NULL, FALSE);
return 'UPDATE '.$table.' SET '.substr($cases, 0, -2).$this->_compile_wh('qb_where');
}