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
9ddefb4c
authored
Jan 25, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整钱包退款
parent
7da7cfa3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
38 deletions
app/Http/Controllers/RefundController.php
app/Http/routes.php
public/js/refund.js
resources/views/refundlist/content.blade.php
app/Http/Controllers/RefundController.php
View file @
9ddefb4c
...
...
@@ -164,11 +164,16 @@ class RefundController extends Controller
}
// 钱包退款
public
function
walletRefund
(
Request
$request
)
public
function
walletRefund
(
Request
$request
,
$id
)
{
$data
[
'order_id'
]
=
$request
->
input
(
'order_id'
);
$data
[
'refund_amount'
]
=
$request
->
input
(
'amount'
);
$data
[
'pay_code'
]
=
'alipay'
;
// 获取退款单
$refund
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order_refund'
)
->
where
(
'refund_id'
,
$id
)
->
first
();
if
(
!
$refund
)
echo
'未获取到退款单'
;
$data
[
'order_id'
]
=
$refund
->
order_id
;
$data
[
'refund_amount'
]
=
number_format
(
$refund
->
pay_amount
-
$refund
->
price_fall
,
2
);
$data
[
'pay_code'
]
=
'unionpay'
;
$url
=
Config
(
'website.api_domain'
)
.
'refund/recharge'
;
...
...
@@ -177,9 +182,9 @@ class RefundController extends Controller
$temp
=
curlApi
(
$url
,
$data
,
"POST"
);
if
(
!
$temp
)
return
[
'errcode'
=>
44300
,
'errmsg'
=>
'未获取到退款地址'
]
;
if
(
!
$temp
)
echo
'未获取到退款地址'
;
return
[
'errcode'
=>
0
,
'errmsg'
=>
'获取成功'
,
'data'
=>
$temp
]
;
echo
$temp
;
}
}
app/Http/routes.php
View file @
9ddefb4c
...
...
@@ -110,7 +110,7 @@ Route::group(['middleware' => 'web'], function () {
Route
::
get
(
'/refund_order'
,
'RefundController@refundList'
);
Route
::
get
(
'/refund_export'
,
'RefundController@refundExport'
);
Route
::
get
(
'/refund_details/{id}'
,
'RefundController@refundDetails'
);
Route
::
post
(
'/ajax/wallet_refund'
,
'RefundController@walletRefund'
);
Route
::
match
([
'get'
,
'post'
],
'/wallet_refund/{id}'
,
'RefundController@walletRefund'
);
});
// 不需要登陆态
...
...
public/js/refund.js
View file @
9ddefb4c
...
...
@@ -120,35 +120,30 @@
refundCommon
(
'/refund_export'
);
})
// 钱包退款
$
(
'.wallet-refund'
).
click
(
function
(){
var
order_id
=
$
(
this
).
data
(
'oid'
);
var
amount
=
$
(
this
).
data
(
'amount'
);
$
.
ajax
({
url
:
'ajax/wallet_refund'
,
type
:
'post'
,
data
:
{
order_id
:
order_id
,
amount
:
amount
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
layer
.
open
({
type
:
2
,
area
:[
'600px'
,
'450px'
],
title
:
'扫码退款'
,
content
:
resp
.
data
,
});
return
false
;
}
layer
.
msg
(
resp
.
errmsg
);
},
error
:
function
(
err
)
{
console
.
log
(
err
)
}
})
})
// // 钱包退款
// $('.wallet-refund').click(function(){
// var order_id = $(this).data('oid');
// var amount = $(this).data('amount');
// $.ajax({
// url : 'ajax/wallet_refund',
// type: 'post',
// data: {order_id: order_id, amount: amount},
// dataType: 'json',
// success: function (resp) {
// if (resp.errcode == 0) {
// window.href =
// return false;
// }
// layer.msg(resp.errmsg);
// },
// error: function (err) {
// console.log(err)
// }
// })
// })
}
}
});
...
...
resources/views/refundlist/content.blade.php
View file @
9ddefb4c
...
...
@@ -118,11 +118,11 @@
<td>
<div
class=
"btn-group btn-group-xs"
>
<a
class=
"btn btn-primary"
href=
"/refund_details/{{$v['refund_id']}}"
target=
"_blank"
>
查看申请
</a>
<!-- <a class="btn btn-info wallet-refund" data-oid="{{$v['order_id']}}" data-amount="{{number_format($v['pay_amount'] - $v['price_fall'], 2)}}" target="_blank">钱包退款</a> -->
<!-- 退款申请已处理且为钱包支付 -->
@if ($v['status'] == 10
&&
strpos($pay_name, '钱包支付') !== false)
<a
class=
"btn btn-info wallet-refund"
data-oid=
"{{$v['order_id']}}"
data-amount=
"{{number_format($v['pay_amount'] - $v['price_fall'], 2)}}"
target=
"_blank"
>
钱包退款
</a>
<!-- <a class="btn btn-info wallet-refund" data-oid="{{$v['order_id']}}" data-amount="{{number_format($v['pay_amount'] - $v['price_fall'], 2)}}" target="_blank">钱包退款</a> -->
<a
class=
"btn btn-info"
href=
"/wallet_refund/{{$v['refund_id']}}"
target=
"_blank"
>
钱包退款
</a>
@endif
</div>
</td>
...
...
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