Browse Source

修复Item模型关联关系;优化PetSkill模型注释格式

Your Name 8 months ago
parent
commit
dac019cca3

+ 7 - 7
app/Module/Activity/Models/ActivityCondition.php

@@ -10,15 +10,15 @@ use UCore\ModelCore;
  * 活动条件
  *
  * field start 
- * @property   int  $id  主键
+ * @property   int  $id  
  * @property   int  $activity_id  关联活动ID
- * @property   int  $condition_type  条件类型(1:等级要求, 2:道具要求, 3:时间要求等)
- * @property   object|array  $condition_params  条件参数,JSON格式
- * @property   int  $is_participation_condition  是否为参与条件(0:否, 1:是)
- * @property   int  $is_completion_condition  是否为完成条件(0:否, 1:是)
+ * @property   int  $condition_type  条件类型
+ * @property   object|array  $condition_params  条件参数
+ * @property   int  $is_participation_condition  是否为参与条件
+ * @property   int  $is_completion_condition  是否为完成条件
  * @property   int  $display_order  显示顺序
- * @property   \Carbon\Carbon  $created_at  创建时间
- * @property   \Carbon\Carbon  $updated_at  更新时间
+ * @property   \Carbon\Carbon  $created_at  
+ * @property   \Carbon\Carbon  $updated_at  
  * field end
  */
 class ActivityCondition extends ModelCore

+ 11 - 11
app/Module/Activity/Models/ActivityConfig.php

@@ -10,22 +10,22 @@ use UCore\ModelCore;
 /**
  * 活动基础配置
  *
- * field start
- * @property   int  $id  主键
+ * field start 
+ * @property   int  $id  
  * @property   string  $name  活动名称
- * @property   int  $type  活动类型(1:礼包活动, 2:限时活动, 3:任务活动, 4:签到活动, 5:节日活动)
+ * @property   int  $type  活动类型
  * @property   string  $description  活动描述
- * @property   \Carbon\Carbon  $start_time  开始时间
- * @property   \Carbon\Carbon  $end_time  结束时间
- * @property   int  $status  活动状态(0:未开始, 1:进行中, 2:已结束, 3:已关闭)
- * @property   int  $display_order  显示顺序,数值越大越靠前
+ * @property   string  $start_time  开始时间
+ * @property   string  $end_time  结束时间
+ * @property   int  $status  活动状态
+ * @property   int  $display_order  显示顺序
  * @property   string  $icon  活动图标URL
  * @property   string  $banner  活动横幅URL
  * @property   int  $reward_group_id  奖励组ID(关联game_reward_groups表)
  * @property   string  $reward_group_code  奖励组编码(关联game_reward_groups表的code字段)
- * @property   object|array  $config_params  活动特定配置参数,JSON格式
- * @property   \Carbon\Carbon  $created_at  创建时间
- * @property   \Carbon\Carbon  $updated_at  更新时间
+ * @property   object|array  $config_params  活动特定配置参数
+ * @property   \Carbon\Carbon  $created_at  
+ * @property   \Carbon\Carbon  $updated_at  
  * field end
  */
 class ActivityConfig extends ModelCore
@@ -42,7 +42,7 @@ class ActivityConfig extends ModelCore
      *
      * @var array
      */
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'name',

+ 9 - 9
app/Module/Activity/Models/ActivityParticipation.php

@@ -10,16 +10,16 @@ use UCore\ModelCore;
 /**
  * 活动参与记录
  *
- * field start
- * @property   int  $id  主键
+ * field start 
+ * @property   int  $id  
  * @property   int  $user_id  用户ID
  * @property   int  $activity_id  活动ID
- * @property   \Carbon\Carbon  $participate_time  参与时间
- * @property   int  $reward_status  奖励状态(0:未领取, 1:已领取, 2:已过期)
- * @property   int  $completion_status  完成状态(0:进行中, 1:已完成, 2:已失败)
- * @property   \Carbon\Carbon  $completion_time  完成时间
- * @property   \Carbon\Carbon  $created_at  创建时间
- * @property   \Carbon\Carbon  $updated_at  更新时间
+ * @property   string  $participate_time  参与时间
+ * @property   int  $reward_status  奖励状态
+ * @property   int  $completion_status  完成状态
+ * @property   string  $completion_time  完成时间
+ * @property   \Carbon\Carbon  $created_at  
+ * @property   \Carbon\Carbon  $updated_at  
  * field end
  */
 class ActivityParticipation extends ModelCore
@@ -36,7 +36,7 @@ class ActivityParticipation extends ModelCore
      *
      * @var array
      */
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'user_id',

+ 11 - 11
app/Module/Activity/Models/UserActivityData.php

@@ -6,17 +6,17 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
 use UCore\ModelCore;
 
 /**
- * 用户活动数据
+ * 活动用户数据
  *
  * field start 
- * @property   int  $id  主键
+ * @property   int  $id  
  * @property   int  $user_id  用户ID
  * @property   int  $activity_id  活动ID
- * @property   int  $progress  活动进度(如任务完成数等)
- * @property   object|array  $progress_data  详细进度数据,JSON格式
- * @property   \Carbon\Carbon  $last_update  最后更新时间
- * @property   \Carbon\Carbon  $created_at  创建时间
- * @property   \Carbon\Carbon  $updated_at  更新时间
+ * @property   int  $progress  活动进度
+ * @property   object|array  $progress_data  详细进度数据
+ * @property   string  $last_update  
+ * @property   \Carbon\Carbon  $created_at  
+ * @property   \Carbon\Carbon  $updated_at  
  * field end
  */
 class UserActivityData extends ModelCore
@@ -26,7 +26,7 @@ class UserActivityData extends ModelCore
      *
      * @var string
      */
-    protected $table = 'user_activity_data';
+    protected $table = 'activity_user__data';
 
     /**
      * 可批量赋值的属性
@@ -87,13 +87,13 @@ class UserActivityData extends ModelCore
     public function updateProgress(int $progress, ?array $progressData = null): bool
     {
         $this->progress = $progress;
-        
+
         if ($progressData !== null) {
             $this->progress_data = $progressData;
         }
-        
+
         $this->last_update = now();
-        
+
         return $this->save();
     }
 

+ 16 - 17
app/Module/Fund/Models/FundLogModel.php

@@ -13,22 +13,21 @@ use UCore\ModelCore;
 /**
  * App\Module\Fund\Models\FundLogModel
  * 资金日志表
- * field start
- *
- * @property   int $id
- * @property   int $user_id  用户ID
- * @property   int $fund_id  资金id
- * @property   int $amount  操作金额,正值为收入,负值为支出
- * @property   string $operate_id  上游操作id
- * @property   string $operate_type  上游操作类型
- * @property   string $remark  备注
- * @property   int $create_time  最后更新时间
- * @property   string $create_ip  最后更新ip
- * @property   int $later_balance  在此之后的余额
- * @property   int $before_balance  在此之前的月
- * @property   int $date_key  月份key
- * @property   string $hash  防篡改哈希值
- * @property   string $prev_hash  上一条记录的哈希值
+ * field start 
+ * @property   int  $id  
+ * @property   int  $user_id  用户ID
+ * @property   int  $fund_id  资金id
+ * @property   int  $amount  操作金额,正值为收入,负值为支出
+ * @property   string  $operate_id  上游操作id
+ * @property   string  $operate_type  上游操作类型
+ * @property   string  $remark  备注
+ * @property   int  $create_time  最后更新时间
+ * @property   string  $create_ip  最后更新ip
+ * @property   int  $later_balance  在此之后的余额
+ * @property   int  $before_balance  在此之前的月
+ * @property   int  $date_key  月份key
+ * @property   string  $hash  防篡改哈希值
+ * @property   string  $prev_hash  上一条记录的哈希值
  * field end
  */
 class FundLogModel extends ModelCore
@@ -36,7 +35,7 @@ class FundLogModel extends ModelCore
 
     protected $table = 'fund_logs';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'user_id',

+ 8 - 9
app/Module/Fund/Models/FundModel.php

@@ -11,14 +11,13 @@ use UCore\ModelCore;
 /**
  * 资金表
  *
- * field start
- *
- * @property   int $id  自增
- * @property   int $user_id  用户ID
- * @property   int $fund_id  资金ID
- * @property   int $balance  余额
- * @property   int $update_time  更新时间
- * @property   int $create_time  创建时间
+ * field start 
+ * @property   int  $id  自增
+ * @property   int  $user_id  用户ID
+ * @property   int  $fund_id  资金ID
+ * @property   int  $balance  余额
+ * @property   int  $update_time  更新时间
+ * @property   int  $create_time  创建时间
  * field end
  *
  */
@@ -28,7 +27,7 @@ class FundModel extends ModelCore
     protected $table      = 'fund';
     public    $timestamps = false;
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'user_id',

+ 1 - 1
app/Module/Game/Models/GameRewardGroup.php

@@ -14,7 +14,7 @@ use UCore\ModelCore;
  * @property   string  $code  奖励组编码(唯一)
  * @property   string  $description  奖励组描述
  * @property   int  $is_random  是否随机发放(0:全部发放, 1:随机发放)
- * @property   int  $random_count  随机发放时的奖励数量(仅当is_random=1时有效)
+ * @property   int  $random_count  随机发放时的奖励数量
  * @property   \Carbon\Carbon  $created_at  创建时间
  * @property   \Carbon\Carbon  $updated_at  更新时间
  * field end

+ 4 - 4
app/Module/GameItems/Models/Item.php

@@ -10,7 +10,7 @@ use UCore\ModelCore;
 /**
  * 物品基础信息
  *
- * field start
+ * field start 
  * @property   int  $id  物品ID,主键
  * @property   string  $name  物品名称
  * @property   string  $description  物品描述
@@ -39,7 +39,7 @@ class Item extends ModelCore
      */
     protected $table = 'item_items';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'name',
@@ -120,7 +120,7 @@ class Item extends ModelCore
      */
     public function chest_contents(): HasMany
     {
-        return $this->hasMany(ItemChestContent::class, 'chest_id','item_id');
+        return $this->hasMany(ItemChestContent::class, 'chest_id', 'id');
     }
 
     /**
@@ -130,7 +130,7 @@ class Item extends ModelCore
      */
     public function chest_costs(): HasMany
     {
-        return $this->hasMany(ItemChestOpenCost::class, 'chest_id','item_id');
+        return $this->hasMany(ItemChestOpenCost::class, 'chest_id', 'id');
     }
 
 }

+ 10 - 11
app/Module/GameItems/Models/ItemChestOpenCost.php

@@ -9,16 +9,15 @@ use UCore\ModelCore;
 /**
  * 宝箱开启消耗配置
  *
- * field start
- *
- * @property   int $id  记录ID,主键
- * @property   int $chest_id  宝箱ID,外键关联item_items表
- * @property   int $cost_type  消耗类型(1:物品, 2:货币, 3:其他资源)
- * @property   int $cost_id  消耗的物品/货币/资源ID
- * @property   int $cost_quantity  消耗数量
- * @property   int $is_active  是否激活(0:否, 1:是)
- * @property   \Carbon\Carbon $created_at  创建时间
- * @property   \Carbon\Carbon $updated_at  更新时间
+ * field start 
+ * @property   int  $id  记录ID,主键
+ * @property   int  $chest_id  宝箱ID,外键关联item_items表
+ * @property   int  $cost_type  消耗类型(1:物品, 2:货币, 3:其他资源)
+ * @property   int  $cost_id  消耗的物品/货币/资源ID
+ * @property   int  $cost_quantity  消耗数量
+ * @property   int  $is_active  是否激活(0:否, 1:是)
+ * @property   \Carbon\Carbon  $created_at  创建时间
+ * @property   \Carbon\Carbon  $updated_at  更新时间
  * field end
  */
 class ItemChestOpenCost extends ModelCore
@@ -31,7 +30,7 @@ class ItemChestOpenCost extends ModelCore
      */
     protected $table = 'item_chest_open_costs';
 
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'chest_id',

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

@@ -9,16 +9,16 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
 /**
  * 宠物技能模型
  *
- * field start
- * @property   int  $id
+ * field start 
+ * @property   int  $id  
  * @property   string  $skill_name  技能名称
- * @property   int  $stamina_cost  体力消耗(小时/单位时间)
+ * @property   int  $stamina_cost  体力消耗
  * @property   int  $cool_down  冷却时间(秒)
  * @property   int  $duration_time  持续时间(秒)
  * @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
@@ -35,7 +35,7 @@ class PetSkill extends ModelCore
      *
      * @var array
      */
-    // attrlist start
+    // attrlist start 
     protected $fillable = [
         'id',
         'skill_name',

+ 4 - 0
app/Module/Task/Models/Task.php

@@ -27,6 +27,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
  * @property   string  $end_time  结束时间(NULL表示永不结束)
  * @property   \Carbon\Carbon  $created_at  创建时间
  * @property   \Carbon\Carbon  $updated_at  更新时间
+ * @property   int  $reset_interval  重置间隔(秒),根据重置类型自动计算
+ * @property   string  $reset_time_field  重置时间字段,如"daily_reset_time",用于存储具体重置时间点
  * field end
  */
 class Task extends ModelCore
@@ -85,6 +87,8 @@ class Task extends ModelCore
         'is_active',
         'start_time',
         'end_time',
+        'reset_interval',
+        'reset_time_field',
     ];
     // attrlist end
 

+ 2 - 0
app/Module/Task/Models/TaskResetLog.php

@@ -10,6 +10,7 @@ use UCore\ModelCore;
  * field start 
  * @property   int  $id  主键
  * @property   string  $reset_type  重置类型(daily, weekly, monthly)
+ * @property   string  $trigger_type  触发类型(view, accept, update, reward, admin)
  * @property   string  $reset_time  重置时间
  * @property   object|array  $affected_tasks  受影响的任务ID列表(JSON格式)
  * @property   int  $affected_count  受影响的任务数量
@@ -62,6 +63,7 @@ class TaskResetLog extends ModelCore
     protected $fillable = [
         'id',
         'reset_type',
+        'trigger_type',
         'reset_time',
         'affected_tasks',
         'affected_count',

+ 6 - 0
app/Module/Task/Models/TaskUserTask.php

@@ -20,6 +20,9 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
  * @property   string  $expire_at  过期时间
  * @property   \Carbon\Carbon  $created_at  创建时间
  * @property   \Carbon\Carbon  $updated_at  更新时间
+ * @property   string  $next_reset_time  下次重置时间,用于快速判断是否需要重置
+ * @property   string  $last_reset_time  上次重置时间,用于计算下次重置时间
+ * @property   int  $reset_count  重置次数,用于统计和分析
  * field end
  */
 class TaskUserTask extends ModelCore
@@ -61,6 +64,9 @@ class TaskUserTask extends ModelCore
         'completed_at',
         'rewarded_at',
         'expire_at',
+        'next_reset_time',
+        'last_reset_time',
+        'reset_count',
     ];
     // attrlist end