| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- declare(strict_types=1);
- namespace App\Model;
- use Hyperf\DbConnection\Model\Model;
- /**
- */
- class Sector extends Model
- {
- /**
- * The table associated with the model.
- */
- protected ?string $table = 'sector';
- /**
- * The attributes that are mass assignable.
- */
- protected array $fillable = [];
- /**
- * The attributes that should be cast to native types.
- */
- protected array $casts = [];
- /**
- * 定义与 sectorComponents 的关联关系
- *
- * @return \Hyperf\Database\Model\Relations\HasMany|\Hyperf\Database\Model\Relations\BelongsTo|\Hyperf\Database\Model\Relations\HasOne
- * 注意:这里需要根据实际业务确定具体的关联类型,示例中暂未明确指定
- */
- public function sectorComponents()
- {
- // 请根据实际业务逻辑修改关联类型,如 hasMany、belongsTo、hasOne 等
- return $this->hasMany(SectorComponent::class, 'sectorid', 'id');
- }
- }
|