Commit e5fdf4c2 by 朱继来

取消订单添加user_id

parent a9742406
......@@ -1665,15 +1665,16 @@ Class OrderController extends Controller
public function ajaxCancel(Request $request)
{
if ($request->isMethod('post')) {
$data['order_id'] = $request->input('order_id', 0);
$data['user_id'] = $request->input('user_id', 0);
$data['order_id'] = $request->input('order_id', 0);
$data['cancel_reason'] = $request->input('cancel_reason', '');
$data['type'] = $request->input('type', 2); // 2.取消订单,3.审核不通过,4-填写取消原因
$data['operator_id'] = $request->user->userId;
$data['type'] = $request->input('type', 2); // 2.取消订单,3.审核不通过,4-填写取消原因
$data['operator_id'] = $request->user->userId;
$url = Config('website.api_domain').'order/cancel';
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$temp = json_decode(curlApi($url, $data, "POST"), true);
......
......@@ -555,10 +555,11 @@
cancelorder:function () {
// 填写订单取消原因
$('.input-cancel-reason').click(function(){
var self = $(this);
var self = $(this);
var user_id = self.data('uid');
var order_id = self.data('oid');
var type = self.data('type');
var title = '';
var type = self.data('type');
var title = '';
switch (type) {
case 2: title = '取消订单'; break;
......@@ -670,7 +671,7 @@
$.ajax({
url:'/ajaxCancel',
data: {order_id: order_id, cancel_reason: cancel_reason, type: type},
data: {user_id: user_id, order_id: order_id, cancel_reason: cancel_reason, type: type},
type:'post',
dataType: 'json',
success:function(resp){
......
......@@ -7,10 +7,11 @@
cancelorder:function () {
// 填写订单取消原因
$('.input-cancel-reason').click(function(){
var self = $(this);
var self = $(this);
var user_id = self.data('uid');
var order_id = self.data('oid');
var type = self.data('type');
var title = '';
var type = self.data('type');
var title = '';
switch (type) {
case 2: title = '取消订单'; break;
......@@ -122,7 +123,7 @@
$.ajax({
url:'/ajaxCancel',
data: {order_id: order_id, cancel_reason: cancel_reason, type: type},
data: {user_id: user_id, order_id: order_id, cancel_reason: cancel_reason, type: type},
type:'post',
dataType: 'json',
success:function(resp){
......
......@@ -153,7 +153,7 @@
<div class="tabs-box">
@if (in_array($order_info['status'], [1, 2, 3, 4]) && in_array('cancel_order', $userPerms))
<!-- <a href="{{URL('cancelPay', ['order_id'=>$order_info['order_id']])}}" class="btn btn-danger">取消订单</a> -->
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$order_info['order_id']}}" data-type="2">取消订单</a>
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$order_info['order_id']}}" data-uid="{{$order_info['user_id']}}" data-type="2">取消订单</a>
@endif
@if (in_array('check_order', $userPerms) && $order_info['sale_id'])
......@@ -221,7 +221,7 @@
<div class="tabs-box">
@if (in_array($order_info['status'], [1, 2, 3, 4]) && in_array('self_order_cancel', $userPerms))
<!-- <a class="btn btn-danger self_cancel" href="javascript:;" data-id="{{$order_info['order_id']}}">取消订单</a> -->
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$order_info['order_id']}}" data-type="2">取消订单</a>
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$order_info['order_id']}}" data-uid="{{$order_info['user_id']}}" data-type="2">取消订单</a>
@endif
<!-- 判断状态和权限 $extend-自营线下订单 -->
......
......@@ -389,7 +389,7 @@
?>
@if ($v['status'] == -1 && !$v['cancel_reason'])
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$v['order_id']}}" data-type="4">填写取消原因</a>
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$v['order_id']}}" data-uid="{{$v['user_id']}}" data-type="4">填写取消原因</a>
@endif
</div>
</td>
......
......@@ -394,7 +394,7 @@
@endif
@if ($v['status'] == -1 && !$v['cancel_reason'])
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$v['order_id']}}" data-type="4">填写取消原因</a>
<a class="btn btn-danger input-cancel-reason" href="javascript:;" data-oid="{{$v['order_id']}}" data-uid="{{$v['user_id']}}" data-type="4">填写取消原因</a>
@endif
</div>
</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