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
62a3c1c7
authored
May 17, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整填写快递单
parent
9c2e9243
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
31 deletions
app/Http/Controllers/OrderController.php
app/Http/Controllers/OrderController.php
View file @
62a3c1c7
...
@@ -1325,49 +1325,46 @@ Class OrderController extends Controller
...
@@ -1325,49 +1325,46 @@ Class OrderController extends Controller
public
function
ajaxSelfExpress
(
Request
$request
)
public
function
ajaxSelfExpress
(
Request
$request
)
{
{
if
(
$request
->
isMethod
(
'post'
))
{
if
(
$request
->
isMethod
(
'post'
))
{
$order_id
=
$request
->
input
(
'order_id'
);
$shipping_type
=
$request
->
input
(
'type'
);
$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'
;
// 判断是否已存在快递信息
$data
[
'k1'
]
=
time
();
if
(
$shipping
)
{
$data
[
'k2'
]
=
md5
(
md5
(
$data
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
$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
;
$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
)
{
// 填写快递单时锁定库存
// 更新订单状态
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();
// $info = $this->orderDetail($request, $order_id);
// foreach ($info['order_items_info'] as $v) {
// $sku = array();
// $sku[$v['rec_id']] = $v['goods_number'];
// }
// $res = json_decode($this->unlockSku($order_id, $sku, true));
// foreach ($info['order_items_info'] as $v) {
// if ($res['errcode'] != 0) return ['errcode'=>-1, 'errmsg'=>'锁定库存失败'];
// $sku[$v['rec_id']] = $v['goods_number'];
// }
// $res = json_decode($this->unlockSku($order_id, $sku, true));
// if ($res['errcode'] != 0) return ['errcode'=>-1, 'errmsg'=>'锁定库存失败'];
// return ['errcode'=>0, 'errmsg'=>'填写快递单成功并锁定库存'];
}
// return ['errcode'=>0, 'errmsg'=>'填写快递单成功并锁定库存
'];
return
[
'errcode'
=>
0
,
'errmsg'
=>
'填写快递单成功
'
];
}
}
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