Commit a8d79868 by 朱继来

Merge branch 'master' of http://119.23.72.7/zhujilai/Order into zjl_form_duplicate_submit_20191031

parents a95946d4 1839bc13
...@@ -662,11 +662,11 @@ Class OrderController extends Controller ...@@ -662,11 +662,11 @@ Class OrderController extends Controller
// 订单导出 // 订单导出
public function export(Request $request) public function export(Request $request)
{ {
$info = $this->getPageInfo($request); $info = $this->_search($request, $request->input('order_goods_type'));
$orderModel = new OrderModel(); $orderModel = new OrderModel();
return $orderModel->orderExport($request, $info); return $orderModel->orderExport($info['map']);
} }
// 下载合同 // 下载合同
......
...@@ -15,58 +15,14 @@ class OrderModel extends Model ...@@ -15,58 +15,14 @@ class OrderModel extends Model
public $timestamps = false; public $timestamps = false;
// 订单导出 // 订单导出
public function orderExport($request, $info) public function orderExport($map)
{ {
set_time_limit(0); set_time_limit(0);
ini_set('memory_limit', '2048M'); ini_set('memory_limit', '2048M');
$map = array();
$userMainModel = new UserMainModel(); $userMainModel = new UserMainModel();
$map['testMobile'] = $userMainModel->testMobile(); $map['testMobile'] = $userMainModel->testMobile();
// 页面参数
if ($request->isMethod('get')) {
$map['order_type'] = $request->input('order_type', '');
$map['order_contain'] = $request->input('order_contain', '');
$map['order_sn'] = $request->input('order_sn', '');
$map['erp_sn'] = $request->input('erp_sn', '');
$map['goods_name'] = $request->input('goods_name', '');
$map['time_start'] = $request->input('time_start', '');
$map['time_end'] = $request->input('time_end', '');
$map['order_status'] = $request->input('order_status', '');
$map['shipping_name'] = $request->input('shipping_name', '');
$map['order_send'] = $request->input('order_send', '');
$map['test_order'] = $request->input('test_order', '');
$map['order_pay_type'] = $request->input('order_pay_type', '');
$map['order_type_a'] = $request->input('order_type_a', '');
$map['order_source_pf'] = $request->input('order_source_pf', '');
$map['order_source_adtag'] = $request->input('order_source_adtag', '');
$map['order_source_ptag'] = $request->input('order_source_ptag', '');
$map['erp_order_id'] = $request->input('erp_order_id', '');
$map['order_payment_mode'] = $request->input('order_payment_mode', '');
$map['order_invoice_status'] = $request->input('order_invoice_status', '');
$map['order_goods_type'] = $request->input('order_goods_type', '');
$map['is_new'] = $request->input('is_new', '');
$map['is_new_order'] = $request->input('is_new_order', '');
$map['sale_type'] = $request->input('sale_type', '');
$map['business_type'] = $request->input('business_type', '');
}
/* 临时添加 所有人只能查看线上订单 */
// $map['online_order'] = 1;
// 非竞调账号,则查看真实数据
if ($info['role'] != 13) {
$map['is_fake'] = 0;
}
if ($map['order_goods_type'] == 1) {
$map['order_type_filter'] = in_array($info['role'], [1, 13]) ? [1, 2, 3] : [1]; // 管理员和尽调账号可以查看平台、ERP、京东订单
} else {
$map['order_type_filter'] = [1, 3, 4]; // 1.网站 3.京东 4.象牙宝
}
$list = $this->from('lie_order_items as it') $list = $this->from('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_pay_log as p', 'it.order_id', '=', 'p.order_id') ->leftJoin('lie_pay_log as p', 'it.order_id', '=', 'p.order_id')
...@@ -138,8 +94,8 @@ class OrderModel extends Model ...@@ -138,8 +94,8 @@ class OrderModel extends Model
}) })
->where(function ($query) use ($map) { ->where(function ($query) use ($map) {
// 订单推送业务员 // 订单推送业务员
if (!empty($map['order_send'])) { if (!empty($map['sale_id'])) {
$query->whereIn('o.sale_id', explode(',', $map['order_send'])); $query->whereIn('o.sale_id', $map['sale_id']);
} }
}) })
->where(function ($query) use ($map) { ->where(function ($query) use ($map) {
......
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