Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-micro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-micro
Commits
8ed5abc6
Commit
8ed5abc6
authored
Jan 22, 2021
by
zhaopeng343
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rpc/baseInfo' into purchase_rpc
parents
e1347041
e90fadba
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
8 deletions
+39
-8
UploadManager.php
src/Manager/UploadManager.php
+4
-4
BaseInfoServiceInterface.php
src/Service/Interfaces/BaseInfoServiceInterface.php
+8
-0
GraphQL.php
src/Shopify/tools/GraphQL.php
+21
-0
Exporter.php
src/Tools/Exporter.php
+6
-4
No files found.
src/Manager/UploadManager.php
View file @
8ed5abc6
...
...
@@ -52,7 +52,7 @@ class UploadManager
{
$excelOptions
=
[
'path'
=>
'excel'
,
'mime'
=>
[
'xlsx'
,
'xls'
]
'mime'
=>
[
'xlsx'
,
'xls'
,
'csv'
]
];
$options
=
array_merge
(
$excelOptions
,
$options
);
return
self
::
uploadFile
(
$excel
,
$options
);
...
...
@@ -69,7 +69,7 @@ class UploadManager
{
$excelOptions
=
[
'path'
=>
'excel'
,
'mime'
=>
[
'xlsx'
,
'xls'
]
'mime'
=>
[
'xlsx'
,
'xls'
,
'csv'
]
];
$options
=
array_merge
(
$excelOptions
,
$options
);
return
self
::
uploadFile
(
$excel
,
$options
,
true
);
...
...
@@ -150,9 +150,9 @@ class UploadManager
$file
->
moveTo
(
$savePath
);
if
(
$file
->
isMoved
())
{
if
(
$realPath
)
{
return
$savePath
.
'?'
.
$name
;
return
$savePath
.
'?'
.
$name
;
}
else
{
return
str_replace
(
$documentRoot
,
''
,
$savePath
.
'?'
.
$name
);
return
str_replace
(
$documentRoot
,
''
,
$savePath
.
'?'
.
$name
);
}
}
else
{
throw
new
HttpResponseException
(
'文件保存失败'
);
...
...
src/Service/Interfaces/BaseInfoServiceInterface.php
View file @
8ed5abc6
...
...
@@ -36,6 +36,14 @@ interface BaseInfoServiceInterface
*/
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数组获取团队数组
* @param array $idList 默认去重
...
...
src/Shopify/tools/GraphQL.php
0 → 100644
View file @
8ed5abc6
<?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
;
}
}
src/Tools/Exporter.php
View file @
8ed5abc6
...
...
@@ -216,7 +216,7 @@ class Exporter
* @return Exporter
* @throws PhpSpreadsheetException
*/
public
function
append
(
array
$data
,
$keys
=
[])
public
function
append
(
array
$data
,
$keys
=
[]
,
$noStyle
=
false
)
{
// 一维数组转二维
foreach
(
$data
as
$v
)
{
...
...
@@ -233,8 +233,10 @@ class Exporter
}
$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
->
beginRowIndex
+=
count
(
$data
);
return
$this
;
}
...
...
@@ -386,7 +388,7 @@ class Exporter
$date
=
date
(
'YmdHis'
);
$fileReadPath
=
$filePath
.
$filename
.
'-'
.
$date
.
"."
.
strtolower
(
$this
->
fileType
);
$objWriter
->
save
(
$fileReadPath
);
return
config
(
'server.settings.document_root'
)
.
"/export/"
.
$filename
.
'-'
.
$date
.
"."
.
return
config
(
'server.settings.document_root'
)
.
"/export/"
.
$filename
.
'-'
.
$date
.
"."
.
strtolower
(
$this
->
fileType
);
break
;
default
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment