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
69260cac
authored
Nov 23, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
整合前、后台取消订单、审核不通过接口
parent
47708db9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
23 deletions
app/Http/Controllers/AddOrderController.php
app/Http/Controllers/OrderController.php
resources/views/detail/cancelPay.blade.php
resources/views/detail/content.blade.php
app/Http/Controllers/AddOrderController.php
View file @
69260cac
...
...
@@ -557,13 +557,13 @@ Class AddOrderController extends Controller
}
else
{
$data
[
'order_id'
]
=
$request
->
input
(
'order_id'
);
$data
[
'operator_id'
]
=
$request
->
user
->
userId
;
$data
[
'
cancel_reason'
]
=
'后台审核不通过'
;
$data
[
'
type'
]
=
3
;
$url
=
Config
(
'website.api_domain'
)
.
'order/
selfC
ancel'
;
$url
=
Config
(
'website.api_domain'
)
.
'order/
c
ancel'
;
$data
[
'k1'
]
=
time
();
$data
[
'k2'
]
=
md5
(
md5
(
$data
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
$temp
=
json_decode
(
curlApi
(
$url
,
$data
,
"POST"
),
true
);
$event
=
'自营线下订单审核不通过'
;
...
...
app/Http/Controllers/OrderController.php
View file @
69260cac
...
...
@@ -975,14 +975,7 @@ Class OrderController extends Controller
$order_id
=
$request
->
input
(
'order_id'
,
''
);
//订单号
$sale_id
=
$request
->
input
(
'sale_id'
,
null
);
//对应销售
$operator_id
=
$request
->
user
->
userId
;
$order_status
=
$request
->
input
(
'order_status'
,
''
);
//审核通过 2 审核不通过(即取消订单) -1
$cancel_reason
=
$request
->
input
(
'cancel_reason'
,
''
);
$order_sn
=
$request
->
input
(
'order_sn'
,
''
);
if
(
$order_status
==
-
1
&&
!
$cancel_reason
)
{
return
array
(
'errcode'
=>
1
,
'errmsg'
=>
'审核不通过的原因不可为空!'
);
}
if
(
!
isset
(
$sale_id
))
{
return
array
(
'errcode'
=>
1
,
'errmsg'
=>
'请选择订单业务员!'
);
...
...
@@ -993,12 +986,12 @@ Class OrderController extends Controller
}
//用于后台订单审核
$url
=
Config
(
'website.api_domain'
)
.
'order/
adminCheck
'
;
$url
=
Config
(
'website.api_domain'
)
.
'order/
cancel
'
;
$check
[
'k1'
]
=
time
();
$check
[
'k2'
]
=
md5
(
md5
(
$check
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
$resData
=
array
(
"cancel_reason"
=>
$cancel_reason
,
"order_id"
=>
$order_id
,
'sale_id'
=>
$sale_id
,
'status'
=>
$order_status
,
"pf"
=>
1
,
"k1"
=>
$check
[
'k1'
],
"k2"
=>
$check
[
'k2'
],
'operator_id'
=>
$operator_id
);
$resData
=
array
(
"cancel_reason"
=>
$cancel_reason
,
"order_id"
=>
$order_id
,
'sale_id'
=>
$sale_id
,
"pf"
=>
1
,
"k1"
=>
$check
[
'k1'
],
"k2"
=>
$check
[
'k2'
],
'operator_id'
=>
$operator_id
,
'type'
=>
3
);
$temp
=
json_decode
(
curlApi
(
$url
,
$resData
,
"POST"
),
true
);
...
...
@@ -1006,7 +999,7 @@ Class OrderController extends Controller
}
}
//
取消订单(仅限审核通过,未付款前)
//
联营取消订单
public
function
cancelPay
(
Request
$request
,
$id
)
{
if
(
$request
->
isMethod
(
'post'
)){
...
...
@@ -1024,12 +1017,12 @@ Class OrderController extends Controller
return
array
(
'errcode'
=>
Error
::
E_NOT_EXISTS
,
'errmsg'
=>
'取消订单的原因不可为空~'
);
}
$url
=
Config
(
'website.api_domain'
)
.
'order/cancel
Pay
'
;
$url
=
Config
(
'website.api_domain'
)
.
'order/cancel'
;
$check
[
'k1'
]
=
time
();
$check
[
'k2'
]
=
md5
(
md5
(
$check
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
$resData
=
array
(
"pf"
=>
1
,
"k1"
=>
$check
[
'k1'
],
"k2"
=>
$check
[
'k2'
],
"order_id"
=>
$order_id
,
"cancel_reason"
=>
$cancel_reason
,
'operator_id'
=>
$operator_id
);
$resData
=
array
(
"pf"
=>
1
,
"k1"
=>
$check
[
'k1'
],
"k2"
=>
$check
[
'k2'
],
"order_id"
=>
$order_id
,
"cancel_reason"
=>
$cancel_reason
,
'operator_id'
=>
$operator_id
,
'type'
=>
2
);
$temp
=
json_decode
(
curlApi
(
$url
,
$resData
,
"POST"
),
true
);
...
...
@@ -1340,7 +1333,7 @@ Class OrderController extends Controller
return
$response
;
}
// 取消订单
//
自营
取消订单
public
function
ajaxSelfCancel
(
Request
$request
)
{
if
(
$request
->
isMethod
(
'post'
))
{
...
...
@@ -1348,13 +1341,13 @@ Class OrderController extends Controller
$cancel_reason
=
$request
->
input
(
'reason'
);
$operator_id
=
$request
->
user
->
userId
;
$url
=
Config
(
'website.api_domain'
)
.
'order/cancel
Pay
'
;
$url
=
Config
(
'website.api_domain'
)
.
'order/cancel'
;
$check
[
'k1'
]
=
time
();
$check
[
'k2'
]
=
md5
(
md5
(
$check
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
$resData
=
array
(
"pf"
=>
1
,
"k1"
=>
$check
[
'k1'
],
"k2"
=>
$check
[
'k2'
],
"order_id"
=>
$order_id
,
"cancel_reason"
=>
$cancel_reason
,
'operator_id'
=>
$operator_id
);
$resData
=
array
(
"pf"
=>
1
,
"k1"
=>
$check
[
'k1'
],
"k2"
=>
$check
[
'k2'
],
"order_id"
=>
$order_id
,
"cancel_reason"
=>
$cancel_reason
,
'operator_id'
=>
$operator_id
,
'type'
=>
2
);
$temp
=
json_decode
(
curlApi
(
$url
,
$resData
,
"POST"
),
true
);
return
array
(
'errcode'
=>
$temp
[
'err_code'
],
'errmsg'
=>
$temp
[
'err_msg'
]);
...
...
@@ -1698,7 +1691,9 @@ Class OrderController extends Controller
public
function
checkHistroyOrder
(
Request
$request
)
{
// 查找用户订单数,并更新用户表和订单扩展表
$subQuery
=
OrderModel
::
where
(
'is_type'
,
'='
,
0
)
->
orderBy
(
'order_id'
);
$subQuery
=
OrderModel
::
where
(
'is_type'
,
'='
,
0
)
->
where
(
'status'
,
'<>'
,
-
1
)
->
orderBy
(
'order_id'
);
DB
::
connection
(
'order'
)
->
table
(
'lie_order_extend'
)
->
update
([
'is_new'
=>
0
]);
// 是否新订单恢复默认值0
OrderModel
::
from
(
DB
::
raw
(
"(
{
$subQuery
->
toSql
()
}
) as sub"
))
->
mergeBindings
(
$subQuery
->
getQuery
())
...
...
resources/views/detail/cancelPay.blade.php
View file @
69260cac
...
...
@@ -5,9 +5,9 @@
case
2
:
echo
'<table class="table">
<tr>
<td>取消订单原因:</td>
<td
width="10%"
>取消订单原因:</td>
<td>
<textarea name="" id="cancel-reason" c
ols="30" rows="3"
placeholder="请输入取消原因"></textarea>
<textarea name="" id="cancel-reason" c
lass="form-control"
placeholder="请输入取消原因"></textarea>
</td>
</tr>
<tr><td colspan="20"><a class="btn btn-primary submit">提交</a></td></tr>
...
...
resources/views/detail/content.blade.php
View file @
69260cac
...
...
@@ -605,7 +605,7 @@
<a
class=
"btn btn-success"
href=
"/change/{{$order_info['order_id']}}?tags=self"
>
人工审单
</a>
@endif
@if (in_array($order_info['status'], [2, 3, 4])
&&
!$extend
&&
in_array('self_order_cancel', $userPerms))
@if (in_array($order_info['status'], [
1,
2, 3, 4])
&&
!$extend
&&
in_array('self_order_cancel', $userPerms))
<a
class=
"btn btn-default self_cancel"
href=
"javascript:;"
data-id=
"{{$order_info['order_id']}}"
>
取消订单
</a>
@endif
...
...
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