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
6dff1ad5
authored
May 30, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整取消订单和填写快递单
parent
56f15e7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
47 deletions
app/Http/Controllers/OrderController.php
app/Http/Controllers/OrderController.php
View file @
6dff1ad5
...
@@ -1466,37 +1466,19 @@ Class OrderController extends Controller
...
@@ -1466,37 +1466,19 @@ Class OrderController extends Controller
{
{
if
(
$request
->
isMethod
(
'post'
))
{
if
(
$request
->
isMethod
(
'post'
))
{
$order_id
=
$request
->
input
(
'order_id'
);
$order_id
=
$request
->
input
(
'order_id'
);
$data
[
'cancel_reason'
]
=
$request
->
input
(
'reason'
);
$cancel_reason
=
$request
->
input
(
'reason'
);
$data
[
'status'
]
=
-
1
;
$operator_id
=
$request
->
user
->
userId
;
$data
[
'cancel_time'
]
=
time
();
$update
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order'
)
->
where
(
'order_id'
,
$order_id
)
->
update
(
$data
);
if
(
!
$update
)
return
[
'errcode'
=>-
1
,
'errmsg'
=>
'取消失败'
];
// 操作记录
$url
=
Config
(
'website.api_domain'
)
.
'order/cancelPay'
;
$log
[
'order_id'
]
=
$order_id
;
$log
[
'operator_id'
]
=
$request
->
user
->
userId
;
$log
[
'operator_type'
]
=
2
;
$log
[
'event'
]
=
'取消订单,取消原因:'
.
$request
->
input
(
'reason'
);
$log
[
'ip'
]
=
get_client_ip
();
$log
[
'create_time'
]
=
time
();
$actionLog
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order_action_log'
)
->
insert
(
$log
);
// 解锁库存
$check
[
'k1'
]
=
time
();
// $info = $this->orderDetail($request, $order_id);
$check
[
'k2'
]
=
md5
(
md5
(
$check
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
// $sku = array();
// foreach ($info['order_items_info'] as $v) {
$resData
=
array
(
"pf"
=>
1
,
"k1"
=>
$check
[
'k1'
],
"k2"
=>
$check
[
'k2'
],
"order_id"
=>
$order_id
,
"cancel_reason"
=>
$cancel_reason
,
'operator_id'
=>
$operator_id
);
// $sku[$v['rec_id']] = $v['goods_number'];
// }
// $res = json_decode($this->unlockSku($order_id, $sku));
$temp
=
json_decode
(
curlApi
(
$url
,
$resData
,
"POST"
),
true
);
// if ($res['errcode'] != 0) return ['errcode'=>-1, 'errmsg'=>'解锁库存失败'];
// return ['errcode'=>0, 'errmsg'=>'取消成功并解锁库存'];
return
array
(
'errcode'
=>
$temp
[
'err_code'
],
'errmsg'
=>
$temp
[
'err_msg'
]);
return
[
'errcode'
=>
0
,
'errmsg'
=>
'取消成功'
];
}
}
}
}
...
@@ -1524,27 +1506,7 @@ Class OrderController extends Controller
...
@@ -1524,27 +1506,7 @@ Class OrderController extends Controller
$temp
=
json_decode
(
curlApi
(
$url
,
$resData
,
"POST"
),
true
);
$temp
=
json_decode
(
curlApi
(
$url
,
$resData
,
"POST"
),
true
);
if
(
$temp
[
'err_code'
]
==
0
)
{
return
array
(
'errcode'
=>
$temp
[
'err_code'
],
'errmsg'
=>
$temp
[
'err_msg'
]);
// 填写快递单时锁定库存
if
(
$shipping_type
==
1
)
{
// $info = $this->orderDetail($request, $order_id);
// $sku = array();
// foreach ($info['order_items_info'] as $v) {
// $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'
=>-
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