Commit 6dff1ad5 by 朱继来

调整取消订单和填写快递单

parent 56f15e7e
Showing with 9 additions and 47 deletions
...@@ -1466,37 +1466,19 @@ Class OrderController extends Controller ...@@ -1466,37 +1466,19 @@ Class OrderController extends Controller
{ {
if ($request->isMethod('post')) { if ($request->isMethod('post')) {
$order_id = $request->input('order_id'); $order_id = $request->input('order_id');
$data['cancel_reason'] = $request->input('reason'); $cancel_reason = $request->input('reason');
$data['status'] = -1; $operator_id = $request->user->userId;
$data['cancel_time'] = time();
$update = DB::connection('order')->table('lie_order')->where('order_id', $order_id)->update($data);
if (!$update) return ['errcode'=>-1, 'errmsg'=>'取消失败'];
// 操作记录
$log['order_id'] = $order_id;
$log['operator_id'] = $request->user->userId;
$log['operator_type'] = 2;
$log['event'] = '取消订单,取消原因:'.$request->input('reason');
$log['ip'] = get_client_ip();
$log['create_time'] = time();
$actionLog = DB::connection('order')->table('lie_order_action_log')->insert($log);
// 解锁库存 $url = Config('website.api_domain').'order/cancelPay';
// $info = $this->orderDetail($request, $order_id);
// $sku = array();
// foreach ($info['order_items_info'] as $v) { $check['k1'] = time();
// $sku[$v['rec_id']] = $v['goods_number']; $check['k2'] = md5(md5($check['k1']).'fh6y5t4rr351d2c3bryi');
// }
// $res = json_decode($this->unlockSku($order_id, $sku)); $resData = array("pf"=>1, "k1"=>$check['k1'], "k2"=>$check['k2'], "order_id"=>$order_id, "cancel_reason"=>$cancel_reason, 'operator_id'=>$operator_id);
// if ($res['errcode'] != 0) return ['errcode'=>-1, 'errmsg'=>'解锁库存失败']; $temp = json_decode(curlApi($url, $resData, "POST"), true);
// return ['errcode'=>0, 'errmsg'=>'取消成功并解锁库存']; return array('errcode'=>$temp['err_code'],'errmsg'=>$temp['err_msg']);
return ['errcode'=>0, 'errmsg'=>'取消成功'];
} }
} }
...@@ -1524,27 +1506,7 @@ Class OrderController extends Controller ...@@ -1524,27 +1506,7 @@ Class OrderController extends Controller
$temp = json_decode(curlApi($url, $resData, "POST"), true); $temp = json_decode(curlApi($url, $resData, "POST"), true);
if ($temp['err_code'] == 0) { return array('errcode'=>$temp['err_code'],'errmsg'=>$temp['err_msg']);
// 填写快递单时锁定库存
if ($shipping_type == 1) {
// $info = $this->orderDetail($request, $order_id);
// $sku = array();
// foreach ($info['order_items_info'] as $v) {
// $sku[$v['rec_id']] = $v['goods_number'];
// }
// $res = json_decode($this->unlockSku($order_id, $sku, true));
// if ($res['errcode'] != 0) return ['errcode'=>-1, 'errmsg'=>'锁定库存失败'];
// return ['errcode'=>0, 'errmsg'=>'填写快递单成功并锁定库存'];
}
return ['errcode'=>0, 'errmsg'=>'填写快递单成功'];
}
return ['errcode'=>-1, 'errmsg'=>'填写快递单失败'];
} }
} }
......
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