Преглед изворни кода

重构数据库SQL文件结构:统一使用GenerateSql目录,重命名File模块Model目录为Models

Your Name пре 8 месеци
родитељ
комит
dbf212d52f
100 измењених фајлова са 644 додато и 594 уклоњено
  1. 57 23
      UCore/Commands/GenerateModelAnnotation.php
  2. 6 0
      app/Module/Article/Databases/GenerateSql/README.md
  3. 0 0
      app/Module/Article/Databases/GenerateSql/article_cates.sql
  4. 0 0
      app/Module/Article/Databases/GenerateSql/articles.sql
  5. 1 1
      app/Module/File/Img.php
  6. 0 38
      app/Module/File/Model/FileFile.php
  7. 0 73
      app/Module/File/Model/FileImg.php
  8. 0 63
      app/Module/File/Model/FileTemplate.php
  9. 18 0
      app/Module/File/Models/FileFile.php
  10. 41 0
      app/Module/File/Models/FileImg.php
  11. 43 0
      app/Module/File/Models/FileTemplate.php
  12. 0 0
      app/Module/File/Models/README.md
  13. 1 1
      app/Module/File/Upload4User.php
  14. 1 1
      app/Module/File/Validator/UserFileImg.php
  15. 6 0
      app/Module/Fund/Databases/GenerateSql/README.md
  16. 0 0
      app/Module/Fund/Databases/GenerateSql/fund.sql
  17. 0 0
      app/Module/Fund/Databases/GenerateSql/fund_admin.sql
  18. 0 0
      app/Module/Fund/Databases/GenerateSql/fund_circulation.sql
  19. 0 0
      app/Module/Fund/Databases/GenerateSql/fund_config.sql
  20. 0 0
      app/Module/Fund/Databases/GenerateSql/fund_currency.sql
  21. 0 0
      app/Module/Fund/Databases/GenerateSql/fund_logs.sql
  22. 0 0
      app/Module/Fund/Databases/GenerateSql/fund_order.sql
  23. 0 0
      app/Module/Fund/Databases/GenerateSql/fund_transfer.sql
  24. 6 0
      app/Module/GameItems/Databases/GenerateSql/README.md
  25. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_categories.sql
  26. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_chest_contents.sql
  27. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_chest_open_logs.sql
  28. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_craft_logs.sql
  29. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_dismantle_logs.sql
  30. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_dismantle_results.sql
  31. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_dismantle_rules.sql
  32. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_group_items.sql
  33. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_groups.sql
  34. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_instances.sql
  35. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_items.sql
  36. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_output_limits.sql
  37. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_pity_times.sql
  38. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_recipe_materials.sql
  39. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_recipes.sql
  40. 2 1
      app/Module/GameItems/Databases/GenerateSql/item_transaction_logs.sql
  41. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_user_output_counters.sql
  42. 0 0
      app/Module/GameItems/Databases/GenerateSql/item_user_recipes.sql
  43. 1 1
      app/Module/GameItems/Databases/GenerateSql/item_users.sql
  44. 2 2
      app/Module/GameItems/Models/ItemChestOpenLog.php
  45. 2 2
      app/Module/GameItems/Models/ItemCraftLog.php
  46. 2 2
      app/Module/GameItems/Models/ItemDismantleLog.php
  47. 2 2
      app/Module/GameItems/Models/ItemDismantleResult.php
  48. 2 2
      app/Module/GameItems/Models/ItemDismantleRule.php
  49. 2 2
      app/Module/GameItems/Models/ItemInstance.php
  50. 2 2
      app/Module/GameItems/Models/ItemOutputLimit.php
  51. 2 2
      app/Module/GameItems/Models/ItemPityTime.php
  52. 2 2
      app/Module/GameItems/Models/ItemRecipe.php
  53. 2 2
      app/Module/GameItems/Models/ItemRecipeMaterial.php
  54. 3 2
      app/Module/GameItems/Models/ItemTransactionLog.php
  55. 2 2
      app/Module/GameItems/Models/ItemUser.php
  56. 0 60
      app/Module/OAuth/Database/oauth_tables.sql
  57. 6 0
      app/Module/OAuth/Databases/GenerateSql/README.md
  58. 0 0
      app/Module/OAuth/Databases/GenerateSql/oauth_access_tokens.sql
  59. 0 0
      app/Module/OAuth/Databases/GenerateSql/oauth_clients.sql
  60. 6 0
      app/Module/Pet/Databases/GenerateSql/README.md
  61. 0 0
      app/Module/Pet/Databases/GenerateSql/pet_battle_logs.sql
  62. 0 0
      app/Module/Pet/Databases/GenerateSql/pet_battle_seasons.sql
  63. 0 0
      app/Module/Pet/Databases/GenerateSql/pet_battle_team_members.sql
  64. 0 0
      app/Module/Pet/Databases/GenerateSql/pet_battle_teams.sql
  65. 0 0
      app/Module/Pet/Databases/GenerateSql/pet_configs.sql
  66. 0 0
      app/Module/Pet/Databases/GenerateSql/pet_level_configs.sql
  67. 0 0
      app/Module/Pet/Databases/GenerateSql/pet_remould_logs.sql
  68. 0 0
      app/Module/Pet/Databases/GenerateSql/pet_skill_logs.sql
  69. 0 0
      app/Module/Pet/Databases/GenerateSql/pet_skills.sql
  70. 0 0
      app/Module/Pet/Databases/GenerateSql/pet_users.sql
  71. 6 0
      app/Module/Sms/Databases/GenerateSql/README.md
  72. 0 0
      app/Module/Sms/Databases/GenerateSql/sms_code.sql
  73. 0 0
      app/Module/Sms/Databases/GenerateSql/sms_config.sql
  74. 0 0
      app/Module/Sms/Databases/GenerateSql/sms_dbgateway.sql
  75. 6 0
      app/Module/System/Databases/GenerateSql/README.md
  76. 0 0
      app/Module/System/Databases/GenerateSql/admin_actionlogs.sql
  77. 0 0
      app/Module/System/Databases/GenerateSql/admin_grid_views.sql
  78. 0 0
      app/Module/System/Databases/GenerateSql/admin_users.sql
  79. 0 0
      app/Module/System/Databases/GenerateSql/continuous_times.sql
  80. 0 0
      app/Module/System/Databases/GenerateSql/sys_configs.sql
  81. 197 0
      app/Module/Team/Docs/create.sql
  82. 62 24
      app/Module/Team/Docs/推荐关系系统.md
  83. 119 14
      app/Module/Team/Docs/数据库设计.md
  84. 6 0
      app/Module/Test/Databases/GenerateSql/README.md
  85. 16 0
      app/Module/Test/Databases/GenerateSql/test.sql
  86. 6 0
      app/Module/Ulogic/Databases/GenerateSql/README.md
  87. 0 0
      app/Module/Ulogic/Databases/GenerateSql/app_message_recipients.sql
  88. 0 0
      app/Module/Ulogic/Databases/GenerateSql/app_message_templates.sql
  89. 0 0
      app/Module/Ulogic/Databases/GenerateSql/app_messages.sql
  90. 0 0
      app/Module/Ulogic/Databases/GenerateSql/user_daytimes.sql
  91. 0 0
      app/Module/Ulogic/Databases/GenerateSql/user_punishs.sql
  92. 0 0
      app/Module/Ulogic/Databases/GenerateSql/user_times.sql
  93. 0 71
      app/Module/Ulogic/Databases/app_messagetables.sql
  94. 0 113
      app/Module/Ulogic/Internal.php
  95. 0 86
      app/Module/Ulogic/Models/Internal.php
  96. 6 0
      app/Module/User/Databases/GenerateSql/README.md
  97. 0 0
      app/Module/User/Databases/GenerateSql/user_actions.sql
  98. 0 0
      app/Module/User/Databases/GenerateSql/user_infos.sql
  99. 0 0
      app/Module/User/Databases/GenerateSql/user_phones.sql
  100. 0 0
      app/Module/User/Databases/GenerateSql/user_secret_passwords.sql

+ 57 - 23
UCore/Commands/GenerateModelAnnotation.php

@@ -6,6 +6,7 @@ use Illuminate\Console\Command;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\File;
+use Illuminate\Support\Facades\Log;
 use UCore\ModelCore;
 
 /**
@@ -147,7 +148,7 @@ class GenerateModelAnnotation extends Command
                 continue;
             }
 
-            $fullPath = $dir . '/' . $item;
+            $fullPath = "{$dir}/{$item}";
 
             // 递归处理子目录
             if (is_dir($fullPath)) {
@@ -157,7 +158,7 @@ class GenerateModelAnnotation extends Command
                     continue;
                 }
 
-                $this->call1($fullPath, $ns . $item . '\\');
+                $this->call1($fullPath, "{$ns}{$item}\\");
                 continue;
             }
 
@@ -192,7 +193,7 @@ class GenerateModelAnnotation extends Command
             }
 
             // 检查类是否是模型类
-            if (!$reflectionClass->isSubclassOf(\Illuminate\Database\Eloquent\Model::class)) {
+            if (!$reflectionClass->isSubclassOf(Model::class)) {
                 $this->debug(" model $modelClass 不是模型类,跳过", 'warning');
                 $this->skippedCount++;
                 return;
@@ -228,7 +229,9 @@ class GenerateModelAnnotation extends Command
 
                 // 如果不跳过SQL生成且找到了模块名称,则生成表的创建SQL
                 if (!$this->option('skip-sql') && $moduleName) {
-                    $this->generateTableSQLFile($table, $moduleName, $co, $modelClass);
+                    // 获取无前缀的表名
+                    $tableWithoutPrefix = $model->getTable();
+                    $this->generateTableSQLFile($table, $moduleName, $co, $tableWithoutPrefix, $modelClass);
                 }
 
                 $annotation = $this->getAnnotation($table,$co);
@@ -247,7 +250,7 @@ class GenerateModelAnnotation extends Command
 
                 // 使用正则表达式匹配 field start/end 标识符
                 $pattern = '/field\s+start[\s\S]+?field\s+end/';
-                $this->debug("使用正则表达式匹配 field start/end: " . $pattern);
+                $this->debug("使用正则表达式匹配 field start/end: {$pattern}");
 
                 // 尝试匹配
                 $matches = [];
@@ -259,7 +262,7 @@ class GenerateModelAnnotation extends Command
                 }
 
                 // 替换 field start/end 标识符
-                $replacement = "field start ".$annotation." * field end";
+                $replacement = "field start {$annotation} * field end";
                 $result = preg_replace($pattern, $replacement, $string);
 
                 // 强制替换成功
@@ -267,9 +270,9 @@ class GenerateModelAnnotation extends Command
                 $this->debug("field start/end 替换结果: 成功");
 
                 // 过滤系统默认字段
-                $filteredFillable = array_filter($this->fillable, function($field) {
-                    return !in_array($field, ['created_at', 'updated_at', 'deleted_at']);
-                });
+                $filteredFillable = array_filter($this->fillable, fn($field) =>
+                    !in_array($field, ['created_at', 'updated_at', 'deleted_at'])
+                );
 
                 // 格式化数组输出
                 $fillableContent = "    protected \$fillable = [\n";
@@ -287,7 +290,7 @@ class GenerateModelAnnotation extends Command
 
                 // 使用正则表达式匹配 attrlist start/end 标识符
                 $pattern2 = '/\/\/\s*attrlist\s+start[\s\S]+?\/\/\s*attrlist\s+end/';
-                $this->debug("使用正则表达式匹配 attrlist start/end: " . $pattern2);
+                $this->debug("使用正则表达式匹配 attrlist start/end: {$pattern2}");
 
                 // 尝试匹配
                 $matches2 = [];
@@ -337,7 +340,7 @@ class GenerateModelAnnotation extends Command
     }
 
     /**
-     * 输出调试信息
+     * 输出调试信息并写入日志
      *
      * @param string $message 调试信息
      * @param string $type 信息类型 (info, warning, error)
@@ -345,6 +348,20 @@ class GenerateModelAnnotation extends Command
      */
     protected function debug($message, $type = 'info')
     {
+        // 始终写入日志
+        $logPrefix = '[GenerateModelAnnotation] ';
+        switch ($type) {
+            case 'warning':
+                Log::warning("{$logPrefix}{$message}");
+                break;
+            case 'error':
+                Log::error("{$logPrefix}{$message}");
+                break;
+            default:
+                Log::info("{$logPrefix}{$message}");
+        }
+
+        // 仅在启用调试信息时输出到控制台
         if ($this->option('debug-info')) {
             switch ($type) {
                 case 'warning':
@@ -360,7 +377,7 @@ class GenerateModelAnnotation extends Command
     }
 
     /**
-     * 输出简洁信息
+     * 输出简洁信息并写入日志
      *
      * @param string $message 信息内容
      * @param string $type 信息类型 (info, warning, error)
@@ -373,14 +390,19 @@ class GenerateModelAnnotation extends Command
             return;
         }
 
+        // 始终写入日志
+        $logPrefix = '[GenerateModelAnnotation] ';
         switch ($type) {
             case 'warning':
+                Log::warning("{$logPrefix}{$message}");
                 $this->output->writeln("<fg=yellow>{$message}</>");
                 break;
             case 'error':
+                Log::error("{$logPrefix}{$message}");
                 $this->output->writeln("<fg=red>{$message}</>");
                 break;
             default:
+                Log::info("{$logPrefix}{$message}");
                 $this->output->writeln($message);
         }
     }
@@ -415,7 +437,7 @@ class GenerateModelAnnotation extends Command
         }
 
         $this->fillable = $fillable;
-        return $annotation."\n";
+        return "{$annotation}\n";
     }
 
     private function getColumnType($dataType)
@@ -460,16 +482,15 @@ class GenerateModelAnnotation extends Command
     /**
      * 为表生成创建SQL文件
      *
-     * @param string $tableName 表名
+     * @param string $tableName 表名(带前缀)
      * @param string $moduleName 模块名
      * @param \Illuminate\Database\Connection $connection 数据库连接
+     * @param string $tableNameWithoutPrefix 无前缀的表名(必传)
      * @param string $modelClass 模型类名
      * @return void
      */
-    protected function generateTableSQLFile($tableName, $moduleName, $connection, $modelClass = null)
+    protected function generateTableSQLFile($tableName, $moduleName, $connection, $tableNameWithoutPrefix, $modelClass = null)
     {
-       
-        
 
         // 标记该表已处理
         $this->processedTables[] = $tableName;
@@ -482,20 +503,33 @@ class GenerateModelAnnotation extends Command
             return;
         }
 
-        // 创建模块的Databases/createsql目录
-        $sqlDir = app_path("Module/{$moduleName}/Databases/createsql");
+        // 创建模块的Databases/GenerateSql 目录
+        $sqlDir = app_path("Module/{$moduleName}/Databases/GenerateSql");
         if (!File::exists($sqlDir)) {
             $this->debug("创建目录: {$sqlDir}");
             File::makeDirectory($sqlDir, 0755, true);
         }
 
-        // 生成SQL文件
-        $sqlFile = "{$sqlDir}/{$tableName}.sql";
+        // 创建或更新README.md文件,声明该目录是自动生成的,不能修改
+        $readmePath = "{$sqlDir}/README.md";
+        $readmeContent = "# 自动生成的SQL文件目录\n\n";
+        $readmeContent .= "**警告:这是自动生成的目录,请勿手动修改此目录下的任何文件!**\n\n";
+        $readmeContent .= "此目录下的SQL文件由系统自动生成,用于记录数据库表结构。\n";
+        $readmeContent .= "如需修改表结构,请修改对应的模型文件,然后重新运行生成命令。\n";
+
+        // 只有当README.md不存在或内容不同时才写入文件
+        if (!File::exists($readmePath) || File::get($readmePath) !== $readmeContent) {
+            File::put($readmePath, $readmeContent);
+            $this->debug("已创建/更新README.md文件: {$readmePath}");
+        }
+
+        // 生成SQL文件,使用无前缀的表名作为文件名
+        $sqlFile = "{$sqlDir}/{$tableNameWithoutPrefix}.sql";
         $sqlContent = "-- 表 {$tableName} 的创建SQL\n\n";
         $sqlContent .= "DROP TABLE IF EXISTS `{$tableName}`;\n";
-        $sqlContent .= $createSQL . ";\n";
+        $sqlContent .= "{$createSQL};\n";
 
         File::put($sqlFile, $sqlContent);
-        $this->debug("已生成SQL: {$sqlFile}");
+        $this->debug("已生成SQL: {$sqlFile} (无前缀表名: {$tableNameWithoutPrefix})");
     }
 }

+ 6 - 0
app/Module/Article/Databases/GenerateSql/README.md

@@ -0,0 +1,6 @@
+# 自动生成的SQL文件目录
+
+**警告:这是自动生成的目录,请勿手动修改此目录下的任何文件!**
+
+此目录下的SQL文件由系统自动生成,用于记录数据库表结构。
+如需修改表结构,请修改对应的模型文件,然后重新运行生成命令。

+ 0 - 0
app/Module/Article/Databases/createsql/kku_article_cates.sql → app/Module/Article/Databases/GenerateSql/article_cates.sql


+ 0 - 0
app/Module/Article/Databases/createsql/kku_articles.sql → app/Module/Article/Databases/GenerateSql/articles.sql


+ 1 - 1
app/Module/File/Img.php

@@ -4,7 +4,7 @@
 namespace App\Module\File;
 
 
-use App\Module\File\Model\FileImg;
+use App\Module\File\ModelsFileImg;
 use Illuminate\Support\Facades\Storage;
 
 class Img

+ 0 - 38
app/Module/File/Model/FileFile.php

@@ -1,38 +0,0 @@
-<?php
-
-namespace App\Module\File\Model;
-
-use UCore\ModelCore;
-
-/**
- * 文件  - 文件
- * field start
- * @property   int  $id
- * @property   string  $path  储存目录
- * @property   string  $re_type  关联类型
- * @property   int  $re_id  关联ID
- * @property   string  $o_name  原名
- * @property   int  $fsize  文件大小
- * @property   string  $type1  图片类型
- * @property   \Carbon\Carbon  $updated_at
- * @property   \Carbon\Carbon  $created_at
- * @property   \Carbon\Carbon  $deleted_at
- * field end
- */
-class FileFile extends \UCore\ModelCore
-{
-// attrlist start
-  public static $attrlist = array (
-  0 => 'id',
-  1 => 'path',
-  2 => 're_type',
-  3 => 're_id',
-  4 => 'o_name',
-  5 => 'fsize',
-  6 => 'type1',
-  7 => 'updated_at',
-  8 => 'created_at',
-  9 => 'deleted_at',
-);
- //attrlist end
-}

+ 0 - 73
app/Module/File/Model/FileImg.php

@@ -1,73 +0,0 @@
-<?php
-
-namespace App\Module\File\Model;
-
-use App\Module\File\Img;
-use UCore\ModelCore;
-use Illuminate\Database\Eloquent\SoftDeletes;
-
-/**
- * 图片文件
- *
- * field start
- * @property   int  $id
- * @property   string  $storage_disk  储存 disk
- * @property   string  $path  储存目录
- * @property   int  $user_id  用户iD
- * @property   int  $admin_id  管理员ID
- * @property   string  $re_type  关联类型
- * @property   int  $re_id  关联ID
- * @property   string  $o_name  原名
- * @property   int  $fsize  文件大小
- * @property   int  $width  图片宽度
- * @property   string  $height  图片高度
- * @property   string  $type1  图片类型
- * @property   \Carbon\Carbon  $updated_at
- * @property   \Carbon\Carbon  $created_at
- * @property   \Carbon\Carbon  $deleted_at
- * @property   int  $private  私人的; 0:公共的 ,1 私人的
- * field end
- *
- */
-class FileImg extends \UCore\ModelCore
-{
-
-    use SoftDeletes;
-
-// attrlist start
-  public static $attrlist = array (
-  0 => 'id',
-  1 => 'storage_disk',
-  2 => 'path',
-  3 => 'user_id',
-  4 => 'admin_id',
-  5 => 're_type',
-  6 => 're_id',
-  7 => 'o_name',
-  8 => 'fsize',
-  9 => 'width',
-  10 => 'height',
-  11 => 'type1',
-  12 => 'updated_at',
-  13 => 'created_at',
-  14 => 'deleted_at',
-  15 => 'private',
-);
- //attrlist end
-    protected $table = 'file_imgs';
-
-    protected $appends =[
-        'url'
-    ];
-
-    public function getUrlAttribute()
-    {
-        return $this->getUrl();
-    }
-
-    public function getUrl()
-    {
-        return Img::getAdminPicUrl($this->path);
-    }
-
-}

+ 0 - 63
app/Module/File/Model/FileTemplate.php

@@ -1,63 +0,0 @@
-<?php
-
-namespace App\Module\File\Model;
-
-use UCore\ModelCore;
-use Illuminate\Database\Eloquent\SoftDeletes;
-
-/**
- * 文件模板
- *
- * field start
- * @property   int  $id
- * @property   string  $unid  标识
- * @property   int  $file_id
- * @property   string  $title  模板标题
- * @property   string  $desc  描述
- * @property   string  $status
- * @property   string  $group  分组
- * @property   \Carbon\Carbon  $updated_at
- * @property   \Carbon\Carbon  $created_at
- * @property   \Carbon\Carbon  $deleted_at
- * field end
- *
- */
-class FileTemplate extends ModelCore
-{
-
-    use SoftDeletes;
-// attrlist start
-  public static $attrlist = array (
-  0 => 'id',
-  1 => 'unid',
-  2 => 'file_id',
-  3 => 'title',
-  4 => 'desc',
-  5 => 'status',
-  6 => 'group',
-  7 => 'updated_at',
-  8 => 'created_at',
-  9 => 'deleted_at',
-);
- //attrlist end
-    /**
-     * 无效
-     */
-    const STATUS_0 = 0;
-
-    /**
-     * 有效
-     */
-    const STATUS_1 = 1;
-
-
-
-    protected $table = 'file_template';
-
-
-    public function file()
-    {
-        return $this->hasOne(FileImg::class, 'id', 'file_id');
-    }
-
-}

+ 18 - 0
app/Module/File/Models/FileFile.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Module\File\Models;
+
+use UCore\ModelCore;
+
+/**
+ * 文件  - 文件
+ * field start 
+ * field end
+ */
+class FileFile extends \UCore\ModelCore
+{
+// attrlist start 
+    protected $fillable = [
+    ];
+    // attrlist end
+}

+ 41 - 0
app/Module/File/Models/FileImg.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace App\Module\File\Models;
+
+use App\Module\File\Img;
+use UCore\ModelCore;
+use Illuminate\Database\Eloquent\SoftDeletes;
+
+/**
+ * 图片文件
+ *
+ * field start 
+ * field end
+ *
+ */
+class FileImg extends \UCore\ModelCore
+{
+
+    use SoftDeletes;
+
+// attrlist start 
+    protected $fillable = [
+    ];
+    // attrlist end
+    protected $table = 'file_imgs';
+
+    protected $appends =[
+        'url'
+    ];
+
+    public function getUrlAttribute()
+    {
+        return $this->getUrl();
+    }
+
+    public function getUrl()
+    {
+        return Img::getAdminPicUrl($this->path);
+    }
+
+}

+ 43 - 0
app/Module/File/Models/FileTemplate.php

@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Module\File\Models;
+
+use UCore\ModelCore;
+use Illuminate\Database\Eloquent\SoftDeletes;
+
+/**
+ * 文件模板
+ *
+ * field start 
+ * field end
+ *
+ */
+class FileTemplate extends ModelCore
+{
+
+    use SoftDeletes;
+// attrlist start 
+    protected $fillable = [
+    ];
+    // attrlist end
+    /**
+     * 无效
+     */
+    const STATUS_0 = 0;
+
+    /**
+     * 有效
+     */
+    const STATUS_1 = 1;
+
+
+
+    protected $table = 'file_template';
+
+
+    public function file()
+    {
+        return $this->hasOne(FileImg::class, 'id', 'file_id');
+    }
+
+}

+ 0 - 0
app/Module/File/Model/README.md → app/Module/File/Models/README.md


+ 1 - 1
app/Module/File/Upload4User.php

@@ -2,7 +2,7 @@
 
 namespace App\Module\File;
 
-use App\Module\File\Model\FileImg;
+use App\Module\File\ModelsFileImg;
 use Illuminate\Http\UploadedFile;
 use Illuminate\Support\Facades\Storage;
 use Intervention\Image\ImageManager;

+ 1 - 1
app/Module/File/Validator/UserFileImg.php

@@ -2,7 +2,7 @@
 
 namespace App\Module\File\Validator;
 
-use App\Module\File\Model\FileImg;
+use App\Module\File\ModelsFileImg;
 use UCore\ValidationCore;
 use UCore\Validator;
 

+ 6 - 0
app/Module/Fund/Databases/GenerateSql/README.md

@@ -0,0 +1,6 @@
+# 自动生成的SQL文件目录
+
+**警告:这是自动生成的目录,请勿手动修改此目录下的任何文件!**
+
+此目录下的SQL文件由系统自动生成,用于记录数据库表结构。
+如需修改表结构,请修改对应的模型文件,然后重新运行生成命令。

+ 0 - 0
app/Module/Fund/Databases/createsql/kku_fund.sql → app/Module/Fund/Databases/GenerateSql/fund.sql


+ 0 - 0
app/Module/Fund/Databases/createsql/kku_fund_admin.sql → app/Module/Fund/Databases/GenerateSql/fund_admin.sql


+ 0 - 0
app/Module/Fund/Databases/createsql/kku_fund_circulation.sql → app/Module/Fund/Databases/GenerateSql/fund_circulation.sql


+ 0 - 0
app/Module/Fund/Databases/createsql/kku_fund_config.sql → app/Module/Fund/Databases/GenerateSql/fund_config.sql


+ 0 - 0
app/Module/Fund/Databases/createsql/kku_fund_currency.sql → app/Module/Fund/Databases/GenerateSql/fund_currency.sql


+ 0 - 0
app/Module/Fund/Databases/createsql/kku_fund_logs.sql → app/Module/Fund/Databases/GenerateSql/fund_logs.sql


+ 0 - 0
app/Module/Fund/Databases/createsql/kku_fund_order.sql → app/Module/Fund/Databases/GenerateSql/fund_order.sql


+ 0 - 0
app/Module/Fund/Databases/createsql/kku_fund_transfer.sql → app/Module/Fund/Databases/GenerateSql/fund_transfer.sql


+ 6 - 0
app/Module/GameItems/Databases/GenerateSql/README.md

@@ -0,0 +1,6 @@
+# 自动生成的SQL文件目录
+
+**警告:这是自动生成的目录,请勿手动修改此目录下的任何文件!**
+
+此目录下的SQL文件由系统自动生成,用于记录数据库表结构。
+如需修改表结构,请修改对应的模型文件,然后重新运行生成命令。

+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_categories.sql → app/Module/GameItems/Databases/GenerateSql/item_categories.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_chest_contents.sql → app/Module/GameItems/Databases/GenerateSql/item_chest_contents.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_chest_open_logs.sql → app/Module/GameItems/Databases/GenerateSql/item_chest_open_logs.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_craft_logs.sql → app/Module/GameItems/Databases/GenerateSql/item_craft_logs.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_dismantle_logs.sql → app/Module/GameItems/Databases/GenerateSql/item_dismantle_logs.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_dismantle_results.sql → app/Module/GameItems/Databases/GenerateSql/item_dismantle_results.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_dismantle_rules.sql → app/Module/GameItems/Databases/GenerateSql/item_dismantle_rules.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_group_items.sql → app/Module/GameItems/Databases/GenerateSql/item_group_items.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_groups.sql → app/Module/GameItems/Databases/GenerateSql/item_groups.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_instances.sql → app/Module/GameItems/Databases/GenerateSql/item_instances.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_items.sql → app/Module/GameItems/Databases/GenerateSql/item_items.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_output_limits.sql → app/Module/GameItems/Databases/GenerateSql/item_output_limits.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_pity_times.sql → app/Module/GameItems/Databases/GenerateSql/item_pity_times.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_recipe_materials.sql → app/Module/GameItems/Databases/GenerateSql/item_recipe_materials.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_recipes.sql → app/Module/GameItems/Databases/GenerateSql/item_recipes.sql


+ 2 - 1
app/Module/GameItems/Databases/createsql/kku_item_transaction_logs.sql → app/Module/GameItems/Databases/GenerateSql/item_transaction_logs.sql

@@ -13,10 +13,11 @@ CREATE TABLE `kku_item_transaction_logs` (
   `attributes` json DEFAULT NULL COMMENT '额外属性,存储交易相关的详细信息',
   `expire_at` timestamp NULL DEFAULT NULL COMMENT '物品过期时间(如果有)',
   `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
+  `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
   `ip_address` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '操作的IP地址(用于安全审计)',
   `device_info` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '设备信息(用于安全审计)',
   PRIMARY KEY (`id`),
   KEY `idx_user_created` (`user_id`,`created_at`),
   KEY `idx_item_id` (`item_id`),
   KEY `idx_transaction_source` (`transaction_type`,`source_type`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='物品获取/消耗记录表';
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='物品获取/消耗记录表';

+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_user_output_counters.sql → app/Module/GameItems/Databases/GenerateSql/item_user_output_counters.sql


+ 0 - 0
app/Module/GameItems/Databases/createsql/kku_item_user_recipes.sql → app/Module/GameItems/Databases/GenerateSql/item_user_recipes.sql


+ 1 - 1
app/Module/GameItems/Databases/createsql/kku_item_users.sql → app/Module/GameItems/Databases/GenerateSql/item_users.sql

@@ -18,4 +18,4 @@ CREATE TABLE `kku_item_users` (
   KEY `fk_user_instance` (`instance_id`),
   CONSTRAINT `fk_user_instance` FOREIGN KEY (`instance_id`) REFERENCES `kku_item_instances` (`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_user_item` FOREIGN KEY (`item_id`) REFERENCES `kku_item_items` (`id`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户物品关联表';
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户物品关联表';

+ 2 - 2
app/Module/GameItems/Models/ItemChestOpenLog.php

@@ -8,7 +8,7 @@ use UCore\ModelCore;
 /**
  * 宝箱开启记录
  *
- * field start
+ * field start 
  * @property   int  $id  记录ID,主键
  * @property   int  $user_id  用户ID
  * @property   int  $chest_id  宝箱ID,外键关联kku_item_items表
@@ -31,7 +31,7 @@ class ItemChestOpenLog extends ModelCore
      */
     protected $table = 'item_chest_open_logs';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'user_id',

+ 2 - 2
app/Module/GameItems/Models/ItemCraftLog.php

@@ -9,7 +9,7 @@ use UCore\ModelCore;
 /**
  * 物品合成记录
  *
- * field start
+ * field start 
  * @property   int  $id  记录ID,主键
  * @property   int  $user_id  用户ID
  * @property   int  $recipe_id  配方ID,外键关联kku_item_recipes表
@@ -33,7 +33,7 @@ class ItemCraftLog extends ModelCore
      */
     protected $table = 'item_craft_logs';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'user_id',

+ 2 - 2
app/Module/GameItems/Models/ItemDismantleLog.php

@@ -9,7 +9,7 @@ use UCore\ModelCore;
 /**
  * 物品分解记录
  *
- * field start
+ * field start 
  * @property   int  $id  记录ID,主键
  * @property   int  $user_id  用户ID
  * @property   int  $item_id  被分解的物品ID,外键关联kku_item_items表
@@ -32,7 +32,7 @@ class ItemDismantleLog extends ModelCore
      */
     protected $table = 'item_dismantle_logs';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'user_id',

+ 2 - 2
app/Module/GameItems/Models/ItemDismantleResult.php

@@ -8,7 +8,7 @@ use UCore\ModelCore;
 /**
  * 物品分解结果
  *
- * field start
+ * field start 
  * @property   int  $id  记录ID,主键
  * @property   int  $rule_id  分解规则ID,外键关联kku_item_dismantle_rules表
  * @property   int  $result_item_id  结果物品ID,外键关联kku_item_items表
@@ -30,7 +30,7 @@ class ItemDismantleResult extends ModelCore
      */
     protected $table = 'item_dismantle_results';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'rule_id',

+ 2 - 2
app/Module/GameItems/Models/ItemDismantleRule.php

@@ -9,7 +9,7 @@ use UCore\ModelCore;
 /**
  * 物品分解规则
  *
- * field start
+ * field start 
  * @property   int  $id  规则ID,主键
  * @property   int  $item_id  物品ID,外键关联kku_item_items表
  * @property   int  $category_id  分类ID,外键关联kku_item_categories表
@@ -30,7 +30,7 @@ class ItemDismantleRule extends ModelCore
      */
     protected $table = 'item_dismantle_rules';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'item_id',

+ 2 - 2
app/Module/GameItems/Models/ItemInstance.php

@@ -9,7 +9,7 @@ use UCore\ModelCore;
 /**
  * 物品实例(单独属性物品)
  *
- * field start
+ * field start 
  * @property   int  $id  唯一物品ID,主键
  * @property   int  $item_id  关联的基础物品ID,外键关联kku_item_items表
  * @property   string  $name  物品名称(可以与基础物品不同)
@@ -33,7 +33,7 @@ class ItemInstance extends ModelCore
      */
     protected $table = 'item_instances';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'item_id',

+ 2 - 2
app/Module/GameItems/Models/ItemOutputLimit.php

@@ -9,7 +9,7 @@ use UCore\ModelCore;
 /**
  * 物品产出限制
  *
- * field start
+ * field start 
  * @property   int  $id  记录ID,主键
  * @property   int  $item_id  物品ID,外键关联kku_item_items表
  * @property   int  $limit_type  限制类型(1:全局总量, 2:单个用户, 3:单日全局, 4:单日用户)
@@ -31,7 +31,7 @@ class ItemOutputLimit extends ModelCore
      */
     protected $table = 'item_output_limits';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'item_id',

+ 2 - 2
app/Module/GameItems/Models/ItemPityTime.php

@@ -8,7 +8,7 @@ use UCore\ModelCore;
 /**
  * 宝箱保底计数
  *
- * field start
+ * field start 
  * @property   int  $id  记录ID,主键
  * @property   int  $user_id  用户ID
  * @property   int  $chest_id  宝箱ID,外键关联kku_item_items表
@@ -28,7 +28,7 @@ class ItemPityTime extends ModelCore
      */
     protected $table = 'item_pity_times';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'user_id',

+ 2 - 2
app/Module/GameItems/Models/ItemRecipe.php

@@ -10,7 +10,7 @@ use UCore\ModelCore;
 /**
  * 物品合成配方
  *
- * field start
+ * field start 
  * @property   int  $id  配方ID,主键
  * @property   string  $name  配方名称
  * @property   int  $result_item_id  产出物品ID,外键关联kku_item_items表
@@ -38,7 +38,7 @@ class ItemRecipe extends ModelCore
      */
     protected $table = 'item_recipes';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'name',

+ 2 - 2
app/Module/GameItems/Models/ItemRecipeMaterial.php

@@ -8,7 +8,7 @@ use UCore\ModelCore;
 /**
  * 合成配方材料
  *
- * field start
+ * field start 
  * @property   int  $id  记录ID,主键
  * @property   int  $recipe_id  配方ID,外键关联kku_item_recipes表
  * @property   int  $item_id  材料物品ID,外键关联kku_item_items表
@@ -27,7 +27,7 @@ class ItemRecipeMaterial extends ModelCore
      */
     protected $table = 'item_recipe_materials';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'recipe_id',

+ 3 - 2
app/Module/GameItems/Models/ItemTransactionLog.php

@@ -8,7 +8,7 @@ use UCore\ModelCore;
 /**
  * 物品交易记录
  *
- * field start
+ * field start 
  * @property   int  $id  记录ID,主键
  * @property   int  $user_id  用户ID
  * @property   int  $item_id  物品ID,外键关联kku_item_items表
@@ -20,6 +20,7 @@ use UCore\ModelCore;
  * @property   object|array  $attributes  额外属性,存储交易相关的详细信息
  * @property   string  $expire_at  物品过期时间(如果有)
  * @property   \Carbon\Carbon  $created_at  创建时间
+ * @property   \Carbon\Carbon  $updated_at  更新时间
  * @property   string  $ip_address  操作的IP地址(用于安全审计)
  * @property   string  $device_info  设备信息(用于安全审计)
  * field end
@@ -33,7 +34,7 @@ class ItemTransactionLog extends ModelCore
      */
     protected $table = 'item_transaction_logs';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'user_id',

+ 2 - 2
app/Module/GameItems/Models/ItemUser.php

@@ -8,7 +8,7 @@ use UCore\ModelCore;
 /**
  * 用户物品关联
  *
- * field start
+ * field start 
  * @property   int  $id  记录ID,主键
  * @property   int  $user_id  用户ID
  * @property   int  $item_id  统一属性物品ID,外键关联kku_item_items表
@@ -28,7 +28,7 @@ class ItemUser extends ModelCore
      */
     protected $table = 'item_users';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'user_id',

+ 0 - 60
app/Module/OAuth/Database/oauth_tables.sql

@@ -1,60 +0,0 @@
--- OAuth客户端表
-CREATE TABLE `oauth_clients` (
-    `id` bigint unsigned NOT NULL AUTO_INCREMENT,
-    `name` varchar(255) NOT NULL COMMENT '客户端名称',
-    `client_id` varchar(80) NOT NULL COMMENT '客户端ID',
-    `client_secret` varchar(80) NOT NULL COMMENT '客户端密钥',
-    `redirect_uri` text NOT NULL COMMENT '回调地址',
-    `grant_types` json DEFAULT NULL COMMENT '授权类型',
-    `scope` json DEFAULT NULL COMMENT '权限范围',
-    `user_id` bigint unsigned DEFAULT NULL COMMENT '关联用户ID',
-    `created_at` timestamp NULL DEFAULT NULL,
-    `updated_at` timestamp NULL DEFAULT NULL,
-    PRIMARY KEY (`id`),
-    UNIQUE KEY `oauth_clients_client_id_unique` (`client_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='OAuth客户端表';
-
--- OAuth访问令牌表
-CREATE TABLE `oauth_access_tokens` (
-    `id` bigint unsigned NOT NULL AUTO_INCREMENT,
-    `client_id` varchar(80) NOT NULL COMMENT '客户端ID',
-    `user_id` bigint unsigned DEFAULT NULL COMMENT '用户ID',
-    `access_token` varchar(255) NOT NULL COMMENT '访问令牌',
-    `expires_at` timestamp NULL DEFAULT NULL COMMENT '过期时间',
-    `scope` json DEFAULT NULL COMMENT '权限范围',
-    `created_at` timestamp NULL DEFAULT NULL,
-    `updated_at` timestamp NULL DEFAULT NULL,
-    PRIMARY KEY (`id`),
-    UNIQUE KEY `oauth_access_tokens_token_unique` (`access_token`),
-    KEY `oauth_access_tokens_client_id_index` (`client_id`),
-    KEY `oauth_access_tokens_user_id_index` (`user_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='OAuth访问令牌表';
-
--- OAuth刷新令牌表
-CREATE TABLE `oauth_refresh_tokens` (
-    `id` bigint unsigned NOT NULL AUTO_INCREMENT,
-    `access_token_id` bigint unsigned NOT NULL COMMENT '关联的访问令牌ID',
-    `refresh_token` varchar(255) NOT NULL COMMENT '刷新令牌',
-    `expires_at` timestamp NULL DEFAULT NULL COMMENT '过期时间',
-    `revoked` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已撤销',
-    `created_at` timestamp NULL DEFAULT NULL,
-    `updated_at` timestamp NULL DEFAULT NULL,
-    PRIMARY KEY (`id`),
-    UNIQUE KEY `oauth_refresh_tokens_token_unique` (`refresh_token`),
-    KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='OAuth刷新令牌表';
-
--- OAuth授权码表
-CREATE TABLE `oauth_auth_codes` (
-    `id` bigint unsigned NOT NULL AUTO_INCREMENT,
-    `client_id` varchar(80) NOT NULL COMMENT '客户端ID',
-    `user_id` bigint unsigned NOT NULL COMMENT '用户ID',
-    `auth_code` varchar(255) NOT NULL COMMENT '授权码',
-    `redirect_uri` text NOT NULL COMMENT '重定向URI',
-    `expires_at` timestamp NULL DEFAULT NULL COMMENT '过期时间',
-    `scope` json DEFAULT NULL COMMENT '权限范围',
-    `created_at` timestamp NULL DEFAULT NULL,
-    `updated_at` timestamp NULL DEFAULT NULL,
-    PRIMARY KEY (`id`),
-    UNIQUE KEY `oauth_auth_codes_auth_code_unique` (`auth_code`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='OAuth授权码表';

+ 6 - 0
app/Module/OAuth/Databases/GenerateSql/README.md

@@ -0,0 +1,6 @@
+# 自动生成的SQL文件目录
+
+**警告:这是自动生成的目录,请勿手动修改此目录下的任何文件!**
+
+此目录下的SQL文件由系统自动生成,用于记录数据库表结构。
+如需修改表结构,请修改对应的模型文件,然后重新运行生成命令。

+ 0 - 0
app/Module/OAuth/Databases/createsql/kku_oauth_access_tokens.sql → app/Module/OAuth/Databases/GenerateSql/oauth_access_tokens.sql


+ 0 - 0
app/Module/OAuth/Databases/createsql/kku_oauth_clients.sql → app/Module/OAuth/Databases/GenerateSql/oauth_clients.sql


+ 6 - 0
app/Module/Pet/Databases/GenerateSql/README.md

@@ -0,0 +1,6 @@
+# 自动生成的SQL文件目录
+
+**警告:这是自动生成的目录,请勿手动修改此目录下的任何文件!**
+
+此目录下的SQL文件由系统自动生成,用于记录数据库表结构。
+如需修改表结构,请修改对应的模型文件,然后重新运行生成命令。

+ 0 - 0
app/Module/Pet/Databases/createsql/kku_pet_battle_logs.sql → app/Module/Pet/Databases/GenerateSql/pet_battle_logs.sql


+ 0 - 0
app/Module/Pet/Databases/createsql/kku_pet_battle_seasons.sql → app/Module/Pet/Databases/GenerateSql/pet_battle_seasons.sql


+ 0 - 0
app/Module/Pet/Databases/createsql/kku_pet_battle_team_members.sql → app/Module/Pet/Databases/GenerateSql/pet_battle_team_members.sql


+ 0 - 0
app/Module/Pet/Databases/createsql/kku_pet_battle_teams.sql → app/Module/Pet/Databases/GenerateSql/pet_battle_teams.sql


+ 0 - 0
app/Module/Pet/Databases/createsql/kku_pet_configs.sql → app/Module/Pet/Databases/GenerateSql/pet_configs.sql


+ 0 - 0
app/Module/Pet/Databases/createsql/kku_pet_level_configs.sql → app/Module/Pet/Databases/GenerateSql/pet_level_configs.sql


+ 0 - 0
app/Module/Pet/Databases/createsql/kku_pet_remould_logs.sql → app/Module/Pet/Databases/GenerateSql/pet_remould_logs.sql


+ 0 - 0
app/Module/Pet/Databases/createsql/kku_pet_skill_logs.sql → app/Module/Pet/Databases/GenerateSql/pet_skill_logs.sql


+ 0 - 0
app/Module/Pet/Databases/createsql/kku_pet_skills.sql → app/Module/Pet/Databases/GenerateSql/pet_skills.sql


+ 0 - 0
app/Module/Pet/Databases/createsql/kku_pet_users.sql → app/Module/Pet/Databases/GenerateSql/pet_users.sql


+ 6 - 0
app/Module/Sms/Databases/GenerateSql/README.md

@@ -0,0 +1,6 @@
+# 自动生成的SQL文件目录
+
+**警告:这是自动生成的目录,请勿手动修改此目录下的任何文件!**
+
+此目录下的SQL文件由系统自动生成,用于记录数据库表结构。
+如需修改表结构,请修改对应的模型文件,然后重新运行生成命令。

+ 0 - 0
app/Module/Sms/Databases/createsql/kku_sms_code.sql → app/Module/Sms/Databases/GenerateSql/sms_code.sql


+ 0 - 0
app/Module/Sms/Databases/createsql/kku_sms_config.sql → app/Module/Sms/Databases/GenerateSql/sms_config.sql


+ 0 - 0
app/Module/Sms/Databases/createsql/kku_sms_dbgateway.sql → app/Module/Sms/Databases/GenerateSql/sms_dbgateway.sql


+ 6 - 0
app/Module/System/Databases/GenerateSql/README.md

@@ -0,0 +1,6 @@
+# 自动生成的SQL文件目录
+
+**警告:这是自动生成的目录,请勿手动修改此目录下的任何文件!**
+
+此目录下的SQL文件由系统自动生成,用于记录数据库表结构。
+如需修改表结构,请修改对应的模型文件,然后重新运行生成命令。

+ 0 - 0
app/Module/System/Databases/createsql/kku_admin_actionlogs.sql → app/Module/System/Databases/GenerateSql/admin_actionlogs.sql


+ 0 - 0
app/Module/System/Databases/createsql/kku_admin_grid_views.sql → app/Module/System/Databases/GenerateSql/admin_grid_views.sql


+ 0 - 0
app/Module/System/Databases/createsql/kku_admin_users.sql → app/Module/System/Databases/GenerateSql/admin_users.sql


+ 0 - 0
app/Module/System/Databases/createsql/kku_continuous_times.sql → app/Module/System/Databases/GenerateSql/continuous_times.sql


+ 0 - 0
app/Module/System/Databases/createsql/kku_sys_configs.sql → app/Module/System/Databases/GenerateSql/sys_configs.sql


+ 197 - 0
app/Module/Team/Docs/create.sql

@@ -0,0 +1,197 @@
+-- 团队模块数据库创建脚本
+-- 包含所有团队模块相关表的创建语句
+
+-- 1. 用户推荐关系表 (team_user_referrals)
+-- 存储用户与其直接推荐人(直接上级)的关系
+CREATE TABLE IF NOT EXISTS `kku_team_user_referrals` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `user_id` bigint(20) NOT NULL COMMENT '用户ID',
+  `referrer_id` bigint(20) NOT NULL COMMENT '直接推荐人ID',
+  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `idx_user_id` (`user_id`),
+  KEY `idx_referrer_id` (`referrer_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户直接推荐关系表';
+
+-- 2. 达人等级表 (team_user_talents)
+-- 存储用户的达人等级信息,包括直推人数和团队总人数
+CREATE TABLE IF NOT EXISTS `kku_team_user_talents` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `user_id` bigint(20) NOT NULL COMMENT '用户ID',
+  `talent_level` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '达人等级:0无,1初级,2中级,3高级,4资深,5顶级',
+  `direct_count` int(11) NOT NULL DEFAULT '0' COMMENT '直推人数',
+  `team_count` int(11) NOT NULL DEFAULT '0' COMMENT '团队总人数',
+  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `idx_user_id` (`user_id`),
+  KEY `idx_talent_level` (`talent_level`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='达人等级表';
+
+-- 3. 团队收益记录表 (team_profits)
+-- 记录团队成员产生的分成收益
+CREATE TABLE IF NOT EXISTS `kku_team_profits` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `user_id` bigint(20) NOT NULL COMMENT '获得收益的用户ID',
+  `team_member_id` bigint(20) NOT NULL COMMENT '团队成员ID',
+  `source_id` bigint(20) NOT NULL COMMENT '收益来源ID',
+  `source_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '收益来源类型',
+  `item_id` bigint(20) NOT NULL COMMENT '物品ID',
+  `profit_amount` int(11) NOT NULL COMMENT '分成收益数量',
+  `profit_rate` decimal(5,4) NOT NULL COMMENT '分成比例',
+  `relation_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '关系类型:1直推,2间推',
+  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  PRIMARY KEY (`id`),
+  KEY `idx_user_id` (`user_id`),
+  KEY `idx_team_member_id` (`team_member_id`),
+  KEY `idx_source` (`source_type`,`source_id`),
+  KEY `idx_relation_type` (`relation_type`),
+  KEY `idx_created_at` (`created_at`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='团队收益记录表';
+
+-- 4. 推荐码表 (team_referral_codes)
+-- 存储用户的推荐码信息
+CREATE TABLE IF NOT EXISTS `kku_team_referral_codes` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `user_id` bigint(20) NOT NULL COMMENT '用户ID',
+  `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '推荐码',
+  `usage_count` int(11) NOT NULL DEFAULT '0' COMMENT '使用次数',
+  `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态:1有效,0无效',
+  `expire_time` timestamp NULL DEFAULT NULL COMMENT '过期时间,NULL表示永不过期',
+  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `idx_code` (`code`),
+  UNIQUE KEY `idx_user_id` (`user_id`),
+  KEY `idx_status` (`status`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='推荐码表';
+
+-- 5. 达人等级配置表 (team_talent_configs)
+-- 存储不同达人等级的配置信息
+CREATE TABLE IF NOT EXISTS `kku_team_talent_configs` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `level` tinyint(3) unsigned NOT NULL COMMENT '等级',
+  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '等级名称',
+  `direct_count_required` int(11) NOT NULL COMMENT '所需直推人数',
+  `team_count_required` int(11) NOT NULL COMMENT '所需团队总人数',
+  `profit_rate` decimal(5,4) NOT NULL COMMENT '间推分成比例',
+  `benefits` json DEFAULT NULL COMMENT '等级权益',
+  `icon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '等级图标',
+  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `idx_level` (`level`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='达人等级配置表';
+
+-- 6. 收益分成规则表 (team_profit_rules)
+-- 存储不同来源的收益分成规则
+CREATE TABLE IF NOT EXISTS `kku_team_profit_rules` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `source_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '来源类型',
+  `direct_profit_rate` decimal(5,4) NOT NULL COMMENT '直推分成比例',
+  `max_indirect_level` int(11) NOT NULL DEFAULT '20' COMMENT '最大间推层级',
+  `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态:1有效,0无效',
+  `rules` json DEFAULT NULL COMMENT '特殊规则',
+  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `idx_source_type` (`source_type`),
+  KEY `idx_status` (`status`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='收益分成规则表';
+
+-- 7. 推荐关系修改记录表 (team_referral_changes)
+-- 记录用户推荐关系的修改历史
+CREATE TABLE IF NOT EXISTS `kku_team_referral_changes` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `user_id` bigint(20) NOT NULL COMMENT '用户ID',
+  `old_referrer_id` bigint(20) DEFAULT NULL COMMENT '旧推荐人ID',
+  `new_referrer_id` bigint(20) NOT NULL COMMENT '新推荐人ID',
+  `change_time` timestamp NOT NULL COMMENT '修改时间',
+  `change_reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '修改原因',
+  `changed_by` bigint(20) NOT NULL COMMENT '操作人ID',
+  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  PRIMARY KEY (`id`),
+  KEY `idx_user_id` (`user_id`),
+  KEY `idx_change_time` (`change_time`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='推荐关系修改记录表';
+
+-- 8. 用户关系缓存表 (team_user_relation_cache)
+-- 用于存储用户之间的所有推荐关系(包括上下级关系)
+CREATE TABLE IF NOT EXISTS `kku_team_user_relation_cache` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `user_id` bigint(20) NOT NULL COMMENT '用户ID',
+  `related_user_id` bigint(20) NOT NULL COMMENT '关联用户ID(上级)',
+  `level` tinyint(3) unsigned NOT NULL COMMENT '关系层级:1直接,2间接',
+  `path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '关系路径,格式:1,2,3',
+  `depth` tinyint(3) unsigned NOT NULL COMMENT '层级深度,从1开始',
+  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `idx_user_relation` (`user_id`,`related_user_id`),
+  KEY `idx_user_id` (`user_id`),
+  KEY `idx_related_user_id` (`related_user_id`),
+  KEY `idx_level` (`level`),
+  KEY `idx_depth` (`depth`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户关系缓存表';
+
+-- 9. 邀请奖励记录表 (team_invite_rewards)
+-- 用于记录用户邀请他人注册时获得的奖励
+CREATE TABLE IF NOT EXISTS `kku_team_invite_rewards` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `user_id` bigint(20) NOT NULL COMMENT '获得奖励的用户ID',
+  `invited_user_id` bigint(20) NOT NULL COMMENT '被邀请的用户ID',
+  `reward_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '奖励类型:item=物品,coin=货币,exp=经验',
+  `reward_id` bigint(20) NOT NULL COMMENT '奖励ID(物品ID或货币类型ID)',
+  `reward_amount` int(11) NOT NULL COMMENT '奖励数量',
+  `reward_source` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'register' COMMENT '奖励来源:register=注册,upgrade=升级,task=任务',
+  `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态:0=未发放,1=已发放,2=已过期',
+  `remark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
+  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  PRIMARY KEY (`id`),
+  KEY `idx_user_id` (`user_id`),
+  KEY `idx_invited_user_id` (`invited_user_id`),
+  KEY `idx_reward_type` (`reward_type`),
+  KEY `idx_reward_source` (`reward_source`),
+  KEY `idx_status` (`status`),
+  KEY `idx_created_at` (`created_at`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='邀请奖励记录表';
+
+-- 10. 邀请码使用记录表 (team_referral_code_usages)
+-- 用于详细记录每次邀请码的使用情况
+CREATE TABLE IF NOT EXISTS `kku_team_referral_code_usages` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '使用的邀请码',
+  `code_owner_id` bigint(20) NOT NULL COMMENT '邀请码所有者用户ID',
+  `user_id` bigint(20) NOT NULL COMMENT '使用邀请码的用户ID',
+  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '使用时的IP地址',
+  `user_agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '使用时的用户代理',
+  `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态:0=失败,1=成功,2=已撤销',
+  `result` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '使用结果描述',
+  `remark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
+  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  PRIMARY KEY (`id`),
+  KEY `idx_code` (`code`),
+  KEY `idx_code_owner_id` (`code_owner_id`),
+  KEY `idx_user_id` (`user_id`),
+  KEY `idx_status` (`status`),
+  KEY `idx_created_at` (`created_at`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='邀请码使用记录表';
+
+-- 初始化数据
+
+-- 1. 达人等级配置数据
+INSERT INTO `kku_team_talent_configs` (`level`, `name`, `direct_count_required`, `team_count_required`, `profit_rate`, `benefits`) VALUES
+(1, '初级达人', 5, 10, 0.0100, '{"farm_output_bonus": 0.01}'),
+(2, '中级达人', 10, 30, 0.0150, '{"farm_output_bonus": 0.02}'),
+(3, '高级达人', 20, 50, 0.0200, '{"farm_output_bonus": 0.03, "daily_gift": {"item_id": 1001, "amount": 1}}'),
+(4, '资深达人', 30, 100, 0.0250, '{"farm_output_bonus": 0.04, "daily_gift": {"item_id": 1001, "amount": 2}}'),
+(5, '顶级达人', 50, 200, 0.0300, '{"farm_output_bonus": 0.05, "daily_gift": {"item_id": 1001, "amount": 3}, "special_privileges": ["vip_customer_service", "exclusive_avatar_frame"]}');
+
+-- 2. 收益分成规则数据
+INSERT INTO `kku_team_profit_rules` (`source_type`, `direct_profit_rate`, `max_indirect_level`, `status`, `rules`) VALUES
+('farm_harvest', 0.0500, 20, 1, '{"min_amount": 10, "max_amount": 1000}'),
+('task_complete', 0.0300, 10, 1, '{"min_amount": 5, "max_amount": 500}'),
+('item_sell', 0.0200, 5, 1, '{"min_amount": 1, "max_amount": 100, "excluded_items": [1001, 1002]}');

+ 62 - 24
app/Module/Team/Docs/推荐关系系统.md

@@ -403,36 +403,74 @@ private function clearReferralCaches(int $userId, ?int $oldReferrerId, int $newR
 }
 ```
 
-### 4.4 推荐码验证
+### 4.4 推荐码验证与使用记录
 
-用户注册时,系统验证推荐码并获取推荐人ID:
+用户注册时,系统验证推荐码并获取推荐人ID。验证过程包括
 
-```php
-/**
- * 验证推荐码
- */
-public function verifyReferralCode(string $code): ?int
-{
-    // 查询推荐码
-    $referralCode = $this->referralCodeRepository->getByCode($code);
+1. 查询推荐码是否存在
+2. 验证推荐码的有效性(状态是否为有效)
+3. 检查推荐码是否已过期
+4. 更新推荐码的使用次数
+5. 记录邀请码使用情况(无论成功与否)
+6. 返回推荐码对应的推荐人ID
 
-    // 验证推荐码有效性
-    if (!$referralCode || $referralCode->status != 1) {
-        return null;
-    }
+验证成功后,系统将使用返回的推荐人ID建立推荐关系。
 
-    // 验证推荐码是否过期
-    if ($referralCode->expire_time && $referralCode->expire_time < now()) {
-        return null;
-    }
+系统会详细记录每次邀请码的使用情况,包括:
 
-    // 更新使用次数
-    $this->referralCodeRepository->incrementUsageCount($referralCode->id);
+1. **使用的邀请码**:记录用户输入的邀请码
+2. **邀请码所有者**:记录邀请码属于哪个用户
+3. **使用者信息**:记录使用邀请码的用户ID、IP地址和用户代理
+4. **使用结果**:记录使用是否成功,以及失败原因
+5. **使用时间**:记录邀请码使用的时间
 
-    // 返回推荐人ID
-    return $referralCode->user_id;
-}
-```
+邀请码使用记录可用于:
+
+1. **邀请统计**:统计用户成功邀请的人数
+2. **防止刷邀请**:检测同一IP地址短时间内多次使用邀请码的情况
+3. **邀请追踪**:追踪邀请链路,分析用户邀请行为
+4. **问题排查**:当用户反馈邀请码问题时,可查询使用记录进行排查
+
+### 4.5 邀请奖励发放
+
+当用户成功邀请他人注册或被邀请用户达成特定条件(如升级、完成任务等)时,系统会发放邀请奖励。奖励发放流程包括:
+
+1. **验证用户关系**:确认邀请人和被邀请人的推荐关系存在
+2. **获取奖励配置**:根据奖励来源(注册、升级、任务等)获取对应的奖励配置
+3. **检查重复发放**:确保同一来源的奖励不会重复发放(注册奖励除外)
+4. **创建奖励记录**:在邀请奖励记录表中创建奖励记录
+5. **发放实际奖励**:根据奖励类型(物品、货币、经验等)调用相应服务发放实际奖励
+6. **更新奖励状态**:将奖励记录状态更新为已发放
+7. **触发奖励事件**:触发邀请奖励发放事件,供其他模块响应
+
+系统支持多种奖励类型:
+- **物品奖励**:向用户背包添加指定物品
+- **货币奖励**:向用户账户添加指定类型的货币
+- **经验奖励**:为用户增加经验值
+
+### 4.6 邀请奖励查询
+
+系统提供多种方式查询邀请奖励记录,支持按用户、被邀请用户、奖励类型、来源和状态进行筛选:
+
+1. **获取用户的邀请奖励记录**:查询用户获得的所有邀请奖励,支持分页和多种筛选条件
+2. **获取被邀请用户产生的奖励记录**:查询特定被邀请用户为他人产生的所有奖励记录
+3. **统计用户邀请奖励总量**:统计用户获得的各类型奖励总量和邀请总人数
+
+查询结果包含详细的奖励信息,如奖励类型、数量、来源、状态等,以及相关用户的基本信息(用户名、头像等)。
+
+### 4.7 邀请码使用记录查询
+
+系统提供多种方式查询邀请码的使用记录,支持按邀请码、邀请码所有者、使用者和使用结果等条件进行筛选:
+
+1. **查询特定邀请码的使用记录**:查询某个邀请码的所有使用记录,包括成功和失败的记录
+2. **查询用户使用的邀请码记录**:查询特定用户使用过的所有邀请码记录
+3. **查询邀请码所有者的邀请记录**:查询特定用户的邀请码被他人使用的记录
+4. **查询特定状态的邀请码使用记录**:查询成功、失败或被撤销的邀请码使用记录
+5. **统计邀请码所有者的邀请人数**:统计用户成功邀请的总人数
+6. **查询特定时间段的邀请记录**:查询某个时间段内的邀请码使用情况
+7. **查询特定IP地址的邀请记录**:查询来自特定IP地址的邀请码使用记录,用于防止刷邀请
+
+查询结果包含详细的邀请码使用信息,如邀请码、使用者、使用时间、使用结果等,以及相关用户的基本信息。
 
 ## 5. 推荐关系存储策略
 

+ 119 - 14
app/Module/Team/Docs/数据库设计.md

@@ -12,6 +12,8 @@
 6. **team_profit_rules** - 收益分成规则表
 7. **team_referral_changes** - 推荐关系修改记录表
 8. **team_user_relation_cache** - 用户关系缓存表
+9. **team_invite_rewards** - 邀请奖励记录表
+10. **team_referral_code_usages** - 邀请码使用记录表
 
 ## 2. 表结构详细设计
 
@@ -198,26 +200,122 @@ CREATE TABLE `team_user_relation_cache` (
 | created_at | timestamp | 创建时间 |
 | updated_at | timestamp | 更新时间 |
 
+### 2.9 邀请奖励记录表 (team_invite_rewards)
+
+邀请奖励记录表用于记录用户邀请他人注册时获得的奖励,支持多种奖励类型和来源追踪。
+
+```sql
+CREATE TABLE `team_invite_rewards` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `user_id` bigint(20) NOT NULL COMMENT '获得奖励的用户ID',
+  `invited_user_id` bigint(20) NOT NULL COMMENT '被邀请的用户ID',
+  `reward_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '奖励类型:item=物品,coin=货币,exp=经验',
+  `reward_id` bigint(20) NOT NULL COMMENT '奖励ID(物品ID或货币类型ID)',
+  `reward_amount` int(11) NOT NULL COMMENT '奖励数量',
+  `reward_source` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'register' COMMENT '奖励来源:register=注册,upgrade=升级,task=任务',
+  `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态:0=未发放,1=已发放,2=已过期',
+  `remark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
+  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  PRIMARY KEY (`id`),
+  KEY `idx_user_id` (`user_id`),
+  KEY `idx_invited_user_id` (`invited_user_id`),
+  KEY `idx_reward_type` (`reward_type`),
+  KEY `idx_reward_source` (`reward_source`),
+  KEY `idx_status` (`status`),
+  KEY `idx_created_at` (`created_at`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='邀请奖励记录表';
+```
+
+**字段说明**:
+
+| 字段名 | 类型 | 说明 |
+|--------|------|------|
+| id | bigint | 主键ID |
+| user_id | bigint | 获得奖励的用户ID |
+| invited_user_id | bigint | 被邀请的用户ID |
+| reward_type | varchar | 奖励类型:item=物品,coin=货币,exp=经验 |
+| reward_id | bigint | 奖励ID(物品ID或货币类型ID) |
+| reward_amount | int | 奖励数量 |
+| reward_source | varchar | 奖励来源:register=注册,upgrade=升级,task=任务 |
+| status | tinyint | 状态:0=未发放,1=已发放,2=已过期 |
+| remark | varchar | 备注 |
+| created_at | timestamp | 创建时间 |
+| updated_at | timestamp | 更新时间 |
+
 **示例数据**:
 ```
-id | user_id | related_user_id | level | path      | depth
----|---------|----------------|-------|-----------|------
-1  | 4       | 3              | 1     | 3         | 1
-2  | 4       | 2              | 2     | 3,2       | 2
-3  | 4       | 1              | 2     | 3,2,1     | 3
-4  | 3       | 2              | 1     | 2         | 1
-5  | 3       | 1              | 2     | 2,1       | 2
-6  | 2       | 1              | 1     | 1         | 1
+id | user_id | invited_user_id | reward_type | reward_id | reward_amount | reward_source | status | created_at
+---|---------|----------------|------------|-----------|--------------|--------------|--------|------------
+1  | 1       | 2              | item        | 1001      | 5            | register     | 1      | 2023-05-01 10:00:00
+2  | 1       | 3              | coin        | 1         | 100          | register     | 1      | 2023-05-02 11:00:00
+3  | 2       | 4              | exp         | 0         | 50           | register     | 1      | 2023-05-03 12:00:00
+4  | 1       | 2              | item        | 1002      | 1            | upgrade      | 1      | 2023-05-10 10:00:00
 ```
 
 在上面的示例中:
-- 用户4的直接上级是用户3(level=1)
-- 用户4的间接上级是用户2和用户1(level=2)
-- 用户3的直接上级是用户2(level=1)
-- 用户3的间接上级是用户1(level=2)
-- 用户2的直接上级是用户1(level=1)
+- 用户1邀请用户2注册,获得了5个ID为1001的物品奖励
+- 用户1邀请用户3注册,获得了100个ID为1的货币奖励
+- 用户2邀请用户4注册,获得了50点经验值奖励
+- 当用户2升级时,用户1获得了1个ID为1002的物品奖励
+
+### 2.10 邀请码使用记录表 (team_referral_code_usages)
 
-**查询示例**:
+邀请码使用记录表用于详细记录每次邀请码的使用情况,包括谁使用了哪个邀请码、何时使用、使用结果等信息。
+
+```sql
+CREATE TABLE `team_referral_code_usages` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+  `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '使用的邀请码',
+  `code_owner_id` bigint(20) NOT NULL COMMENT '邀请码所有者用户ID',
+  `user_id` bigint(20) NOT NULL COMMENT '使用邀请码的用户ID',
+  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '使用时的IP地址',
+  `user_agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '使用时的用户代理',
+  `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态:0=失败,1=成功,2=已撤销',
+  `result` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '使用结果描述',
+  `remark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
+  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+  PRIMARY KEY (`id`),
+  KEY `idx_code` (`code`),
+  KEY `idx_code_owner_id` (`code_owner_id`),
+  KEY `idx_user_id` (`user_id`),
+  KEY `idx_status` (`status`),
+  KEY `idx_created_at` (`created_at`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='邀请码使用记录表';
+```
+
+**字段说明**:
+
+| 字段名 | 类型 | 说明 |
+|--------|------|------|
+| id | bigint | 主键ID |
+| code | varchar | 使用的邀请码 |
+| code_owner_id | bigint | 邀请码所有者用户ID |
+| user_id | bigint | 使用邀请码的用户ID |
+| ip_address | varchar | 使用时的IP地址 |
+| user_agent | varchar | 使用时的用户代理 |
+| status | tinyint | 状态:0=失败,1=成功,2=已撤销 |
+| result | varchar | 使用结果描述 |
+| remark | varchar | 备注 |
+| created_at | timestamp | 创建时间 |
+| updated_at | timestamp | 更新时间 |
+
+**示例数据**:
+```
+id | code     | code_owner_id | user_id | ip_address    | status | result                | created_at
+---|----------|--------------|---------|---------------|--------|----------------------|------------
+1  | ABC123   | 1            | 2       | 192.168.1.1   | 1      | 注册成功               | 2023-05-01 10:00:00
+2  | DEF456   | 3            | 4       | 192.168.1.2   | 1      | 注册成功               | 2023-05-02 11:00:00
+3  | ABC123   | 1            | 5       | 192.168.1.3   | 0      | 邀请码已过期            | 2023-05-03 12:00:00
+4  | GHI789   | 6            | 7       | 192.168.1.4   | 2      | 管理员撤销             | 2023-05-04 13:00:00
+```
+
+在上面的示例中:
+- 用户2成功使用了用户1的邀请码ABC123注册
+- 用户4成功使用了用户3的邀请码DEF456注册
+- 用户5尝试使用用户1的邀请码ABC123,但失败了,原因是邀请码已过期
+- 用户7使用了用户6的邀请码GHI789,但后来被管理员撤销了
 
 1. 查询用户4的所有上级:
 ```sql
@@ -291,6 +389,11 @@ WHERE r.related_user_id = 1 AND r.depth = 2;
 7. **用户与推荐关系修改**:一个用户可以有多条推荐关系修改记录(1:N)
 8. **用户与关系缓存**:一个用户可以有多条关系缓存记录,包括与其上级和下级的关系(1:N)
 9. **推荐关系与关系缓存**:推荐关系表中的直接关系是关系缓存表的数据来源,关系缓存表通过计算扩展为完整的上下级关系网络
+10. **用户与邀请奖励**:一个用户可以有多条邀请奖励记录(1:N)
+11. **被邀请用户与邀请奖励**:一个被邀请用户可以关联多条邀请奖励记录(1:N),例如注册奖励和升级奖励
+12. **推荐码与使用记录**:一个推荐码可以有多条使用记录(1:N)
+13. **用户与邀请码使用**:一个用户可以使用多个邀请码(1:N),但每个邀请码只能被一个用户成功使用
+14. **邀请码所有者与使用记录**:一个邀请码所有者可以有多条邀请码被使用的记录(1:N)
 
 ## 4. 索引设计
 
@@ -317,6 +420,8 @@ WHERE r.related_user_id = 1 AND r.depth = 2;
 - `team_profit_rules`: `status`
 - `team_referral_changes`: `user_id`, `change_time`
 - `team_user_relation_cache`: `user_id`, `related_user_id`, `level`, `depth`(支持各种查询场景)
+- `team_invite_rewards`: `user_id`, `invited_user_id`, `reward_type`, `reward_source`, `status`, `created_at`(支持多种查询和统计场景)
+- `team_referral_code_usages`: `code`, `code_owner_id`, `user_id`, `status`, `created_at`(支持邀请码使用记录的多种查询场景)
 
 ## 5. JSON字段结构
 

+ 6 - 0
app/Module/Test/Databases/GenerateSql/README.md

@@ -0,0 +1,6 @@
+# 自动生成的SQL文件目录
+
+**警告:这是自动生成的目录,请勿手动修改此目录下的任何文件!**
+
+此目录下的SQL文件由系统自动生成,用于记录数据库表结构。
+如需修改表结构,请修改对应的模型文件,然后重新运行生成命令。

+ 16 - 0
app/Module/Test/Databases/GenerateSql/test.sql

@@ -0,0 +1,16 @@
+-- 表 kku_test 的创建SQL
+
+DROP TABLE IF EXISTS `kku_test`;
+CREATE TABLE `kku_test` (
+  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
+  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '名称',
+  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '编码',
+  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '描述',
+  `data` json DEFAULT NULL COMMENT '数据',
+  `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态:0禁用 1启用',
+  `created_at` timestamp NULL DEFAULT NULL,
+  `updated_at` timestamp NULL DEFAULT NULL,
+  `deleted_at` timestamp NULL DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `test_code_unique` (`code`)
+) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

+ 6 - 0
app/Module/Ulogic/Databases/GenerateSql/README.md

@@ -0,0 +1,6 @@
+# 自动生成的SQL文件目录
+
+**警告:这是自动生成的目录,请勿手动修改此目录下的任何文件!**
+
+此目录下的SQL文件由系统自动生成,用于记录数据库表结构。
+如需修改表结构,请修改对应的模型文件,然后重新运行生成命令。

+ 0 - 0
app/Module/Ulogic/Databases/createsql/kku_app_message_recipients.sql → app/Module/Ulogic/Databases/GenerateSql/app_message_recipients.sql


+ 0 - 0
app/Module/Ulogic/Databases/createsql/kku_app_message_templates.sql → app/Module/Ulogic/Databases/GenerateSql/app_message_templates.sql


+ 0 - 0
app/Module/Ulogic/Databases/createsql/kku_app_messages.sql → app/Module/Ulogic/Databases/GenerateSql/app_messages.sql


+ 0 - 0
app/Module/Ulogic/Databases/createsql/kku_user_daytimes.sql → app/Module/Ulogic/Databases/GenerateSql/user_daytimes.sql


+ 0 - 0
app/Module/Ulogic/Databases/createsql/kku_user_punishs.sql → app/Module/Ulogic/Databases/GenerateSql/user_punishs.sql


+ 0 - 0
app/Module/Ulogic/Databases/createsql/kku_user_times.sql → app/Module/Ulogic/Databases/GenerateSql/user_times.sql


+ 0 - 71
app/Module/Ulogic/Databases/app_messagetables.sql

@@ -1,71 +0,0 @@
--- 消息表
-CREATE TABLE `kku_app_messages` (
-    `id` bigint unsigned NOT NULL AUTO_INCREMENT,
-    `type` varchar(20) NOT NULL COMMENT '消息类型:system=系统消息,user=用户消息',
-    `template_id` bigint unsigned DEFAULT NULL COMMENT '模板ID,为空表示非模板消息',
-    `template_code` varchar(50) DEFAULT NULL COMMENT '模板代码,冗余字段,方便查询',
-    `title` varchar(255) NOT NULL COMMENT '消息标题',
-    `content` text NOT NULL COMMENT '消息内容',
-    `content_type` varchar(20) NOT NULL DEFAULT 'text' COMMENT '内容类型:text=纯文本,html=富文本,markdown=MD格式,json=JSON格式',
-    `data` json DEFAULT NULL COMMENT '消息数据',
-    `variables_data` json DEFAULT NULL COMMENT '模板变量数据,用于存储模板变量的实际值',
-    `sender_id` bigint unsigned NOT NULL COMMENT '发送者ID',
-    `sender_type` varchar(20) NOT NULL COMMENT '发送者类型:system=系统,user=用户',
-    `receiver_id` bigint unsigned DEFAULT NULL COMMENT '接收者ID,为空表示群发',
-    `parent_id` bigint unsigned DEFAULT NULL COMMENT '父消息ID,用于消息回复',
-    `allow_reply` tinyint NOT NULL DEFAULT '1' COMMENT '是否允许回复:0不允许 1允许',
-    `is_read` tinyint NOT NULL DEFAULT '0' COMMENT '是否已读:0未读 1已读',
-    `read_at` timestamp NULL DEFAULT NULL COMMENT '阅读时间',
-    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态:0删除 1正常',
-    `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
-    `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
-    PRIMARY KEY (`id`),
-    KEY `kku_app_messages_type_index` (`type`),
-    KEY `kku_app_messages_template_id_index` (`template_id`),
-    KEY `kku_app_messages_template_code_index` (`template_code`),
-    KEY `kku_app_messages_content_type_index` (`content_type`),
-    KEY `kku_app_messages_sender_id_index` (`sender_id`),
-    KEY `kku_app_messages_receiver_id_index` (`receiver_id`),
-    KEY `kku_app_messages_parent_id_index` (`parent_id`),
-    KEY `kku_app_messages_is_read_index` (`is_read`),
-    KEY `kku_app_messages_status_index` (`status`),
-    CONSTRAINT `kku_app_messages_template_id_foreign` FOREIGN KEY (`template_id`) REFERENCES `kku_app_message_templates` (`id`) ON DELETE SET NULL
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='站内信消息表';
-
--- 消息接收表(用于群发消息)
-CREATE TABLE `kku_app_message_recipients` (
-    `id` bigint unsigned NOT NULL AUTO_INCREMENT,
-    `message_id` bigint unsigned NOT NULL COMMENT '消息ID',
-    `user_id` bigint unsigned NOT NULL COMMENT '用户ID',
-    `is_read` tinyint NOT NULL DEFAULT '0' COMMENT '是否已读:0未读 1已读',
-    `read_at` timestamp NULL DEFAULT NULL COMMENT '阅读时间',
-    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态:0删除 1正常',
-    `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
-    `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
-    PRIMARY KEY (`id`),
-    UNIQUE KEY `kku_app_message_recipients_message_user_unique` (`message_id`, `user_id`),
-    KEY `kku_app_message_recipients_user_id_index` (`user_id`),
-    KEY `kku_app_message_recipients_is_read_index` (`is_read`),
-    KEY `kku_app_message_recipients_status_index` (`status`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='站内信群发接收表';
-
--- 消息模板表
-CREATE TABLE `kku_app_message_templates` (
-    `id` bigint unsigned NOT NULL AUTO_INCREMENT,
-    `name` varchar(100) NOT NULL COMMENT '模板名称',
-    `code` varchar(50) NOT NULL COMMENT '模板代码',
-    `type` varchar(20) NOT NULL COMMENT '消息类型:system=系统消息,user=用户消息',
-    `title` varchar(255) NOT NULL COMMENT '消息标题',
-    `content` text NOT NULL COMMENT '消息内容',
-    `content_type` varchar(20) NOT NULL DEFAULT 'text' COMMENT '内容类型:text=纯文本,html=富文本,markdown=MD格式,json=JSON格式',
-    `variables` json DEFAULT NULL COMMENT '变量定义',
-    `allow_reply` tinyint NOT NULL DEFAULT '1' COMMENT '是否允许回复:0不允许 1允许',
-    `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态:0禁用 1启用',
-    `created_at` timestamp NULL DEFAULT NULL COMMENT '创建时间',
-    `updated_at` timestamp NULL DEFAULT NULL COMMENT '更新时间',
-    PRIMARY KEY (`id`),
-    UNIQUE KEY `kku_app_message_templates_code_unique` (`code`),
-    KEY `kku_app_message_templates_type_index` (`type`),
-    KEY `kku_app_message_templates_content_type_index` (`content_type`),
-    KEY `kku_app_message_templates_status_index` (`status`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='站内信模板表';

+ 0 - 113
app/Module/Ulogic/Internal.php

@@ -1,113 +0,0 @@
-<?php
-
-namespace App\Module\Ulogic;
-
-
-use App\Module\Ulogic\Enum\INTERNAL_TYPE;
-
-/**
- * 站内信
- *
- */
-class Internal
-{
-
-    /**
-     * 列表
-     *
-     * @param $page
-     * @param $limit
-     * @param $w
-     * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
-     */
-    public static function list1($page, $limit, $w, $order ='')
-    {
-        $q = \App\Module\Ulogic\Model\Internal::query();
-        if($order){
-            $q = $q->orderBy($order);
-        }else{
-            $q = $q->orderBy('id','desc');
-
-        }
-        if ($w['user_id'] ?? 0) {
-            $q = $q->where('user_id', '=', $w['user_id']);
-        }
-        if ($w['is_read'] ?? '') {
-            $q = $q->where('is_read', '=', $w['is_read']);
-        }
-
-        return $q->paginate($limit, [ '*' ], '', $page);
-    }
-
-    /**
-     * 发送消息
-     *
-     * @param $user_id
-     * @param $to_user_id
-     * @param $content
-     * @param $app_data
-     * @param $cate
-     * @return bool
-     */
-    static public function send($user_id, $to_user_id, $content, $app_data, $cate = 0,$admin_id = 0)
-    {
-        $model          = new \App\Module\Ulogic\Model\Internal();
-        $model->status  = 0;
-        $model->is_read = 0;
-        $model->content = $content;
-        $model->cate    = $cate;
-        $model->from_id = $user_id;
-        if($user_id){
-            $model->type1= INTERNAL_TYPE::USER;
-        }
-        if(!$user_id){
-            if($admin_id){
-                $model->type1= INTERNAL_TYPE::ADMIN;
-            }else{
-                $model->type1= INTERNAL_TYPE::SYSTEM;
-            }
-        }
-        $model->admin_id = $admin_id;
-        $model->user_id = $to_user_id;
-        $model->data    = serialize($app_data);
-        $model->save();
-        $model->refresh();
-//        $model->at_users = '';
-        if ($model->id > 0) {
-            return true;
-        }
-
-        return false;
-
-    }
-
-    /**
-     * 单条信息
-     * @param $where
-     * @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model|null
-     */
-    static public function info($where)
-    {
-        return  \App\Module\Ulogic\Model\Internal::query()->where($where)->first();
-    }
-
-    /**
-     * 设置已读
-     *
-     * @param $ids
-     * @return void
-     */
-    static public function reads($ids, $user_id = null)
-    {
-
-        $q = \App\Module\Ulogic\Model\Internal::query()->whereIn('id', $ids);
-        if ($user_id) {
-            $q = $q->where('user_id', $user_id);
-        }
-
-        $q->update([
-                       'is_read' => 1
-                   ]);
-    }
-
-}

+ 0 - 86
app/Module/Ulogic/Models/Internal.php

@@ -1,86 +0,0 @@
-<?php
-
-namespace App\Module\Ulogic\Model;
-
-use App\Module\Ulogic\Enum\INTERNAL_TYPE;
-use App\Module\User\Services\UserService;
-use Illuminate\Database\Eloquent\SoftDeletes;
-use UCore\ModelCore;
-
-/**
- * 站内信
- * field start
- * @property   int  $id
- * @property   int  $admin_id  管理员ID
- * @property   int  $from_id  来源用户ID
- * @property   int  $user_id
- * @property   int  $cate  分类
- * @property   int  $is_read  是否已读
- * @property   string  $status  状态
- * @property   int  $type1  类型
- * @property   string  $content  内容
- * @property   int  $template_id  模板ID
- * @property   string  $at_users  at的用户
- * @property   string  $data  数据
- * @property   \Carbon\Carbon  $created_at
- * @property   \Carbon\Carbon  $updated_at
- * @property   \Carbon\Carbon  $deleted_at  删除时间
- * field end
- *
- */
-class Internal extends ModelCore
-{
-
-    use SoftDeletes;
-
-    protected $casts = [
-        'type1' => INTERNAL_TYPE::class
-    ];
-
-    // attrlist start
-  public static $attrlist = array (
-  0 => 'id',
-  1 => 'admin_id',
-  2 => 'from_id',
-  3 => 'user_id',
-  4 => 'cate',
-  5 => 'is_read',
-  6 => 'status',
-  7 => 'type1',
-  8 => 'content',
-  9 => 'template_id',
-  10 => 'at_users',
-  11 => 'data',
-  12 => 'created_at',
-  13 => 'updated_at',
-  14 => 'deleted_at',
-);
- //attrlist end
-
-
-    protected $table = 'user_internals';
-
-    protected $appends = [
-        'from_info'
-    ];
-
-    public function getFromInfoAttribute()
-    {
-        if ($this->from_id == 0) {
-            return [
-                'nickname' => '管理员',
-                'avatar'   => 1
-            ];
-        }
-
-        $infos = UserService::pinfos([ $this->from_id ]);
-
-        return $infos[$this->from_id] ?? [
-            'nickname' => '未知',
-            'user_id'  => $this->from_id,
-            'avatar'   => 0
-        ];
-    }
-
-
-}

+ 6 - 0
app/Module/User/Databases/GenerateSql/README.md

@@ -0,0 +1,6 @@
+# 自动生成的SQL文件目录
+
+**警告:这是自动生成的目录,请勿手动修改此目录下的任何文件!**
+
+此目录下的SQL文件由系统自动生成,用于记录数据库表结构。
+如需修改表结构,请修改对应的模型文件,然后重新运行生成命令。

+ 0 - 0
app/Module/User/Databases/createsql/kku_user_actions.sql → app/Module/User/Databases/GenerateSql/user_actions.sql


+ 0 - 0
app/Module/User/Databases/createsql/kku_user_infos.sql → app/Module/User/Databases/GenerateSql/user_infos.sql


+ 0 - 0
app/Module/User/Databases/createsql/kku_user_phones.sql → app/Module/User/Databases/GenerateSql/user_phones.sql


+ 0 - 0
app/Module/User/Databases/createsql/kku_user_secret_passwords.sql → app/Module/User/Databases/GenerateSql/user_secret_passwords.sql


Неке датотеке нису приказане због велике количине промена