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