Commit 1fee021d by 朱继来

导出添加字段

parent de60b83b
...@@ -518,6 +518,9 @@ Class OrderController extends Controller ...@@ -518,6 +518,9 @@ Class OrderController extends Controller
array('company_name', '供应商'), array('company_name', '供应商'),
array('sale_name', $sale_name), array('sale_name', $sale_name),
array('adtags', 'adtags来源'), array('adtags', 'adtags来源'),
array('is_new_client', '是否为新用户'),
array('client_source', '新用户来源'),
array('cancel_reason', '取消原因'),
); );
// 非竞调账号,则查看真实数据 // 非竞调账号,则查看真实数据
...@@ -528,6 +531,7 @@ Class OrderController extends Controller ...@@ -528,6 +531,7 @@ Class OrderController extends Controller
$list = DB::connection('order') $list = DB::connection('order')
->table('lie_order_items as it') ->table('lie_order_items as it')
->leftJoin('lie_order as o', 'it.order_id', '=', 'o.order_id') ->leftJoin('lie_order as o', 'it.order_id', '=', 'o.order_id')
->leftJoin('lie_order_extend as oe', 'it.order_id', '=', 'oe.order_id')
->leftJoin('lie_pay_log as p', 'it.order_id', '=', 'p.order_id') ->leftJoin('lie_pay_log as p', 'it.order_id', '=', 'p.order_id')
->leftJoin('lie_order_invoice as i', 'it.order_id', '=', 'i.order_id') ->leftJoin('lie_order_invoice as i', 'it.order_id', '=', 'i.order_id')
->leftJoin('lie_order_address as a', function($join) { ->leftJoin('lie_order_address as a', function($join) {
...@@ -660,7 +664,7 @@ Class OrderController extends Controller ...@@ -660,7 +664,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_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') ->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', 'oe.is_newclient', 'oe.client_source', '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();
...@@ -742,31 +746,47 @@ Class OrderController extends Controller ...@@ -742,31 +746,47 @@ Class OrderController extends Controller
} }
$tmp[$i]['order_id'] = $order[$i]->order_id; $tmp[$i]['order_id'] = $order[$i]->order_id;
$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]['consignee'] = isset($order[$i]->consignee) ? $order[$i]->consignee : '';
$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]['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;
$tmp[$i]['goods_price'] = $order[$i]->goods_price; $tmp[$i]['goods_price'] = $order[$i]->goods_price;
$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]['order_sn'] = '';
$tmp[$i]['user_account'] = '';
$tmp[$i]['consignee'] = '';
$tmp[$i]['create_time_date'] = '';
$tmp[$i]['create_time_sec'] = '';
$tmp[$i]['com_name'] = '';
$tmp[$i]['goods_sum'] = ''; $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'] = '';
$tmp[$i]['currency'] = '';
$tmp[$i]['order_type'] = '';
$tmp[$i]['order_status'] = '';
$tmp[$i]['shipping_status'] = ''; // 发货状态
$tmp[$i]['invoice_status'] = ''; // 发票状态
$tmp[$i]['company_name'] = '';
$tmp[$i]['sale_name'] = ''; // 推送业务员
$tmp[$i]['adtags'] = '';
$tmp[$i]['is_new_client'] = '';
$tmp[$i]['client_source'] = '';
$tmp[$i]['cancel_reason'] = '';
} else { } else {
$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]['consignee'] = isset($order[$i]->consignee) ? $order[$i]->consignee : '';
$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]['goods_sum'] = $this->getOrderPrice($order[$i]->order_id, 1); $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);
$tmp[$i]['order_amount'] = $order[$i]->order_amount; $tmp[$i]['order_amount'] = $order[$i]->order_amount;
}
$tmp[$i]['currency'] = $order[$i]->currency == 1 ? 'RMB' : 'USD'; $tmp[$i]['currency'] = $order[$i]->currency == 1 ? 'RMB' : 'USD';
$tmp[$i]['order_type'] = $order_type[$order[$i]->order_pay_type]; $tmp[$i]['order_type'] = $order_type[$order[$i]->order_pay_type];
$tmp[$i]['order_status'] = $order_status[$order[$i]->status]; $tmp[$i]['order_status'] = $order_status[$order[$i]->status];
...@@ -775,6 +795,10 @@ Class OrderController extends Controller ...@@ -775,6 +795,10 @@ Class OrderController extends Controller
$tmp[$i]['company_name'] = $order[$i]->supplier_name; $tmp[$i]['company_name'] = $order[$i]->supplier_name;
$tmp[$i]['sale_name'] = isset($sales) ? $sales->name : ''; // 推送业务员 $tmp[$i]['sale_name'] = isset($sales) ? $sales->name : ''; // 推送业务员
$tmp[$i]['adtags'] = $order[$i]->order_source; $tmp[$i]['adtags'] = $order[$i]->order_source;
$tmp[$i]['is_new_client'] = $order[$i]->is_newclient == 1 ? '是' : '否';
$tmp[$i]['client_source'] = $order[$i]->client_source;
$tmp[$i]['cancel_reason'] = $order[$i]->cancel_reason;
}
unset($sales); unset($sales);
} }
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<dl> <dl>
<dt></dt> <dt></dt>
<dd> <dd>
<input type="checkbox" name="test_order"> 所有订单-包括测试 <label><input type="checkbox" name="test_order"> 所有订单-包括测试</label>
</dd> </dd>
</dl> </dl>
@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