notfff 8 ay önce
ebeveyn
işleme
8621285f4d

+ 26 - 14
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,23 @@ class ItemChestOpenLog extends ModelCore
      */
     protected $table = 'item_chest_open_logs';
 
-    // attrlist start 
+    /**
+     * 指示模型是否应该被打上时间戳
+     * 由于这是日志表,只需要创建时间,不需要更新时间
+     *
+     * @var bool
+     */
+    public $timestamps = true;
+
+    /**
+     * 更新时间戳字段名
+     * 设置为null表示不使用updated_at字段
+     *
+     * @var string|null
+     */
+    const UPDATED_AT = null;
+
+    // attrlist start
     protected $fillable = [
         'id',
         'user_id',
@@ -43,18 +59,9 @@ class ItemChestOpenLog extends ModelCore
         'pity_content_id',
         'ip_address',
         'device_info',
-    ];
-    // attrlist end
-
-    /**
-     * 应该被转换为日期的属性
-     *
-     * @var array
-     */
-    protected $dates = [
-        'open_time',
         'created_at',
     ];
+    // attrlist end
 
     /**
      * 应该被转换为原生类型的属性
@@ -62,9 +69,14 @@ class ItemChestOpenLog extends ModelCore
      * @var array
      */
     protected $casts = [
-        'results' => \App\Module\GameItems\Casts\ChestOpenResultsCast::class,
-        'quantity' => 'integer',
+        'user_id' => 'integer',
+        'chest_id' => 'integer',
+        'open_quantity' => 'integer',
+        'result_items' => 'json',
         'pity_triggered' => 'boolean',
+        'pity_content_id' => 'integer',
+        'open_time' => 'datetime',
+        'created_at' => 'datetime',
     ];
 
     /**

+ 22 - 21
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,23 @@ class ItemCraftLog extends ModelCore
      */
     protected $table = 'item_craft_logs';
 
-    // attrlist start 
+    /**
+     * 指示模型是否应该被打上时间戳
+     * 由于这是日志表,只需要创建时间,不需要更新时间
+     *
+     * @var bool
+     */
+    public $timestamps = true;
+
+    /**
+     * 更新时间戳字段名
+     * 设置为null表示不使用updated_at字段
+     *
+     * @var string|null
+     */
+    const UPDATED_AT = null;
+
+    // attrlist start
     protected $fillable = [
         'id',
         'user_id',
@@ -46,26 +62,9 @@ class ItemCraftLog extends ModelCore
         'craft_time',
         'ip_address',
         'device_info',
-    ];
-    // attrlist end
-
-    /**
-     * 可批量赋值的属性
-     *
-     * @var array
-     */
-
-
-
-    /**
-     * 应该被转换为日期的属性
-     *
-     * @var array
-     */
-    protected $dates = [
-        'craft_time',
         'created_at',
     ];
+    // attrlist end
 
     /**
      * 应该被转换为原生类型的属性
@@ -74,8 +73,10 @@ class ItemCraftLog extends ModelCore
      */
     protected $casts = [
         'is_success' => 'boolean',
-        'materials_used' => TransactionDetailsCast::class,
+        'materials' => TransactionDetailsCast::class,
         'result_quantity' => 'integer',
+        'craft_time' => 'datetime',
+        'created_at' => 'datetime',
     ];
 
     /**

+ 25 - 16
app/Module/Pet/Models/PetBattleLog.php

@@ -8,15 +8,15 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
 /**
  * 宠物战斗记录模型
  *
- * field start 
- * @property  int  $id  
- * @property  int  $pet_id  
+ * field start
+ * @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  array  $reward  战斗奖励
- * @property  string  $battle_time  
- * @property  \Carbon\Carbon  $created_at  
+ * @property  string  $battle_time
+ * @property  \Carbon\Carbon  $created_at
  * field end
  */
 class PetBattleLog extends ModelCore
@@ -41,7 +41,23 @@ class PetBattleLog extends ModelCore
      */
     protected $table = 'pet_battle_logs';
 
-    // attrlist start 
+    /**
+     * 指示模型是否应该被打上时间戳
+     * 由于这是日志表,只需要创建时间,不需要更新时间
+     *
+     * @var bool
+     */
+    public $timestamps = true;
+
+    /**
+     * 更新时间戳字段名
+     * 设置为null表示不使用updated_at字段
+     *
+     * @var string|null
+     */
+    const UPDATED_AT = null;
+
+    // attrlist start
     protected $fillable = [
         'id',
         'pet_id',
@@ -50,18 +66,9 @@ class PetBattleLog extends ModelCore
         'result',
         'reward',
         'battle_time',
-    ];
-    // attrlist end
-
-    /**
-     * 应该被转换为日期的属性
-     *
-     * @var array
-     */
-    protected $dates = [
-        'battle_time',
         'created_at',
     ];
+    // attrlist end
 
     /**
      * 应该被转换为原生类型的属性
@@ -74,6 +81,8 @@ class PetBattleLog extends ModelCore
         'opponent_id' => 'integer',
         'result' => 'integer',
         'reward' => 'json',
+        'battle_time' => 'datetime',
+        'created_at' => 'datetime',
     ];
 
     /**

+ 27 - 18
app/Module/Pet/Models/PetRemouldLog.php

@@ -8,13 +8,13 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
 /**
  * 宠物洗髓记录模型
  *
- * field start 
- * @property  int  $id  
- * @property  int  $pet_id  
- * @property  int  $old_grade  
- * @property  int  $new_grade  
- * @property  string  $remould_time  
- * @property  \Carbon\Carbon  $created_at  
+ * field start
+ * @property  int  $id
+ * @property  int  $pet_id
+ * @property  int  $old_grade
+ * @property  int  $new_grade
+ * @property  string  $remould_time
+ * @property  \Carbon\Carbon  $created_at
  * field end
  */
 class PetRemouldLog extends ModelCore
@@ -26,25 +26,32 @@ class PetRemouldLog extends ModelCore
      */
     protected $table = 'pet_remould_logs';
 
-    // attrlist start 
+    /**
+     * 指示模型是否应该被打上时间戳
+     * 由于这是日志表,只需要创建时间,不需要更新时间
+     *
+     * @var bool
+     */
+    public $timestamps = true;
+
+    /**
+     * 更新时间戳字段名
+     * 设置为null表示不使用updated_at字段
+     *
+     * @var string|null
+     */
+    const UPDATED_AT = null;
+
+    // attrlist start
     protected $fillable = [
         'id',
         'pet_id',
         'old_grade',
         'new_grade',
         'remould_time',
-    ];
-    // attrlist end
-
-    /**
-     * 应该被转换为日期的属性
-     *
-     * @var array
-     */
-    protected $dates = [
-        'remould_time',
         'created_at',
     ];
+    // attrlist end
 
     /**
      * 应该被转换为原生类型的属性
@@ -55,6 +62,8 @@ class PetRemouldLog extends ModelCore
         'pet_id' => 'integer',
         'old_grade' => 'integer',
         'new_grade' => 'integer',
+        'remould_time' => 'datetime',
+        'created_at' => 'datetime',
     ];
 
     /**

+ 17 - 0
app/Module/Pet/Models/PetSkillLog.php

@@ -26,6 +26,22 @@ class PetSkillLog extends ModelCore
      */
     protected $table = 'pet_skill_logs';
 
+    /**
+     * 指示模型是否应该被打上时间戳
+     * 由于这是日志表,只需要创建时间,不需要更新时间
+     *
+     * @var bool
+     */
+    public $timestamps = true;
+
+    /**
+     * 更新时间戳字段名
+     * 设置为null表示不使用updated_at字段
+     *
+     * @var string|null
+     */
+    const UPDATED_AT = null;
+
     // attrlist start
     protected $fillable = [
         'id',
@@ -33,6 +49,7 @@ class PetSkillLog extends ModelCore
         'skill_id',
         'used_at',
         'effect_result',
+        'created_at',
     ];
     // attrlist end