31 lines
857 B
PHP
31 lines
857 B
PHP
<?php
|
|
/**
|
|
* 媒体数据详情接口 GET /api/media/detail.php?id=1
|
|
*/
|
|
require_once __DIR__ . '/../common/db.php';
|
|
require_once __DIR__ . '/../common/response.php';
|
|
require_once __DIR__ . '/../common/auth.php';
|
|
|
|
checkPermission('media');
|
|
|
|
$id = (int)($_REQUEST['id'] ?? 0);
|
|
if ($id <= 0) {
|
|
Response::error('参数错误', 400);
|
|
}
|
|
|
|
$pdo = DB::getInstance()->getPdo();
|
|
$stmt = $pdo->prepare(
|
|
"SELECT sa.*, mca.account_level, mca.content_categories, mca.follower_count,
|
|
mca.avg_read_count, mca.certification_type, mca.special_requirements, mca.media_remark
|
|
FROM social_accounts sa
|
|
LEFT JOIN media_commercial_attributes mca ON mca.social_account_id = sa.id
|
|
WHERE sa.id = ?"
|
|
);
|
|
$stmt->execute([$id]);
|
|
$row = $stmt->fetch();
|
|
if (!$row) {
|
|
Response::error('媒体账号不存在');
|
|
}
|
|
|
|
Response::success(['media' => $row]);
|