farm_daily_stats.sql 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. -- ******************************************************************
  2. -- 表 kku_farm_daily_stats 的创建SQL
  3. -- 对应的Model: App\Module\Farm\Models\FarmDailyStats
  4. -- 警告: 此文件由系统自动生成,禁止修改!
  5. -- ******************************************************************
  6. CREATE TABLE `kku_farm_daily_stats` (
  7. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  8. `stats_date` date NOT NULL COMMENT '统计日期',
  9. `total_users` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总用户数',
  10. `active_users` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '活跃用户数(当日有操作)',
  11. `house_level_1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '1级房屋数量',
  12. `house_level_2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '2级房屋数量',
  13. `house_level_3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '3级房屋数量',
  14. `house_level_4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '4级房屋数量',
  15. `house_level_5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '5级房屋数量',
  16. `house_level_6` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '6级房屋数量',
  17. `house_level_7` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '7级房屋数量',
  18. `house_level_8` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '8级房屋数量',
  19. `house_level_9` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '9级房屋数量',
  20. `house_level_10` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '10级房屋数量',
  21. `land_type_1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '普通土地数量',
  22. `land_type_2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '红土地数量',
  23. `land_type_3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '黑土地数量',
  24. `land_type_4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '金色特殊土地数量',
  25. `land_type_5` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '蓝色特殊土地数量',
  26. `land_type_6` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '紫色特殊土地数量',
  27. `land_status_0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '空闲土地数量',
  28. `land_status_1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '种植中土地数量',
  29. `land_status_2` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '灾害土地数量',
  30. `land_status_3` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '可收获土地数量',
  31. `land_status_4` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '枯萎土地数量',
  32. `total_lands` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总土地数量',
  33. `total_special_lands` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '特殊土地总数量',
  34. `total_crops` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总作物数量',
  35. `crops_seed_stage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '种子期作物数量',
  36. `total_disasters` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总灾害数量',
  37. `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  38. `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  39. `crops_sprout_stage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '发芽期作物数量',
  40. `crops_growth_stage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '生长期作物数量',
  41. `crops_fruit_stage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '果实期作物数量',
  42. `crops_mature_stage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '成熟期作物数量',
  43. `crops_withered_stage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '枯萎期作物数量',
  44. PRIMARY KEY (`id`) USING BTREE,
  45. UNIQUE KEY `idx_stats_date` (`stats_date`) USING BTREE,
  46. KEY `idx_created_at` (`created_at`) USING BTREE
  47. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='农场每日统计表';