Commit 5b391770 by 朱继来

Merge branch 'master' of http://119.23.72.7/zhujilai/Order into zjl_order_invoice_20181123

parents 12a171ab ac39c42f
...@@ -557,13 +557,13 @@ Class AddOrderController extends Controller ...@@ -557,13 +557,13 @@ Class AddOrderController extends Controller
} else { } else {
$data['order_id'] = $request->input('order_id'); $data['order_id'] = $request->input('order_id');
$data['operator_id'] = $request->user->userId; $data['operator_id'] = $request->user->userId;
$data['cancel_reason'] = '后台审核不通过'; $data['type'] = 3;
$url = Config('website.api_domain').'order/selfCancel'; $url = Config('website.api_domain').'order/cancel';
$data['k1'] = time(); $data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi'); $data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$temp = json_decode(curlApi($url, $data, "POST"), true); $temp = json_decode(curlApi($url, $data, "POST"), true);
$event = '自营线下订单审核不通过'; $event = '自营线下订单审核不通过';
......
...@@ -990,14 +990,7 @@ Class OrderController extends Controller ...@@ -990,14 +990,7 @@ Class OrderController extends Controller
$order_id = $request->input('order_id', ''); //订单号 $order_id = $request->input('order_id', ''); //订单号
$sale_id = $request->input('sale_id', null); //对应销售 $sale_id = $request->input('sale_id', null); //对应销售
$operator_id = $request->user->userId; $operator_id = $request->user->userId;
$order_status = $request->input('order_status', ''); //审核通过 2 审核不通过(即取消订单) -1
$cancel_reason = $request->input('cancel_reason', ''); $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)) { if (!isset($sale_id)) {
return array('errcode'=>1, 'errmsg'=>'请选择订单业务员!'); return array('errcode'=>1, 'errmsg'=>'请选择订单业务员!');
...@@ -1008,12 +1001,12 @@ Class OrderController extends Controller ...@@ -1008,12 +1001,12 @@ Class OrderController extends Controller
} }
//用于后台订单审核 //用于后台订单审核
$url = Config('website.api_domain').'order/adminCheck'; $url = Config('website.api_domain').'order/cancel';
$check['k1'] = time(); $check['k1'] = time();
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi'); $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); $temp = json_decode(curlApi($url, $resData, "POST"), true);
...@@ -1021,7 +1014,7 @@ Class OrderController extends Controller ...@@ -1021,7 +1014,7 @@ Class OrderController extends Controller
} }
} }
// 取消订单(仅限审核通过,未付款前) // 联营取消订单
public function cancelPay(Request $request, $id) public function cancelPay(Request $request, $id)
{ {
if($request->isMethod('post')){ if($request->isMethod('post')){
...@@ -1039,12 +1032,12 @@ Class OrderController extends Controller ...@@ -1039,12 +1032,12 @@ Class OrderController extends Controller
return array('errcode'=>Error::E_NOT_EXISTS,'errmsg'=>'取消订单的原因不可为空~'); return array('errcode'=>Error::E_NOT_EXISTS,'errmsg'=>'取消订单的原因不可为空~');
} }
$url = Config('website.api_domain').'order/cancelPay'; $url = Config('website.api_domain').'order/cancel';
$check['k1'] = time(); $check['k1'] = time();
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi'); $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); $temp = json_decode(curlApi($url,$resData,"POST"), true);
...@@ -1356,7 +1349,7 @@ print_r(curlApi($update_url, $data, 'POST')); ...@@ -1356,7 +1349,7 @@ print_r(curlApi($update_url, $data, 'POST'));
return $response; return $response;
} }
// 取消订单 // 自营取消订单
public function ajaxSelfCancel(Request $request) public function ajaxSelfCancel(Request $request)
{ {
if ($request->isMethod('post')) { if ($request->isMethod('post')) {
...@@ -1364,13 +1357,13 @@ print_r(curlApi($update_url, $data, 'POST')); ...@@ -1364,13 +1357,13 @@ print_r(curlApi($update_url, $data, 'POST'));
$cancel_reason = $request->input('reason'); $cancel_reason = $request->input('reason');
$operator_id = $request->user->userId; $operator_id = $request->user->userId;
$url = Config('website.api_domain').'order/cancelPay'; $url = Config('website.api_domain').'order/cancel';
$check['k1'] = time(); $check['k1'] = time();
$check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi'); $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); $temp = json_decode(curlApi($url, $resData, "POST"), true);
return array('errcode'=>$temp['err_code'],'errmsg'=>$temp['err_msg']); return array('errcode'=>$temp['err_code'],'errmsg'=>$temp['err_msg']);
...@@ -1714,7 +1707,9 @@ print_r(curlApi($update_url, $data, 'POST')); ...@@ -1714,7 +1707,9 @@ print_r(curlApi($update_url, $data, 'POST'));
public function checkHistroyOrder(Request $request) 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")) OrderModel::from(DB::raw("({$subQuery->toSql()}) as sub"))
->mergeBindings($subQuery->getQuery()) ->mergeBindings($subQuery->getQuery())
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
case 2: case 2:
echo '<table class="table"> echo '<table class="table">
<tr> <tr>
<td>取消订单原因:</td> <td width="10%">取消订单原因:</td>
<td> <td>
<textarea name="" id="cancel-reason" cols="30" rows="3" placeholder="请输入取消原因"></textarea> <textarea name="" id="cancel-reason" class="form-control" placeholder="请输入取消原因"></textarea>
</td> </td>
</tr> </tr>
<tr><td colspan="20"><a class="btn btn-primary submit">提交</a></td></tr> <tr><td colspan="20"><a class="btn btn-primary submit">提交</a></td></tr>
......
...@@ -607,7 +607,7 @@ ...@@ -607,7 +607,7 @@
<a class="btn btn-success" href="/change/{{$order_info['order_id']}}?tags=self">人工审单</a> <a class="btn btn-success" href="/change/{{$order_info['order_id']}}?tags=self">人工审单</a>
@endif @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> <a class="btn btn-default self_cancel" href="javascript:;" data-id="{{$order_info['order_id']}}">取消订单</a>
@endif @endif
......
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