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
6cad6d9f
authored
May 17, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'zjl_self_order_20180502'
parents
3ece1b25
62a3c1c7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
20 deletions
app/Http/Controllers/OrderController.php
app/Http/Controllers/OrderController.php
View file @
6cad6d9f
...
...
@@ -1411,34 +1411,28 @@ Class OrderController extends Controller
public
function
ajaxSelfExpress
(
Request
$request
)
{
if
(
$request
->
isMethod
(
'post'
))
{
$order_id
=
$request
->
input
(
'order_id'
);
$shipping_type
=
$request
->
input
(
'type'
);
$data
[
'shipping_no'
]
=
$request
->
input
(
'express_no'
);
$data
[
'shipping_id'
]
=
$request
->
input
(
'shipping_id'
);
$data
[
'order_shipping_type'
]
=
1
;
$data
[
'update_time'
]
=
time
();
$shipping
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order_shipping'
)
->
where
([
'order_id'
=>
$order_id
,
'shipping_type'
=>
$shipping_type
])
->
first
();
//调用接口
$url
=
Config
(
'website.api_domain'
)
.
'order/send'
;
// 判断是否已存在快递信息
if
(
$shipping
)
{
$result
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order_shipping'
)
->
where
([
'order_id'
=>
$order_id
,
'shipping_type'
=>
$shipping_type
])
->
update
(
$data
);
}
else
{
$data
[
'order_id'
]
=
$order_id
;
$data
[
'shipping_type'
]
=
$shipping_type
;
$data
[
'status'
]
=
1
;
$data
[
'k1'
]
=
time
();
$data
[
'k2'
]
=
md5
(
md5
(
$data
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
$result
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order_shipping'
)
->
insert
(
$data
);
}
$resData
=
array
(
"k1"
=>
$data
[
'k1'
],
"k2"
=>
$data
[
'k2'
],
'order_id'
=>
$request
->
input
(
'order_id'
),
'shipping_type'
=>
$shipping_type
,
'shipping_no'
=>
$request
->
input
(
'express_no'
),
'shipping_id'
=>
$request
->
input
(
'shipping_id'
),
);
if
(
!
$result
)
return
[
'errcode'
=>-
1
,
'errmsg'
=>
'填写快递单失败'
]
;
$temp
=
json_decode
(
curlApi
(
$url
,
$resData
,
"POST"
),
true
)
;
if
(
$temp
[
'err_code'
]
==
0
)
{
// 填写快递单时锁定库存
if
(
$shipping_type
==
1
)
{
// 更新订单状态
DB
::
connection
(
'order'
)
->
table
(
'lie_order'
)
->
where
(
'order_id'
,
$order_id
)
->
update
([
'status'
=>
8
]);
// $info = $this->orderDetail($request, $order_id);
// $sku = array();
...
...
@@ -1455,6 +1449,9 @@ Class OrderController extends Controller
return
[
'errcode'
=>
0
,
'errmsg'
=>
'填写快递单成功'
];
}
return
[
'errcode'
=>-
1
,
'errmsg'
=>
'填写快递单失败'
];
}
}
/**
...
...
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