-- ****************************************************************** -- 表 kku_task_achievement_conditions 的创建SQL -- 对应的Model: App\Module\Task\Models\TaskAchievementCondition -- 警告: 此文件由系统自动生成,禁止修改! -- ****************************************************************** CREATE TABLE `kku_task_achievement_conditions` ( `id` int NOT NULL AUTO_INCREMENT COMMENT '主键', `task_id` int NOT NULL COMMENT '任务ID,外键关联task_tasks表', `condition_id` int NOT NULL COMMENT '条件ID,外键关联task_conditions表', `condition_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'progress' COMMENT '条件类型(prerequisite=前置条件,progress=进度条件)', `target_value` int NOT NULL DEFAULT '1' COMMENT '目标值,如需要完成的次数', `params` json DEFAULT NULL COMMENT '条件参数,如特定物品ID、特定作物ID等', `operator` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '=' COMMENT '运算符,如=, >=, <=', `sort_order` int NOT NULL DEFAULT '0' COMMENT '排序顺序,用于多条件任务', `is_required` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否必须满足此条件(0:否, 1:是)', `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间', `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间', PRIMARY KEY (`id`) USING BTREE, KEY `idx_task_id` (`task_id`) USING BTREE, KEY `idx_condition_id` (`condition_id`) USING BTREE, KEY `idx_task_condition` (`task_id`,`condition_id`) USING BTREE, KEY `idx_condition_type` (`condition_type`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='任务达成条件表';