- if (!empty($search)) {
- $searchTerm = '%' . $search . '%';
-
- $profiles = DBA::p("SELECT * FROM `owner-view`
- WHERE $publish AND NOT `blocked` AND NOT `account_removed`
- AND ((`name` LIKE ?) OR
- (`nickname` LIKE ?) OR
- (`about` LIKE ?) OR
- (`locality` LIKE ?) OR
- (`region` LIKE ?) OR
- (`country-name` LIKE ?) OR
- (`pub_keywords` LIKE ?) OR
- (`prv_keywords` LIKE ?))
- $order LIMIT ?,?",
- $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm, $searchTerm,
- $start, $count
- );
- } else {
- $profiles = DBA::p("SELECT * FROM `owner-view`
- WHERE $publish AND NOT `blocked` AND NOT `account_removed` $order LIMIT ?,?", $start, $count);
- }
- }
-
- if (DBA::isResult($profiles) && $total > 0) {
- return [
- 'total' => $total,
- 'entries' => DBA::toArray($profiles),
- ];
-
+ $profiles = DBA::selectToArray('owner-view', [], $condition, ['order' => ['name'], 'limit' => [$start, $count]]);