Commit 13fd39cb authored by 梁俊杰's avatar 梁俊杰

获取站点支持关联团队

导出功能优化
parent 743a7ee4
......@@ -130,11 +130,12 @@ interface BaseInfoServiceInterface
/**
* 获取所有站点的数据
* @param array $relations 支持的关联关系 ['team', 'country'] 分别代表 团队、国家
* @param array $columns 要显示的字段
* $columns = ['id', "name", "url", "country_id", "team_id"];
* @return array 默认已keyBy('id')
*/
public function sites(array $columns = ['id', "name"]): array;
public function sites(array $relations = [], array $columns = ['id', "name"]): array;
}
......@@ -64,9 +64,10 @@ class Exporter
public function __construct(int $export_type, $tempFilePath = "", $name = "export_data", $sheetIndex = 0)
{
$this->config = container(ConfigInterface::class);
$this->rootPath = $this->config->get('server.settings.document_root', BASE_PATH . '/public/');
$this->rootPath = $this->config->get('server.settings.document_root', BASE_PATH . '/public');
if ($tempFilePath) {
$tempFilePath = $this->rootPath . $tempFilePath;
$tempFilePath = $this->rootPath . "/" . $tempFilePath;
//print_r($tempFilePath);
if (file_exists($tempFilePath)) {
$this->fileType = ucfirst(strtolower(pathinfo($tempFilePath, PATHINFO_EXTENSION)));
$reader = IOFactory::createReader($this->fileType)->load($tempFilePath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment