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
036e0ae6
authored
Dec 11, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
确认退款
parent
c47147cd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
1 deletions
app/Http/Controllers/ApiController.php
app/Model/OrderRefundLogModel.php
public/js/web/orderServiceList.js
resources/views/web/orderServiceList.blade.php
app/Http/Controllers/ApiController.php
View file @
036e0ae6
...
...
@@ -28,6 +28,8 @@ use App\Model\ShoppingCartModel;
use
App\Model\OrderServiceModel
;
use
App\Model\OrderServiceItemsModel
;
use
App\Model\OrderServiceLogModel
;
use
App\Model\OrderRefundModel
;
use
App\Model\OrderRefundLogModel
;
class
ApiController
extends
Controller
{
...
...
@@ -453,5 +455,40 @@ class ApiController extends Controller
$this
->
ExportLayui
(
$OrderServiceItemsModel
->
lists
(
$request
));
}
// 确认退款
public
function
ApiConfirmRefund
(
$request
)
{
$id
=
$request
->
input
(
'id'
,
0
);
if
(
!
$id
)
$this
->
Export
(
-
1
,
'参数缺失'
);
$OrderServiceModel
=
new
OrderServiceModel
;
$order_service
=
$OrderServiceModel
->
find
(
$id
);
$OrderRefundModel
=
new
OrderRefundModel
;
$OrderRefundLogModel
=
new
OrderRefundLogModel
;
$res
=
$OrderServiceModel
->
where
(
'id'
,
$id
)
->
update
([
'refund_status'
=>
3
]);
if
(
$res
===
false
)
$this
->
Export
(
-
1
,
'更新售后退款状态失败'
);
$update
=
[];
$update
[
'is_refund'
]
=
1
;
$update
[
'status'
]
=
10
;
$update
[
'is_sys'
]
=
2
;
// 同步财务
$update
[
'refund_time'
]
=
time
();
$res
=
$OrderRefundModel
->
where
(
'refund_id'
,
$order_service
->
refund_id
)
->
update
(
$update
);
if
(
$res
===
false
)
$this
->
Export
(
-
1
,
'更新退款表失败'
);
$update_log
=
[];
$update_log
[
'refund_status'
]
=
10
;
$update_log
[
'refund_time'
]
=
time
();
$res
=
$OrderRefundLogModel
->
where
(
'refund_id'
,
$order_service
->
refund_id
)
->
update
(
$update_log
);
if
(
$res
===
false
)
$this
->
Export
(
-
1
,
'更新退款日志失败'
);
$this
->
Export
(
0
,
'成功'
);
}
}
app/Model/OrderRefundLogModel.php
0 → 100644
View file @
036e0ae6
<?php
namespace
App\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Request
;
use
Excel
;
use
DB
;
class
OrderRefundLogModel
extends
Model
{
protected
$connection
=
'order'
;
protected
$table
=
'lie_order_refund_log'
;
protected
$primaryKey
=
'refund_log_id'
;
public
$timestamps
=
false
;
}
\ No newline at end of file
public/js/web/orderServiceList.js
View file @
036e0ae6
...
...
@@ -72,11 +72,17 @@ layui.use(['form', 'table', 'laydate'], function(){
content
=
'确定审核该申请吗?'
;
datax
=
{
id
:
data
.
id
,
service_status
:
3
};
}
else
if
(
layEvent
===
'cancel'
){
// 取消
}
else
if
(
layEvent
===
'cancel'
){
// 取消
title
=
'取消申请'
;
content
=
'确定取消该申请吗?'
;
datax
=
{
id
:
data
.
id
,
service_status
:
-
1
};
}
else
if
(
layEvent
===
'confirm'
){
// 确认退款
title
=
'确认退款'
;
content
=
'确认已退款吗?'
;
url
=
'/api/ApiConfirmRefund'
;
datax
=
{
id
:
data
.
id
};
}
layer
.
open
({
...
...
resources/views/web/orderServiceList.blade.php
View file @
036e0ae6
...
...
@@ -126,6 +126,8 @@
@{{
#
}
else
if
(
d
.
service_status
==
2
)
{
}}
<
a
class
=
"btn btn-xs btn-outline btn-success"
lay
-
event
=
"audit"
>
审核
<
/a
>
<
a
class
=
"btn btn-xs btn-outline btn-danger"
lay
-
event
=
"cancel"
>
取消
<
/a
>
@{{
#
}
else
if
(
d
.
service_status
==
3
&&
d
.
refund_status
!=
3
)
{
}}
<
a
class
=
"btn btn-xs btn-outline btn-success"
lay
-
event
=
"confirm"
>
确认退款
<
/a
>
@{{
#
}
}}
</script>
\ No newline at end of file
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