| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace App\Module\Game\Models;
- use Illuminate\Database\Eloquent\Relations\HasMany;
- use UCore\ModelCore;
- /**
- * 消耗组
- *
- * field start
- * @property int $id 主键
- * @property string $name 消耗组名称
- * @property string $code 消耗组编码(唯一)
- * @property string $description 消耗组描述
- * @property \Carbon\Carbon $created_at 创建时间
- * @property \Carbon\Carbon $updated_at 更新时间
- * field end
- *
- * @property-read GameConsumeItem[] $consumeItems 消耗组中的所有消耗项
- */
- class GameConsumeGroup extends ModelCore
- {
- /**
- * 与模型关联的表名
- *
- * @var string
- */
- protected $table = 'game_consume_groups';
- // attrlist start
- protected $fillable = [
- 'id',
- 'name',
- 'code',
- 'description',
- ];
- // attrlist end
- /**
- * 获取消耗组中的所有消耗项
- *
- * @return HasMany
- */
- public function consumeItems(): HasMany
- {
- return $this->hasMany(GameConsumeItem::class, 'group_id', 'id');
- }
- }
|