|
|
@@ -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',
|
|
|
];
|
|
|
|
|
|
/**
|