芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/teafund.pulsehost.co.uk/api/members_search.php
0) { $sql .= " AND m.fund_id = :fund_id"; } $sql .= " ORDER BY m.active DESC, m.name LIMIT 20"; $stmt = $pdo->prepare($sql); $params = [':like' => $like, ':id' => $asId]; if ($fund_id > 0) $params[':fund_id'] = $fund_id; $stmt->execute($params); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC) ?: []; echo json_encode(array_map(function($r){ return [ 'id' => (int)$r['id'], 'name' => $r['name'], 'email' => $r['email'], 'fund' => $r['fund_name'], 'fund_id' => (int)$r['fund_id'], 'active' => (int)$r['active'] ]; }, $rows)); } catch (Throwable $e) { http_response_code(500); echo json_encode(['error' => 'server']); }