This commit is contained in:
nanguaboss
2026-08-03 00:07:01 +08:00
commit 71c6e8d9c1
112 changed files with 7815 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
/**
* 需求详情接口 GET /api/need/detail.php?id=1
*/
require_once __DIR__ . '/../common/db.php';
require_once __DIR__ . '/../common/response.php';
require_once __DIR__ . '/../common/auth.php';
checkPermission('need');
$id = (int)($_REQUEST['id'] ?? 0);
if ($id <= 0) {
Response::error('参数错误', 400);
}
$pdo = DB::getInstance()->getPdo();
$stmt = $pdo->prepare(
"SELECT cn.*, c.display_name, c.industry, c.country, c.website
FROM company_needs cn
LEFT JOIN companies c ON c.id = cn.company_id
WHERE cn.id = ?"
);
$stmt->execute([$id]);
$need = $stmt->fetch();
if (!$need) {
Response::error('需求不存在');
}
Response::success(['need' => $need]);