diff --git a/api/search-customers.php b/api/search-customers.php index e52bbd3..5b60376 100644 --- a/api/search-customers.php +++ b/api/search-customers.php @@ -16,10 +16,10 @@ if (strlen($query) < 2) { $customers = db()->fetchAll( "SELECT customer_id, email, name, phone, wallet_balance, reward_points FROM customers - WHERE (email LIKE :q OR name LIKE :q OR phone LIKE :q) AND is_active = 1 + WHERE (email LIKE :q1 OR name LIKE :q2 OR phone LIKE :q3) AND is_active = 1 ORDER BY name ASC LIMIT 20", - ['q' => '%' . $query . '%'] + ['q1' => '%' . $query . '%', 'q2' => '%' . $query . '%', 'q3' => '%' . $query . '%'] ); jsonResponse($customers);