Commit 37c35394 by 朱继来

temp

parent 6b5fe483
......@@ -188,28 +188,44 @@ class ApiController extends Controller
/*
修改订单详情
*/
public function update_order_items($request){
public function update_order_items($request)
{
$OrderItemsModel = new OrderItemsModel();
// $OrderItemsModel = new OrderItemsModel();
$data['id'] = $request->input('id');
$data['remarks'] = $request->input('remarks');
$data['buyer_id'] = $request->input('buyer_id');//采购id
$data['batch'] = $request->input('batch');//采购id
$data['order_id'] = $request->input('order_id');
$data['operator_id'] = $request->user->userId;
$data['id'] = $request->input('id');
$data['remarks'] = $request->input('remarks');
$data['buyer_id'] = $request->input('buyer_id');//采购id
$data['batch'] = $request->input('batch');//批次
if($data['buyer_id'] == -1){
unset($data['buyer_id']);
}
// if($data['buyer_id'] == -1){
// unset($data['buyer_id']);
// }
$result = $OrderItemsModel->updateData($data);
// $result = $OrderItemsModel->updateData($data);
if($result !== false){
$this->Export(0, '编辑明细成功');
}else{
$this->Export(1, '编辑明细失败');
// if($result !== false){
// $this->Export(0, '编辑明细成功');
// }else{
// $this->Export(1, '编辑明细失败');
// }
$url = Config('website.api_domain').'order/updateorderitems';
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
dd(curlApi($url, $data, "POST"));
$temp = json_decode(curlApi($url, $data, "POST"), true); // 连接API
if ($temp['err_code'] != 0) {
return ['errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']];
}
return ['errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']];
}
/*
......
......@@ -1164,6 +1164,7 @@
// 编辑商品明细
$('.edit-item').click(function() {
var order_id = $('#order_id').val();
var order_goods_type = $('#order_goods_type').val();
var rec_id = $(this).data('id');
var item_batch = $(this).data('batch');
......@@ -1238,7 +1239,7 @@
$.ajax({
url: '/api/update_order_items',
data: {id: rec_id, batch: batch, buyer_id: buyer_id, remarks: remarks},
data: {order_id: order_id, id: rec_id, batch: batch, buyer_id: buyer_id, remarks: remarks},
type:'post',
dataType: 'json',
success:function(resp){
......
......@@ -594,8 +594,8 @@
<td>
<!-- <button type="button" class="btn btn-success btn-xs remarks">编辑</button> -->
@if ($order_info['status'] != -1)
<button type="button" class="btn btn-success btn-xs edit-item" data-id="{{$v['rec_id']}}" data-batch="{{$v['batch']}}" data-bid="{{$v['buyer_id']}}" data-remarks="{{$v['remarks']}}">编辑</button>
@if ($order_info['status'] < 4)
<button type="button" class="btn btn-success btn-xs edit-item" data-id="{{$v['rec_id']}}" data-batch="{{$v['batch']}}" data-bid="{{$v['buyer_id']}}" data-remarks="{{$v['remarks']}}">编辑</button>
@endif
</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