Files
xiadc 751c742726 feat(俱乐部和比赛模块): 增加俱乐部和比赛的相关功能和优化
- 在 Club 控制器中添加了对俱乐部列表的查询,包括俱乐部名称、场馆名称、俱乐部标签等信息
- 在 Game 控制器中增加了对比赛列表的查询,包括比赛名称、场馆名称、俱乐部名称、参赛选手头像等信息
- 优化了 Game 控制器中的比赛详情查询,增加了参赛选手头像的解析
- 在 Game、GameJoin 和 Participant 模型中添加了 tableName 静态属性,便于统一管理表名
2025-05-16 11:16:29 +08:00

64 lines
1.0 KiB
PHP

<?php
namespace app\admin\model\zy\game;
use think\Model;
class Game extends Model
{
// 表名
public static $tableName = 'zy_game';
protected $table = 'zy_game';
// 自动写入时间戳字段
protected $autoWriteTimestamp = false;
// 定义时间戳字段名
protected $createTime = false;
protected $updateTime = false;
protected $deleteTime = false;
// 追加属性
protected $append = [
];
public function activity()
{
return $this->belongsTo('Activity', 'act_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function stadium()
{
return $this->belongsTo('app\admin\model\zy\Stadium', 'gym_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function club()
{
return $this->belongsTo('app\admin\model\zy\Club', 'club_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\admin\model\User', 'referee', 'id', [], 'LEFT')->setEagerlyType(0);
}
}