Commit 31b99803 by 朱继来

fix

parent 7a502a9e
Showing with 5 additions and 40 deletions
......@@ -107,11 +107,11 @@ function getPayName($order_id)
return false;
}
function getShipping($order_id, $shipping_type=1)
function getShipping($order_id)
{
$shipping = DB::connection('order')
->table('lie_order_shipping')
->where(['order_id' => $order_id, 'shipping_type' => $shipping_type])
->where(['order_id' => $order_id, 'shipping_type' => 1])
->select('shipping_no', 'status')
->orderBy('order_shipping_id')
->get();
......@@ -611,7 +611,6 @@ Class OrderController extends Controller
array('order_type', '订单类型'),
array('order_status', '订单状态'),
array('shipping_status','发货状态'),
array('inv_type', '发票类型'),
array('invoice_status', '发票状态'),
array('company_name', '供应商'),
array('sale_name', $sale_name),
......@@ -762,7 +761,7 @@ Class OrderController extends Controller
})
->where('it.status', '<>', -1)
->where('o.order_goods_type', '=', $map['order_goods_type'])
->select('it.goods_id', 'it.goods_name', 'it.goods_number', 'it.goods_price', 'it.supplier_name', 'o.order_id', 'o.order_sn', 'o.order_pay_type', 'o.order_goods_type', 'o.order_source', 'o.create_time', 'o.status', 'o.order_amount', 'o.currency', 'o.sale_id', 'o.cancel_reason', 'i.inv_type', 'i.invoice_status', 'a.consignee', 's.status as shipping_status', 'u.user_id', 'u.mobile', 'u.email', 'u.client_source', 'c.com_name', 'oe.send_remark')
->select('it.goods_id', 'it.goods_name', 'it.goods_number', 'it.goods_price', 'it.supplier_name', 'o.order_id', 'o.order_sn', 'o.order_pay_type', 'o.order_source', 'o.create_time', 'o.status', 'o.order_amount', 'o.currency', 'o.sale_id', 'o.cancel_reason', 'i.invoice_status', 'a.consignee', 's.status as shipping_status', 'u.user_id', 'u.mobile', 'u.email', 'u.client_source', 'c.com_name', 'oe.send_remark')
->groupBy('it.rec_id')
->orderBy('o.create_time', 'DESC')
->get();
......@@ -827,14 +826,6 @@ Class OrderController extends Controller
'2' => '已签',
);
// 发票类型
$inv_type = array(
'1' => '不开发票',
'2' => '普通发票',
'3' => '增值税专用发票',
'4' => '增值税普通发票',
);
// 发票状态
$invoice_status = array(
'-1' => '待确认',
......@@ -852,8 +843,8 @@ Class OrderController extends Controller
}
$tmp[$i]['order_id'] = $order[$i]->order_id;
// 自营商品名称换成商品型号
$tmp[$i]['goods_name'] = $order[$i]->order_goods_type == 1 ? $order[$i]->goods_name : getGoodsName($order[$i]->goods_id);
$tmp[$i]['goods_name'] = $order[$i]->goods_name;
$tmp[$i]['goods_number'] = $order[$i]->goods_number;
$tmp[$i]['goods_price'] = $order[$i]->goods_price;
$tmp[$i]['goods_amount'] = $order[$i]->goods_number*$order[$i]->goods_price;
......@@ -874,7 +865,6 @@ Class OrderController extends Controller
$tmp[$i]['order_type'] = '';
$tmp[$i]['order_status'] = '';
$tmp[$i]['shipping_status'] = ''; // 发货状态
$tmp[$i]['inv_type'] = ''; // 发票类型
$tmp[$i]['invoice_status'] = ''; // 发票状态
$tmp[$i]['company_name'] = '';
$tmp[$i]['sale_name'] = ''; // 推送业务员
......@@ -898,7 +888,6 @@ Class OrderController extends Controller
$tmp[$i]['order_type'] = !empty($order[$i]->order_pay_type) ? $order_type[$order[$i]->order_pay_type] : '未知';
$tmp[$i]['order_status'] = !empty($order[$i]->status) ? $order_status[$order[$i]->status] : '未知';
$tmp[$i]['shipping_status'] = !empty($order[$i]->shipping_status) ? $shipping_status[$order[$i]->shipping_status] : '无发货信息'; // 发货状态
$tmp[$i]['inv_type'] = $order[$i]->inv_type ? $inv_type[$order[$i]->inv_type] : '未知'; // 发票类型
$tmp[$i]['invoice_status'] = !empty($order[$i]->invoice_status) ? $invoice_status[$order[$i]->invoice_status] : '无发票信息'; // 发票状态
$tmp[$i]['company_name'] = $order[$i]->supplier_name;
$tmp[$i]['sale_name'] = isset($sales) ? $sales->name : ''; // 推送业务员
......@@ -1801,30 +1790,6 @@ Class OrderController extends Controller
return view('express_set', $info);
}
// 查看物流轨迹
public function shipping(Request $request)
{
if ($request->isMethod('post')) {
$data['id'] = $request->input('order_id');
$data['uid'] = $request->input('user_id');
$data['type'] = $request->input('type');
$url = Config('website.api_domain').'order/shipping';
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$temp = json_decode(curlApi($url, $data, "POST"), true); // 连接API
if ($temp['err_code'] == 0) {
return ['errcode'=>0, 'errmsg'=>'', 'data'=>$temp['data'][0]['info']];
} else {
errorLog(Error::E_UPDATE_FAILED, '操作失败');
return ['errcode'=>Error::E_UPDATE_FAILED, 'errmsg'=>$temp['err_msg']];
}
}
}
/**
* 定时任务:提前一天上午10点
......
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