public function __construct($data = []) { parent::__construct($data); // 设置默认外键名 仅支持单一外键 if (empty($this->fk)) { $this->fk = strtolower($this->name) . '_id'; } }