Initial commit: 心理咨询预约系统
PHP 前后端一体:首页咨询师列表、预约表单、管理后台、二维码准入与邮件通知;敏感配置与提交数据通过 .gitignore 排除。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
17
api/submissions.php
Normal file
17
api/submissions.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
|
||||
jsonError('方法不允许', 405);
|
||||
}
|
||||
|
||||
requireAdmin();
|
||||
|
||||
$submissions = readSubmissions();
|
||||
usort($submissions, function ($a, $b) {
|
||||
return strcmp($b['createdAt'] ?? '', $a['createdAt'] ?? '');
|
||||
});
|
||||
|
||||
jsonResponse(['ok' => true, 'data' => $submissions, 'total' => count($submissions)]);
|
||||
Reference in New Issue
Block a user