P8 平台轻量化改造 + SSG修复 + 编程导师 + 文档完善
- Prisma: Tool 模型加 affiliateLink;免费用户沙盒 10→5 次/日 - 后端: Tools API + /admin/tools CRUD 5 端点;Practices 完整模块 - 导航: 主菜单隐藏企业版/社区(URL 可访问) - 首页: 重定位为 AI 工具指南;新增精选工具区块;Feature 重写 - 工具页: affiliateLink 绿色推荐 Badge - SSG 修复: config.ts 构建时直连 localhost:4000,页面 108→127 - 沙盒: 新增编程导师场景(苏格拉底教学法) - 练习系统: Practices 多场景练习(含结构化评分) - 技能广场: 6 个付费 Skill(标题大师/回款助手等) - 管理后台: Models/Posts/Practices CRUD 页面 - 文档: README + progress.md 全面更新;AGENTS.md 同步定位 - 清理: .env.example 移除;tsbuildinfo gitignore
This commit is contained in:
@@ -323,7 +323,22 @@ export class GatewayPayService {
|
||||
where: { id: orderId },
|
||||
include: { user: true },
|
||||
});
|
||||
if (!order || (order.planType !== 'MONTHLY' && order.planType !== 'YEARLY')) return;
|
||||
if (!order) return;
|
||||
|
||||
if (order.planType === 'SKILL' && order.metadata) {
|
||||
const meta = JSON.parse(order.metadata);
|
||||
if (meta.skillId) {
|
||||
await this.prisma.userSkill.upsert({
|
||||
where: { userId_skillId: { userId: order.userId, skillId: meta.skillId } },
|
||||
update: { orderId: order.id },
|
||||
create: { userId: order.userId, skillId: meta.skillId, orderId: order.id },
|
||||
});
|
||||
this.logger.log(`网关支付激活技能: 用户${order.userId}, 技能${meta.skillId}`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (order.planType !== 'MONTHLY' && order.planType !== 'YEARLY') return;
|
||||
|
||||
const durationDays = order.planType === 'MONTHLY' ? 30 : 365;
|
||||
const now = new Date();
|
||||
|
||||
Reference in New Issue
Block a user