Commit 710deced by 朱继来

调整订单导出

parent 4c376945
Showing with 10 additions and 5 deletions
...@@ -473,12 +473,14 @@ Class OrderController extends Controller ...@@ -473,12 +473,14 @@ Class OrderController extends Controller
array('order_sn', '订单编号'), array('order_sn', '订单编号'),
array('user_account', '会员账号'), array('user_account', '会员账号'),
array('consignee', '收货人'), array('consignee', '收货人'),
array('create_time', '下单时间'), array('create_time_date', '下单日期'),
array('create_time_sec', '下单时间'),
array('com_name', '公司名称'), array('com_name', '公司名称'),
array('goods_name', '商品型号'), array('goods_name', '商品型号'),
array('goods_number', '数量'), array('goods_number', '数量'),
array('goods_price', '单价'), array('goods_price', '单价'),
array('goods_amount', '商品总额'), array('goods_amount', '商品小计'),
array('goods_sum', '商品总额'),
array('shipping_fee', '运费'), array('shipping_fee', '运费'),
array('extra_fee', '附加费'), array('extra_fee', '附加费'),
array('coupon', '优惠券'), array('coupon', '优惠券'),
...@@ -621,7 +623,7 @@ Class OrderController extends Controller ...@@ -621,7 +623,7 @@ Class OrderController extends Controller
}) })
->where('it.status', '<>', -1) ->where('it.status', '<>', -1)
->where('o.order_goods_type', '=', $map['order_goods_type']) ->where('o.order_goods_type', '=', $map['order_goods_type'])
->select('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', 'i.invoice_status', 'a.consignee', 's.status as shipping_status', 'u.user_id', 'u.mobile', 'u.email', 'c.com_name') ->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', 'i.invoice_status', 'a.consignee', 's.status as shipping_status', 'u.user_id', 'u.mobile', 'u.email', 'c.com_name')
->groupBy('it.rec_id') ->groupBy('it.rec_id')
->orderBy('o.create_time', 'DESC') ->orderBy('o.create_time', 'DESC')
->get(); ->get();
...@@ -702,10 +704,11 @@ Class OrderController extends Controller ...@@ -702,10 +704,11 @@ Class OrderController extends Controller
} }
$tmp[$i]['order_id'] = $order[$i]->order_id; $tmp[$i]['order_id'] = $order[$i]->order_id;
$tmp[$i]['order_sn'] = $order[$i]->order_sn; $tmp[$i]['order_sn'] = "\t".$order[$i]->order_sn."\t";
$tmp[$i]['user_account'] = $order[$i]->mobile ? $order[$i]->mobile : $order[$i]->email; $tmp[$i]['user_account'] = $order[$i]->mobile ? $order[$i]->mobile : $order[$i]->email;
$tmp[$i]['consignee'] = isset($order[$i]->consignee) ? $order[$i]->consignee : ''; $tmp[$i]['consignee'] = isset($order[$i]->consignee) ? $order[$i]->consignee : '';
$tmp[$i]['create_time'] = date('Y-m-d H:i:s', $order[$i]->create_time); $tmp[$i]['create_time_date'] = date('Y-m-d', $order[$i]->create_time);
$tmp[$i]['create_time_sec'] = date('H:i:s', $order[$i]->create_time);
$tmp[$i]['com_name'] = isset($order[$i]->com_name) ? $order[$i]->com_name : ''; $tmp[$i]['com_name'] = isset($order[$i]->com_name) ? $order[$i]->com_name : '';
$tmp[$i]['goods_name'] = $order[$i]->goods_name; $tmp[$i]['goods_name'] = $order[$i]->goods_name;
$tmp[$i]['goods_number'] = $order[$i]->goods_number; $tmp[$i]['goods_number'] = $order[$i]->goods_number;
...@@ -713,11 +716,13 @@ Class OrderController extends Controller ...@@ -713,11 +716,13 @@ Class OrderController extends Controller
$tmp[$i]['goods_amount'] = $order[$i]->goods_number*$order[$i]->goods_price; $tmp[$i]['goods_amount'] = $order[$i]->goods_number*$order[$i]->goods_price;
if ($i > 0 && $order[$i]->order_id == $order[$i-1]->order_id) { if ($i > 0 && $order[$i]->order_id == $order[$i-1]->order_id) {
$tmp[$i]['goods_sum'] = '';
$tmp[$i]['shipping_fee'] = ''; $tmp[$i]['shipping_fee'] = '';
$tmp[$i]['extra_fee'] = ''; $tmp[$i]['extra_fee'] = '';
$tmp[$i]['coupon'] = ''; $tmp[$i]['coupon'] = '';
$tmp[$i]['order_amount'] = ''; $tmp[$i]['order_amount'] = '';
} else { } else {
$tmp[$i]['goods_sum'] = $this->getOrderPrice($order[$i]->order_id, 1);
$tmp[$i]['shipping_fee'] = $this->getOrderPrice($order[$i]->order_id, 3); $tmp[$i]['shipping_fee'] = $this->getOrderPrice($order[$i]->order_id, 3);
$tmp[$i]['extra_fee'] = $this->getOrderPrice($order[$i]->order_id, 2); $tmp[$i]['extra_fee'] = $this->getOrderPrice($order[$i]->order_id, 2);
$tmp[$i]['coupon'] = $this->getOrderPrice($order[$i]->order_id, -4); $tmp[$i]['coupon'] = $this->getOrderPrice($order[$i]->order_id, -4);
......
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