mv q() to DBA::p()
This commit is contained in:
parent
15cdfdd414
commit
34932e12bf
|
@ -88,23 +88,22 @@ class UserExport extends BaseSettingsModule
|
|||
$table = $match[1];
|
||||
|
||||
$result = [];
|
||||
$r = q($query);
|
||||
if (DBA::isResult($r)) {
|
||||
foreach ($r as $rr) {
|
||||
$p = [];
|
||||
foreach ($rr as $k => $v) {
|
||||
switch ($dbStructure[$table]['fields'][$k]['type']) {
|
||||
case 'datetime':
|
||||
$p[$k] = $v ?? DBA::NULL_DATETIME;
|
||||
break;
|
||||
default:
|
||||
$p[$k] = $v;
|
||||
break;
|
||||
}
|
||||
$rows = DBA::p($query);
|
||||
while ($row = DBA::fetch($rows)) {
|
||||
$p = [];
|
||||
foreach ($row as $k => $v) {
|
||||
switch ($dbStructure[$table]['fields'][$k]['type']) {
|
||||
case 'datetime':
|
||||
$p[$k] = $v ?? DBA::NULL_DATETIME;
|
||||
break;
|
||||
default:
|
||||
$p[$k] = $v;
|
||||
break;
|
||||
}
|
||||
$result[] = $p;
|
||||
}
|
||||
$result[] = $p;
|
||||
}
|
||||
DBA::close($rows);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user