Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
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
45b1e240
authored
Aug 09, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整导入记录
parent
3949c428
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
app/Http/Controllers/SpecialController.php
app/Http/Controllers/SpecialController.php
View file @
45b1e240
...
@@ -142,26 +142,33 @@ class SpecialController extends Controller
...
@@ -142,26 +142,33 @@ class SpecialController extends Controller
$OrderModel
=
new
OrderModel
();
$OrderModel
=
new
OrderModel
();
// 记录到日志
$monolog
=
Log
::
getMonolog
();
$monolog
->
popHandler
();
Log
::
useDailyFiles
(
storage_path
(
'logs/updateOrder.log'
));
foreach
(
$excel
as
$k
=>
$v
)
{
foreach
(
$excel
as
$k
=>
$v
)
{
if
(
!
$v
[
0
]
||
!
$v
[
1
])
continue
;
if
(
!
$v
[
0
]
||
!
$v
[
1
])
continue
;
// 1. 根据手机或邮箱查找客户最近的订单
// 1. 根据手机或邮箱查找客户最近的订单
$order_id
=
$this
->
getLastOrderId
(
trim
(
$v
[
0
]));
$order_id
=
$this
->
getLastOrderId
(
trim
(
$v
[
0
]));
if
(
$order_id
===
false
)
continue
;
if
(
$order_id
===
false
)
{
Log
::
info
(
'客户账号:'
.
$v
[
0
]
.
',客服邮箱:'
.
$v
[
1
]
.
',客户无订单'
);
continue
;
}
// 2. 根据企业邮箱查找sale_id
// 2. 根据企业邮箱查找sale_id
$sale_id
=
$this
->
getSaleId
(
trim
(
strtolower
(
$v
[
1
])));
$sale_id
=
$this
->
getSaleId
(
trim
(
strtolower
(
$v
[
1
])));
if
(
$sale_id
===
false
)
continue
;
if
(
$sale_id
===
false
)
{
Log
::
info
(
'客户账号:'
.
$v
[
0
]
.
',客服邮箱:'
.
$v
[
1
]
.
',没有找到跟进人邮箱'
);
continue
;
}
// 3. 替换第一步的订单sale_id
// 3. 替换第一步的订单sale_id
$OrderModel
->
where
(
'order_id'
,
$order_id
)
->
update
([
'sale_id'
=>
$sale_id
]);
$OrderModel
->
where
(
'order_id'
,
$order_id
)
->
update
([
'sale_id'
=>
$sale_id
]);
// 记录到日志
$monolog
=
Log
::
getMonolog
();
$monolog
->
popHandler
();
Log
::
useDailyFiles
(
storage_path
(
'logs/updateOrder.log'
));
Log
::
info
(
'客户账号:'
.
$v
[
0
]
.
',客服邮箱:'
.
$v
[
1
]
.
',替换已离职人员的订单,订单ID:'
.
$order_id
.
',之前的SALE ID:'
.
$sale_id
);
Log
::
info
(
'客户账号:'
.
$v
[
0
]
.
',客服邮箱:'
.
$v
[
1
]
.
',替换已离职人员的订单,订单ID:'
.
$order_id
.
',之前的SALE ID:'
.
$sale_id
);
}
}
...
...
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