Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
yunxin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
51a370f9
authored
May 17, 2019
by
PRY5YKGJ82EZEPX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
更新联营物料
parent
3e446127
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
3 deletions
app/Http/function.php
app/Jobs/JopExportGoodsComList.php
app/Model/UploadLogModel.php
public/pc/js/controller/UploadLogList.js
app/Http/function.php
View file @
51a370f9
...
...
@@ -1194,3 +1194,18 @@ function unicodeDecode($unicode_str){
if
(
empty
(
$arr
))
return
''
;
return
$arr
[
'str'
];
}
//计时函数
function
G
(
$start
,
$end
=
''
,
$dec
=
4
)
{
static
$_info
=
array
();
if
(
!
empty
(
$end
))
{
if
(
!
isset
(
$_info
[
$end
]))
$_info
[
$end
]
=
microtime
(
TRUE
);
$sconds
=
number_format
((
$_info
[
$end
]
-
$_info
[
$start
]),
$dec
)
*
1000
;
return
"
{
$sconds
}
ms"
;
}
else
{
$_info
[
$start
]
=
microtime
(
TRUE
);
}
}
\ No newline at end of file
app/Jobs/JopExportGoodsComList.php
View file @
51a370f9
...
...
@@ -21,7 +21,7 @@ class JopExportGoodsComList extends Job implements ShouldQueue
{
use
InteractsWithQueue
,
SerializesModels
;
private
$id
;
const
limit
=
100
;
//分页条数
const
limit
=
100
0
;
//分页条数
public
function
__construct
(
$id
)
{
$this
->
id
=
$id
;
...
...
@@ -33,6 +33,7 @@ class JopExportGoodsComList extends Job implements ShouldQueue
public
function
handle
()
{
set_time_limit
(
0
);
G
(
'a'
);
$UploadLogModel
=
new
UploadLogModel
();
$LogInfo
=
$UploadLogModel
->
LogInfo
(
$this
->
id
);
...
...
@@ -78,6 +79,7 @@ class JopExportGoodsComList extends Job implements ShouldQueue
'goods_id'
=>
$searchArr
[
'data'
][
'goods_id'
]
];
$res
=
$ServerMicModel
->
synchronization
(
$micData
,
2
);
if
(
$res
[
'code'
]
>
0
){
$UploadLogModel
->
UpdateLogArr
(
$this
->
id
,
'1002:没有数据'
,
3
,
$log
);
return
true
;
...
...
@@ -107,7 +109,9 @@ class JopExportGoodsComList extends Job implements ShouldQueue
sleep
(
1
);
$s
[
'scroll_id'
]
=
$searchArr
[
'data'
][
'scroll_id'
];
$s
[
'limit'
]
=
self
::
limit
;
G
(
"d"
);
$searchArr
=
$ServerEsModel
->
searchSku
(
$s
);
echo
"查询es耗时:"
.
G
(
'd'
,
'e'
)
.
"<br/>"
;
if
(
$searchArr
[
'error_code'
]
>
0
){
$UploadLogModel
->
UpdateLogArr
(
$this
->
id
,
'1003:没有数据'
,
3
,
$log
);
...
...
@@ -117,7 +121,10 @@ class JopExportGoodsComList extends Job implements ShouldQueue
$micData
=
[
'goods_id'
=>
$searchArr
[
'data'
][
'goods_id'
]
];
G
(
"f"
);
//print_r($micData);
$res
=
$ServerMicModel
->
synchronization
(
$micData
,
2
);
echo
"查询基石耗时:"
.
G
(
'f'
,
'h'
)
.
"<br/>"
;
if
(
$res
[
'code'
]
>
0
){
$UploadLogModel
->
UpdateLogArr
(
$this
->
id
,
'1004:没有数据'
,
3
,
$log
);
return
true
;
...
...
@@ -149,6 +156,7 @@ class JopExportGoodsComList extends Job implements ShouldQueue
$Url
=
$UploadFileModel
->
SaveDownFile
(
$filename
);
fclose
(
$x
);
unlink
(
$filePath
);
echo
"总耗时:"
.
G
(
'a'
,
'c'
);
if
(
!
$Url
){
$UploadLogModel
->
UpdateLogArr
(
$this
->
id
,
'导出失败'
,
3
,
$log
);
return
true
;
...
...
app/Model/UploadLogModel.php
View file @
51a370f9
...
...
@@ -40,9 +40,10 @@ class UploadLogModel extends Model
foreach
(
$data
as
$key
=>
&
$v
)
{
$v
[
'create_time'
]
=
timeToDate
(
$v
[
'create_time'
]);
$v
[
'type_name'
]
=
@
UploadLogMap
::
$type
[
$v
[
'type'
]];
if
(
$v
[
'type'
]
==
UploadLogMap
::
type_import_sku
){
//如果是导入sku,查询状态
if
(
$v
[
'type'
]
==
UploadLogMap
::
type_import_sku
&&
array_key_exists
(
$v
[
'extend'
],
$foostoneLogStatus
)
){
//如果是导入sku,查询状态
$v
[
'status'
]
=
@
UploadLogMap
::
$status
[
$foostoneLogStatus
[
$v
[
'extend'
]][
'status'
]];
$v
[
'log'
]
=
implode
(
','
,
@
$foostoneLogStatus
[
$v
[
'extend'
]][
'log'
]);
$v
[
'file_path'
]
=@
$foostoneLogStatus
[
$v
[
'extend'
]][
'file_name'
][
'down'
];
}
else
{
$v
[
'status'
]
=
@
UploadLogMap
::
$status
[
$v
[
'status'
]];
}
...
...
public/pc/js/controller/UploadLogList.js
View file @
51a370f9
...
...
@@ -30,7 +30,7 @@
,{
field
:
'create_time'
,
title
:
'上传时间'
,
align
:
'center'
}
,{
field
:
''
,
title
:
'操作'
,
fixed
:
'right'
,
align
:
'center'
,
templet
:
function
(
d
){
if
(
d
.
file_path
!=
""
){
return
'<
button style="cursor:pointer;font-size: 14px; color:blue" href="'
+
d
.
file_path
+
'">下载文件</button
>'
return
'<
a style="cursor:pointer;font-size: 14px; color:blue" href="'
+
d
.
file_path
+
'">下载上传结果</a
>'
}
else
{
return
""
}
...
...
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