Added voicenumber select in Order
This commit is contained in:
@@ -97,14 +97,14 @@ class VoicenumberModel {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static function search($filter, $limit = false) {
|
||||
public static function search($filter, $limit = false, $key = false) {
|
||||
$items = [];
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$where = self::getSqlFilter($filter);
|
||||
$sql = "SELECT * FROM Voicenumber
|
||||
WHERE $where
|
||||
ORDER BY countrycode, areacode, first, last";
|
||||
ORDER BY number";
|
||||
|
||||
if(is_array($limit) && count($limit)) {
|
||||
if(is_numeric($limit['start']) && is_numeric($limit['count'])) {
|
||||
@@ -120,7 +120,11 @@ class VoicenumberModel {
|
||||
|
||||
if($db->num_rows($res)) {
|
||||
while($data = $db->fetch_object($res)) {
|
||||
$items[] = new Voicenumber($data);
|
||||
if($key) {
|
||||
$items[$data->$key] = new Voicenumber($data);
|
||||
} else {
|
||||
$items[] = new Voicenumber($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $items;
|
||||
|
||||
Reference in New Issue
Block a user