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