prepare("UPDATE apps SET status = ?, rejection_reason = ?, is_approved = 1 WHERE id = ?"); } else { $stmt = $conn->prepare("UPDATE apps SET status = ?, rejection_reason = ?, is_approved = 0 WHERE id = ?"); } if (!$stmt) { $error = "数据库错误: " . $conn->error; } else { $stmt->bind_param("ssi", $status, $rejectionReason, $appId); if ($stmt->execute()) { // 获取应用信息和开发者邮箱 $getAppStmt = $conn->prepare("SELECT name, developer_email FROM apps WHERE id = ?"); $getAppStmt->bind_param("i", $appId); $getAppStmt->execute(); $appResult = $getAppStmt->get_result(); $appInfo = $appResult->fetch_assoc(); $getAppStmt->close(); $success = '应用审核已更新'; $appName = $appInfo['name'] ?? '未知应用'; $devEmail = $appInfo['developer_email'] ?? ''; // 发送邮件通知 if (!empty($devEmail)) { $mail = new PHPMailer(true); try { // 服务器配置 $mail->isSMTP(); $mail->Host = SMTP_HOST; $mail->Port = SMTP_PORT; $mail->SMTPSecure = SMTP_ENCRYPTION; $mail->SMTPAuth = true; $mail->Username = SMTP_USERNAME; $mail->Password = SMTP_PASSWORD; $mail->CharSet = 'UTF-8'; $mail->isHTML(true); $mail->setFrom(SMTP_FROM_EMAIL, SMTP_FROM_NAME); $mail->addAddress($devEmail); // 邮件内容 if ($status === 'approved') { $mail->Subject = '应用审核通过通知'; $mail->Body = "

应用审核通过通知

您好,

您的应用 {$appName} 已成功通过审核!

现在可以在应用商店中查看您的应用。

此致
应用商店团队

"; } else { $mail->Subject = '应用审核未通过通知'; $mail->Body = "

应用审核未通过通知

您好,

您的应用 {$appName} 未通过审核。

原因:
{$rejectionReason}

此致
应用商店团队

"; } $mail->send(); $success .= ',邮件通知已发送'; } catch (Exception $e) { log_error("邮件发送失败: {$mail->ErrorInfo}", __FILE__, __LINE__); $error = "审核状态已更新,但邮件发送失败: {$mail->ErrorInfo}"; } } } else { $error = '更新审核状态失败: ' . $conn->error; } $stmt->close(); } } } } // 获取待审核应用列表 $pendingApps = []; if (!($conn instanceof mysqli)) { log_error('数据库连接错误: 连接不是MySQLi实例', __FILE__, __LINE__); $error = '数据库连接错误,请检查配置'; } else { $stmt = $conn->prepare("SELECT a.id, a.name, a.description, a.status, a.created_at, d.username FROM apps a LEFT JOIN developers d ON a.developer_id = d.id WHERE a.status = 'pending' ORDER BY a.created_at DESC"); if (!$stmt) { $error = "数据库错误: " . $conn->error; } else { $stmt->execute(); $result = $stmt->get_result(); $pendingApps = $result->fetch_all(MYSQLI_ASSOC); $stmt->close(); } } ?> 应用审核 - <?php echo APP_STORE_NAME; ?>
请遵循应用商店的审核规则,确保应用符合平台要求。

应用审核

待审核应用:

没有待审核的应用

prepare("SELECT file_path FROM app_versions WHERE app_id = ? ORDER BY created_at DESC LIMIT 1"); if ($getDownloadLinkStmt) { $getDownloadLinkStmt->bind_param("i", $appId); $getDownloadLinkStmt->execute(); $downloadLinkResult = $getDownloadLinkStmt->get_result(); $downloadLinkInfo = $downloadLinkResult->fetch_assoc(); $downloadLink = $downloadLinkInfo ? $downloadLinkInfo['file_path'] : ''; $getDownloadLinkStmt->close(); } else { $downloadLink = ''; log_error('数据库准备语句错误: ' . $conn->error, __FILE__, __LINE__); } // 获取应用标签 $getTagsStmt = $conn->prepare("SELECT t.name FROM tags t JOIN app_tags at ON t.id = at.tag_id WHERE at.app_id = ?"); if ($getTagsStmt) { $getTagsStmt->bind_param("i", $appId); $getTagsStmt->execute(); $tagsResult = $getTagsStmt->get_result(); $tags = []; while ($tag = $tagsResult->fetch_assoc()) { $tags[] = $tag['name']; } $tagString = implode(', ', $tags); $getTagsStmt->close(); } else { $tagString = ''; log_error('数据库准备语句错误: ' . $conn->error, __FILE__, __LINE__); } ?>

下载链接: 点击下载

标签:

开发者:

提交时间:

描述:

prepare("SELECT image_path FROM app_images WHERE app_id = ?"); $stmt->bind_param("i", $app['id']); $stmt->execute(); $imgResult = $stmt->get_result(); while ($img = $imgResult->fetch_assoc()) { $images[] = $img['image_path']; } $stmt->close(); ?>
预览图片:
应用截图