Replace "p" with "select"

This commit is contained in:
Michael 2021-10-11 06:25:04 +00:00
parent d3ebb3ac49
commit 86947b0997

View file

@ -259,12 +259,10 @@ class Widget
} }
$networks = self::unavailableNetworks(); $networks = self::unavailableNetworks();
$extra_sql = " AND NOT `network` IN (" . substr(str_repeat("?, ", count($networks)), 0, -2) . ")"; $query = "`uid` = ? AND NOT `deleted` AND `network` != '' AND NOT `network` IN (" . substr(str_repeat("?, ", count($networks)), 0, -2) . ")";
$sql_values = array_merge([local_user()], $networks); $condition = array_merge([$query], array_merge([local_user()], $networks));
$r = DBA::p("SELECT `network` FROM `contact` WHERE `uid` = ? AND NOT `deleted` AND `network` != '' $extra_sql GROUP BY `network` ORDER BY `network`", $r = DBA::select('contact', ['network'], $condition, ['group_by' => ['network'], 'order' => ['network']]);
$sql_values
);
$nets = array(); $nets = array();
while ($rr = DBA::fetch($r)) { while ($rr = DBA::fetch($r)) {