Your Name 8 месяцев назад
Родитель
Сommit
8dcbdafbfb

+ 0 - 80
app/Module/Game/Models/Test.php

@@ -1,80 +0,0 @@
-<?php
-
-namespace App\Module\Game\Models;
-
-use App\Module\Game\Database\Factories\TestFactory;
-use Illuminate\Database\Eloquent\Factories\HasFactory;
-use UCore\ModelCore;
-use Illuminate\Database\Eloquent\SoftDeletes;
-use App\Module\Game\Events\TestEvent;
-
-/**
- * App\Module\Game\Models\Test
- *
- * field start
- * @property   int  $id
- * @property   string  $name  名称
- * @property   string  $code  编码
- * @property   string  $description  描述
- * @property   object|array  $data  数据
- * @property   int  $status  状态:0禁用 1启用
- * @property   \Carbon\Carbon  $created_at
- * @property   \Carbon\Carbon  $updated_at
- * @property   \Carbon\Carbon  $deleted_at
- * field end
- */
-class Test extends ModelCore
-{
-    use HasFactory, SoftDeletes;
-
-    /**
-     * 与模型关联的表名
-     *
-     * @var string
-     */
-    protected $table = 'test';
-
-    // attrlist start
-    protected $fillable = [
-        'id',
-        'name',
-        'code',
-        'description',
-        'data',
-        'status',
-    ];
-    // attrlist end
-
-
-
-    /**
-     * 应该被调整为日期的属性
-     *
-     * @var array
-     */
-    protected $dates = [
-        'created_at',
-        'updated_at',
-        'deleted_at'
-    ];
-
-    /**
-     * 属性类型转换
-     *
-     * @var array
-     */
-    protected $casts = [
-        'data' => 'array',
-        'status' => 'integer'
-    ];
-
-    /**
-     * 创建一个新的工厂实例
-     *
-     * @return \Illuminate\Database\Eloquent\Factories\Factory
-     */
-    protected static function newFactory()
-    {
-        return TestFactory::new();
-    }
-}

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

@@ -9,7 +9,7 @@ use UCore\ModelCore;
 /**
  * 宝箱内容配置
  *
- * field start
+ * field start 
  * @property   int  $id  记录ID,主键
  * @property   int  $chest_id  宝箱物品ID,外键关联kku_item_items表
  * @property   int  $item_id  可能获得的物品ID,外键关联kku_item_items表(与group_id二选一)
@@ -33,7 +33,7 @@ class ItemChestContent extends ModelCore
      */
     protected $table = 'item_chest_contents';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'chest_id',

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

@@ -8,7 +8,7 @@ use UCore\ModelCore;
 /**
  * 物品组
  *
- * field start
+ * field start 
  * @property   int  $id  物品组ID,主键
  * @property   string  $name  物品组名称
  * @property   string  $code  物品组编码(唯一)
@@ -26,7 +26,7 @@ class ItemGroup extends ModelCore
      */
     protected $table = 'item_groups';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'name',

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

@@ -8,7 +8,7 @@ use UCore\ModelCore;
 /**
  * 物品组内容
  *
- * field start
+ * field start 
  * @property   int  $id  记录ID,主键
  * @property   int  $group_id  物品组ID,外键关联kku_item_groups表
  * @property   int  $item_id  物品ID,外键关联kku_item_items表
@@ -26,7 +26,7 @@ class ItemGroupItem extends ModelCore
      */
     protected $table = 'item_group_items';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'group_id',

+ 10 - 9
app/Module/Pet/Models/Pet.php

@@ -11,17 +11,17 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
 /**
  * 宠物模型
  *
- * field start
- * @property   int  $id  宠物ID,主键
+ * field start 
+ * @property   int  $id  
  * @property   int  $user_id  用户ID
  * @property   string  $name  宠物名称
- * @property   string  $grade  品阶(FIRST,SECOND,THIRD,FOURTH)
- * @property   int  $level  等级
- * @property   int  $experience  经验值
- * @property   int  $stamina  体力值
+ * @property   string  $grade  
+ * @property   int  $level  
+ * @property   int  $experience  
+ * @property   int  $stamina  
  * @property   int  $status  宠物状态:0未知,1正常,2战斗中,3死亡
- * @property   \Carbon\Carbon  $created_at  创建时间
- * @property   \Carbon\Carbon  $updated_at  更新时间
+ * @property   \Carbon\Carbon  $created_at  
+ * @property   \Carbon\Carbon  $updated_at  
  * field end
  */
 class Pet extends ModelCore
@@ -38,8 +38,9 @@ class Pet extends ModelCore
      *
      * @var array
      */
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
+        'id',
         'user_id',
         'name',
         'grade',

+ 5 - 4
app/Module/Pet/Models/PetBattleLog.php

@@ -9,14 +9,14 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
  * 宠物战斗记录模型
  *
  * field start 
- * @property   int  $id  记录ID,主键
- * @property   int  $pet_id  宠物ID
+ * @property   int  $id  
+ * @property   int  $pet_id  
  * @property   int  $battle_type  战斗类型:1偷菜,2守护,3争霸赛
  * @property   int  $opponent_id  对手ID(可为空)
  * @property   int  $result  战斗结果:0失败,1胜利
  * @property   object|array  $reward  战斗奖励
- * @property   \Carbon\Carbon  $battle_time  战斗时间
- * @property   \Carbon\Carbon  $created_at  创建时间
+ * @property   string  $battle_time  
+ * @property   \Carbon\Carbon  $created_at  
  * field end
  */
 class PetBattleLog extends ModelCore
@@ -43,6 +43,7 @@ class PetBattleLog extends ModelCore
 
     // attrlist start 
     protected $fillable = [
+        'id',
         'pet_id',
         'battle_type',
         'opponent_id',

+ 6 - 5
app/Module/Pet/Models/PetBattleSeason.php

@@ -9,15 +9,15 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
  * 宠物争霸赛赛季模型
  *
  * field start 
- * @property   int  $id  赛季ID,主键
+ * @property   int  $id  
  * @property   string  $name  赛季名称
- * @property   \Carbon\Carbon  $start_time  开始时间
- * @property   \Carbon\Carbon  $end_time  结束时间
+ * @property   string  $start_time  开始时间
+ * @property   string  $end_time  结束时间
  * @property   int  $boss_power  Boss战力
  * @property   object|array  $reward_pool  奖池配置
  * @property   int  $status  状态:0未开始,1进行中,2已结束
- * @property   \Carbon\Carbon  $created_at  创建时间
- * @property   \Carbon\Carbon  $updated_at  更新时间
+ * @property   \Carbon\Carbon  $created_at  
+ * @property   \Carbon\Carbon  $updated_at  
  * field end
  */
 class PetBattleSeason extends ModelCore
@@ -38,6 +38,7 @@ class PetBattleSeason extends ModelCore
 
     // attrlist start 
     protected $fillable = [
+        'id',
         'name',
         'start_time',
         'end_time',

+ 4 - 3
app/Module/Pet/Models/PetBattleTeam.php

@@ -10,14 +10,14 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
  * 宠物争霸赛队伍模型
  *
  * field start 
- * @property   int  $id  队伍ID,主键
+ * @property   int  $id  
  * @property   int  $season_id  赛季ID
  * @property   string  $name  队伍名称
  * @property   int  $leader_id  队长用户ID
  * @property   int  $total_power  队伍总战力
  * @property   int  $member_count  成员数量
- * @property   \Carbon\Carbon  $created_at  创建时间
- * @property   \Carbon\Carbon  $updated_at  更新时间
+ * @property   \Carbon\Carbon  $created_at  
+ * @property   \Carbon\Carbon  $updated_at  
  * field end
  */
 class PetBattleTeam extends ModelCore
@@ -31,6 +31,7 @@ class PetBattleTeam extends ModelCore
 
     // attrlist start 
     protected $fillable = [
+        'id',
         'season_id',
         'name',
         'leader_id',

+ 4 - 2
app/Module/Pet/Models/PetBattleTeamMember.php

@@ -9,12 +9,12 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
  * 宠物争霸赛队伍成员模型
  *
  * field start 
- * @property   int  $id  成员ID,主键
+ * @property   int  $id  
  * @property   int  $team_id  队伍ID
  * @property   int  $user_id  用户ID
  * @property   int  $pet_id  宠物ID
  * @property   int  $power  战力贡献
- * @property   \Carbon\Carbon  $join_time  加入时间
+ * @property   string  $join_time  
  * field end
  */
 class PetBattleTeamMember extends ModelCore
@@ -28,10 +28,12 @@ class PetBattleTeamMember extends ModelCore
 
     // attrlist start 
     protected $fillable = [
+        'id',
         'team_id',
         'user_id',
         'pet_id',
         'power',
+        'join_time',
     ];
     // attrlist end
 

+ 4 - 3
app/Module/Pet/Models/PetConfig.php

@@ -10,7 +10,7 @@ use App\Module\Pet\Casts\NumericAttributesCast;
  * 宠物配置模型
  *
  * field start 
- * @property   int  $id  配置ID,主键
+ * @property   int  $id  
  * @property   string  $pet_type  宠物类型
  * @property   object|array  $grade_probability  品阶概率配置
  * @property   object|array  $feed_effect  喂养效果配置
@@ -18,8 +18,8 @@ use App\Module\Pet\Casts\NumericAttributesCast;
  * @property   int  $stamina_recovery  体力恢复值/分钟
  * @property   object|array  $display_attributes  显示属性配置
  * @property   object|array  $numeric_attributes  数值属性配置
- * @property   \Carbon\Carbon  $created_at  创建时间
- * @property   \Carbon\Carbon  $updated_at  更新时间
+ * @property   \Carbon\Carbon  $created_at  
+ * @property   \Carbon\Carbon  $updated_at  
  * field end
  */
 class PetConfig extends ModelCore
@@ -33,6 +33,7 @@ class PetConfig extends ModelCore
 
     // attrlist start 
     protected $fillable = [
+        'id',
         'pet_type',
         'grade_probability',
         'feed_effect',

+ 4 - 3
app/Module/Pet/Models/PetLevelConfig.php

@@ -10,7 +10,7 @@ use App\Module\Pet\Casts\NumericAttributesCast;
  * 宠物等级配置模型
  *
  * field start 
- * @property   int  $id  配置ID,主键
+ * @property   int  $id  
  * @property   int  $level  等级
  * @property   int  $exp_required  升级所需经验值
  * @property   int  $stamina_max  最大体力值
@@ -18,8 +18,8 @@ use App\Module\Pet\Casts\NumericAttributesCast;
  * @property   object|array  $unlock_skills  解锁的技能ID列表
  * @property   object|array  $display_attributes  等级显示属性配置
  * @property   object|array  $numeric_attributes  等级数值属性配置
- * @property   \Carbon\Carbon  $created_at  创建时间
- * @property   \Carbon\Carbon  $updated_at  更新时间
+ * @property   \Carbon\Carbon  $created_at  
+ * @property   \Carbon\Carbon  $updated_at  
  * field end
  */
 class PetLevelConfig extends ModelCore
@@ -33,6 +33,7 @@ class PetLevelConfig extends ModelCore
 
     // attrlist start 
     protected $fillable = [
+        'id',
         'level',
         'exp_required',
         'stamina_max',

+ 7 - 6
app/Module/Pet/Models/PetRemouldLog.php

@@ -10,12 +10,12 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
  * 宠物洗髓记录模型
  *
  * field start 
- * @property   int  $id  记录ID,主键
- * @property   int  $pet_id  宠物ID
- * @property   string  $old_grade  原品阶
- * @property   string  $new_grade  新品阶
- * @property   \Carbon\Carbon  $remould_time  洗髓时间
- * @property   \Carbon\Carbon  $created_at  创建时间
+ * @property   int  $id  
+ * @property   int  $pet_id  
+ * @property   string  $old_grade  
+ * @property   string  $new_grade  
+ * @property   string  $remould_time  
+ * @property   \Carbon\Carbon  $created_at  
  * field end
  */
 class PetRemouldLog extends ModelCore
@@ -29,6 +29,7 @@ class PetRemouldLog extends ModelCore
 
     // attrlist start 
     protected $fillable = [
+        'id',
         'pet_id',
         'old_grade',
         'new_grade',

+ 6 - 5
app/Module/Pet/Models/PetSkill.php

@@ -9,15 +9,15 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
 /**
  * 宠物技能模型
  *
- * field start
- * @property   int  $id  技能ID,主键
+ * field start 
+ * @property   int  $id  
  * @property   string  $skill_name  技能名称
  * @property   int  $stamina_cost  体力消耗
  * @property   int  $cool_down  冷却时间(秒)
  * @property   string  $effect_desc  效果描述
  * @property   int  $min_level  最低等级要求
- * @property   \Carbon\Carbon  $created_at  创建时间
- * @property   \Carbon\Carbon  $updated_at  更新时间
+ * @property   \Carbon\Carbon  $created_at  
+ * @property   \Carbon\Carbon  $updated_at  
  * field end
  */
 class PetSkill extends ModelCore
@@ -34,8 +34,9 @@ class PetSkill extends ModelCore
      *
      * @var array
      */
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
+        'id',
         'skill_name',
         'stamina_cost',
         'cool_down',

+ 6 - 5
app/Module/Pet/Models/PetSkillLog.php

@@ -9,12 +9,12 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
  * 宠物技能使用日志模型
  *
  * field start 
- * @property   int  $id  日志ID,主键
- * @property   int  $pet_id  宠物ID
- * @property   int  $skill_id  技能ID
- * @property   \Carbon\Carbon  $used_at  使用时间
+ * @property   int  $id  
+ * @property   int  $pet_id  
+ * @property   int  $skill_id  
+ * @property   string  $used_at  
  * @property   object|array  $effect_result  技能使用结果
- * @property   \Carbon\Carbon  $created_at  创建时间
+ * @property   \Carbon\Carbon  $created_at  
  * field end
  */
 class PetSkillLog extends ModelCore
@@ -28,6 +28,7 @@ class PetSkillLog extends ModelCore
 
     // attrlist start 
     protected $fillable = [
+        'id',
         'pet_id',
         'skill_id',
         'used_at',

+ 3 - 0
app/Module/Pet/README.md

@@ -59,6 +59,7 @@ enum PetStatus: int {
 #### 2.2.1 基础表
 
 ```sql
+
 -- 用户宠物表
 CREATE TABLE `pet_users` (
   `id` BIGINT UNSIGNED AUTO_INCREMENT,
@@ -124,6 +125,7 @@ CREATE TABLE `pet_level_configs` (
 #### 2.2.2 日志表
 
 ```sql
+
 -- 技能使用日志表
 CREATE TABLE `pet_skill_logs` (
   `id` BIGINT UNSIGNED AUTO_INCREMENT,
@@ -171,6 +173,7 @@ CREATE TABLE `pet_battle_logs` (
 #### 2.2.3 争霸赛相关表
 
 ```sql
+
 -- 争霸赛赛季表
 CREATE TABLE `pet_battle_seasons` (
   `id` INT UNSIGNED AUTO_INCREMENT,