Commit 8ed5abc6 authored by zhaopeng343's avatar zhaopeng343

Merge branch 'rpc/baseInfo' into purchase_rpc

parents e1347041 e90fadba
...@@ -52,7 +52,7 @@ class UploadManager ...@@ -52,7 +52,7 @@ class UploadManager
{ {
$excelOptions = [ $excelOptions = [
'path' => 'excel', 'path' => 'excel',
'mime' => ['xlsx', 'xls'] 'mime' => ['xlsx', 'xls', 'csv']
]; ];
$options = array_merge($excelOptions, $options); $options = array_merge($excelOptions, $options);
return self::uploadFile($excel, $options); return self::uploadFile($excel, $options);
...@@ -69,7 +69,7 @@ class UploadManager ...@@ -69,7 +69,7 @@ class UploadManager
{ {
$excelOptions = [ $excelOptions = [
'path' => 'excel', 'path' => 'excel',
'mime' => ['xlsx', 'xls'] 'mime' => ['xlsx', 'xls', 'csv']
]; ];
$options = array_merge($excelOptions, $options); $options = array_merge($excelOptions, $options);
return self::uploadFile($excel, $options, true); return self::uploadFile($excel, $options, true);
...@@ -150,9 +150,9 @@ class UploadManager ...@@ -150,9 +150,9 @@ class UploadManager
$file->moveTo($savePath); $file->moveTo($savePath);
if ($file->isMoved()) { if ($file->isMoved()) {
if ($realPath) { if ($realPath) {
return $savePath.'?'.$name; return $savePath . '?' . $name;
} else { } else {
return str_replace($documentRoot, '', $savePath.'?'.$name); return str_replace($documentRoot, '', $savePath . '?' . $name);
} }
} else { } else {
throw new HttpResponseException('文件保存失败'); throw new HttpResponseException('文件保存失败');
......
...@@ -36,6 +36,14 @@ interface BaseInfoServiceInterface ...@@ -36,6 +36,14 @@ interface BaseInfoServiceInterface
*/ */
public function getCountryListByIdList(array $idList, array $columns = ['*']): array; public function getCountryListByIdList(array $idList, array $columns = ['*']): array;
/**
* 通过id数组获取国家区域数组
* @param array $ids 默认去重
* @param array $relations ['country'] 可关联国家数据
* @return array 默认keyBY('id')
*/
public function getCountryAreaListByIdList(array $ids, array $relations = []): array;
/** /**
* 通过id数组获取团队数组 * 通过id数组获取团队数组
* @param array $idList 默认去重 * @param array $idList 默认去重
......
<?php
/**
* Created by PhpStorm.
* User: Zero
* Time: 2021/1/14 9:16
*/
namespace Meibuyu\Micro\Shopify\tools;
class GraphQL
{
public static function parseDeliveryProfileId($gid)
{
if ($gid && stripos($gid, 'gid://shopify/DeliveryProfile/') !== false) {
$gid = str_replace('gid://shopify/DeliveryProfile/', '', $gid);
}
return (int)$gid;
}
}
...@@ -216,7 +216,7 @@ class Exporter ...@@ -216,7 +216,7 @@ class Exporter
* @return Exporter * @return Exporter
* @throws PhpSpreadsheetException * @throws PhpSpreadsheetException
*/ */
public function append(array $data, $keys = []) public function append(array $data, $keys = [], $noStyle = false)
{ {
// 一维数组转二维 // 一维数组转二维
foreach ($data as $v) { foreach ($data as $v) {
...@@ -233,8 +233,10 @@ class Exporter ...@@ -233,8 +233,10 @@ class Exporter
} }
$this->sheet->fromArray($data, null, $this->beginColumnChar . $this->beginRowIndex); $this->sheet->fromArray($data, null, $this->beginColumnChar . $this->beginRowIndex);
//美化样式 if (!$noStyle) {
$this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1)); // 美化样式
$this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1));
}
$this->beginRowIndex += count($data); $this->beginRowIndex += count($data);
return $this; return $this;
} }
...@@ -386,7 +388,7 @@ class Exporter ...@@ -386,7 +388,7 @@ class Exporter
$date = date('YmdHis'); $date = date('YmdHis');
$fileReadPath = $filePath . $filename . '-' . $date . "." . strtolower($this->fileType); $fileReadPath = $filePath . $filename . '-' . $date . "." . strtolower($this->fileType);
$objWriter->save($fileReadPath); $objWriter->save($fileReadPath);
return config('server.settings.document_root') . "/export/" . $filename . '-' .$date . "." . return config('server.settings.document_root') . "/export/" . $filename . '-' . $date . "." .
strtolower($this->fileType); strtolower($this->fileType);
break; break;
default: default:
......
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