永久会员与模板库后台化:预览门控、轻量首页与 Admin CRUD

- 会员改为永久激活方案;云端文件不再拦截非会员;预览弹窗内导出/打印才校验
- 首页最近文件支持本地记录,登录后与云端合并;移除独立会员页与订阅页
- 模板库入库管理:soon_templates 表、Admin 上传 CRUD、/templates 轻量列表与按需下载

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
24kycj
2026-06-08 23:52:56 +08:00
parent 152228d41f
commit ebe191b06d
45 changed files with 1616 additions and 1259 deletions
+24 -5
View File
@@ -88,19 +88,21 @@ if (columnExists($pdo, 'plans', 'description')) {
$seed = [
['free', '免费版', '免费体验设计与编辑', 0, $quota, $maxFiles, 0,
'["设计与编辑工具免费使用"]', 0, 0, 1],
['member_lifetime', '永久会员', '一次激活,永久使用预览交付能力', 100, $quota, $maxFiles, 0,
'["高清预览","成品打印","云端保存","导出设计文件","永久有效"]', 10, 1, 1],
['member_monthly', '月度订阅', '按月灵活使用,随时续订', 1999, $quota, $maxFiles, 30,
'["高清预览","成品打印","云端保存","导出设计文件","订阅周期:1 个月"]', 10, 1, 1],
'["高清预览","成品打印","云端保存","导出设计文件","订阅周期:1 个月"]', 20, 0, 0],
['member_quarterly', '季度订阅', '连续三个月,更省心', 5299, $quota, $maxFiles, 90,
'["高清预览","成品打印","云端保存","导出设计文件","订阅周期:1 季"]', 15, 0, 1],
'["高清预览","成品打印","云端保存","导出设计文件","订阅周期:1 季"]', 25, 0, 0],
['member_yearly', '年度订阅', '全年畅享,性价比更高', 19999, $quota, $maxFiles, 365,
'["高清预览","成品打印","云端保存","导出设计文件","订阅周期:1 年"]', 20, 0, 1],
'["高清预览","成品打印","云端保存","导出设计文件","订阅周期:1 年"]', 30, 0, 0],
];
$upsert = $pdo->prepare(
'INSERT INTO plans (code, name, description, price_cents, quota_mb, max_files, duration_days, features, sort_order, is_recommended, is_active) '
. 'VALUES (:c, :n, :d, :p, :q, :mf, :dd, :f, :so, :ir, :a) '
. 'ON DUPLICATE KEY UPDATE name=VALUES(name), description=VALUES(description), price_cents=VALUES(price_cents), '
. 'ON DUPLICATE KEY UPDATE name=VALUES(name), description=VALUES(description), price_cents=VALUES(price_cents), '
. 'quota_mb=VALUES(quota_mb), max_files=VALUES(max_files), duration_days=VALUES(duration_days), '
. 'sort_order=VALUES(sort_order), is_recommended=VALUES(is_recommended), is_active=VALUES(is_active)'
. 'features=VALUES(features), sort_order=VALUES(sort_order), is_recommended=VALUES(is_recommended), is_active=VALUES(is_active)'
);
foreach ($seed as $row) {
$upsert->execute([
@@ -139,3 +141,20 @@ if (columnExists($pdo, 'plans', 'description')) {
}
fwrite(STDOUT, 'migrate-dev-schema: legacy plan copy refreshed' . PHP_EOL);
}
$pdo->exec(
'CREATE TABLE IF NOT EXISTS `soon_templates` ('
. '`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,'
. '`name` VARCHAR(120) NOT NULL,'
. '`type` TINYINT UNSIGNED NOT NULL DEFAULT 1,'
. '`thumb` MEDIUMTEXT DEFAULT NULL,'
. '`file_size` INT UNSIGNED NOT NULL DEFAULT 0,'
. '`sort_order` INT NOT NULL DEFAULT 0,'
. '`is_active` TINYINT(1) NOT NULL DEFAULT 1,'
. '`created_at` DATETIME NOT NULL,'
. '`updated_at` DATETIME NOT NULL,'
. 'PRIMARY KEY (`id`),'
. 'KEY `active_sort` (`is_active`, `sort_order`, `id`)'
. ') ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci'
);
fwrite(STDOUT, 'migrate-dev-schema: soon_templates ensured' . PHP_EOL);
+1
View File
@@ -44,6 +44,7 @@ return [
'storage' => [
'users_dir' => '/var/www/storage/users',
'models_dir' => '/var/soonModels',
'templates_dir' => '/var/www/storage/templates',
],
'limits' => ['free_quota_mb' => 20, 'preview_require_membership' => false],
'rate_limits' => [