Commit 98fb4b08 by 朱继来

Merge branch 'zjl_pay_refund_20190123' into development

parents 2347ab2e 9ddefb4c
...@@ -164,11 +164,16 @@ class RefundController extends Controller ...@@ -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'); $refund = DB::connection('order')->table('lie_order_refund')->where('refund_id', $id)->first();
$data['pay_code'] = 'alipay';
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'; $url = Config('website.api_domain').'refund/recharge';
...@@ -177,9 +182,9 @@ class RefundController extends Controller ...@@ -177,9 +182,9 @@ class RefundController extends Controller
$temp = curlApi($url, $data, "POST"); $temp = curlApi($url, $data, "POST");
if (!$temp) return ['errcode'=>44300, 'errmsg'=>'未获取到退款地址']; if (!$temp) echo '未获取到退款地址';
return ['errcode'=>0, 'errmsg'=>'获取成功', 'data'=>$temp]; echo $temp;
} }
} }
...@@ -111,7 +111,7 @@ Route::group(['middleware' => 'web'], function () { ...@@ -111,7 +111,7 @@ Route::group(['middleware' => 'web'], function () {
Route::get('/refund_order', 'RefundController@refundList'); Route::get('/refund_order', 'RefundController@refundList');
Route::get('/refund_export', 'RefundController@refundExport'); Route::get('/refund_export', 'RefundController@refundExport');
Route::get('/refund_details/{id}', 'RefundController@refundDetails'); Route::get('/refund_details/{id}', 'RefundController@refundDetails');
Route::post('/ajax/wallet_refund', 'RefundController@walletRefund'); Route::match(['get', 'post'], '/wallet_refund/{id}', 'RefundController@walletRefund');
}); });
// 不需要登陆态 // 不需要登陆态
......
...@@ -120,35 +120,30 @@ ...@@ -120,35 +120,30 @@
refundCommon('/refund_export'); refundCommon('/refund_export');
}) })
// 钱包退款 // // 钱包退款
$('.wallet-refund').click(function(){ // $('.wallet-refund').click(function(){
var order_id = $(this).data('oid'); // var order_id = $(this).data('oid');
var amount = $(this).data('amount'); // var amount = $(this).data('amount');
$.ajax({ // $.ajax({
url : 'ajax/wallet_refund', // url : 'ajax/wallet_refund',
type: 'post', // type: 'post',
data: {order_id: order_id, amount: amount}, // data: {order_id: order_id, amount: amount},
dataType: 'json', // dataType: 'json',
success: function (resp) { // success: function (resp) {
if (resp.errcode == 0) { // if (resp.errcode == 0) {
layer.open({ // window.href =
type: 2,
area:['600px', '450px'], // return false;
title: '扫码退款', // }
content: resp.data,
}); // layer.msg(resp.errmsg);
// },
return false; // error: function (err) {
} // console.log(err)
// }
layer.msg(resp.errmsg); // })
}, // })
error: function (err) {
console.log(err)
}
})
})
} }
} }
}); });
......
...@@ -118,11 +118,11 @@ ...@@ -118,11 +118,11 @@
<td> <td>
<div class="btn-group btn-group-xs"> <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-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) @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 @endif
</div> </div>
</td> </td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment