Commit d3b28a3e by 朱继来

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

parents f6580a64 9b53e312
...@@ -372,6 +372,7 @@ Class OrderController extends Controller ...@@ -372,6 +372,7 @@ Class OrderController extends Controller
$map['test_order'] = $request->input('test_order', ''); $map['test_order'] = $request->input('test_order', '');
$map['order_pay_type'] = $request->input('order_pay_type', ''); $map['order_pay_type'] = $request->input('order_pay_type', '');
$map['order_type_a'] = $request->input('order_type_a', ''); $map['order_type_a'] = $request->input('order_type_a', '');
$map['order_source'] = $request->input('order_source', '');
$map['order_source_pf'] = $request->input('order_source_pf', ''); $map['order_source_pf'] = $request->input('order_source_pf', '');
$map['order_source_adtag'] = $request->input('order_source_adtag', ''); $map['order_source_adtag'] = $request->input('order_source_adtag', '');
$map['order_source_ptag'] = $request->input('order_source_ptag', ''); $map['order_source_ptag'] = $request->input('order_source_ptag', '');
...@@ -389,6 +390,7 @@ Class OrderController extends Controller ...@@ -389,6 +390,7 @@ Class OrderController extends Controller
$data['sale_id'] = $request->user->userId; $data['sale_id'] = $request->user->userId;
} }
// 自营客服权限
if ($tid == 2 && $info['role'] == 6) { if ($tid == 2 && $info['role'] == 6) {
$map['check_jd_order'] = 1; // 只允许查看京东自营订单 $map['check_jd_order'] = 1; // 只允许查看京东自营订单
} }
...@@ -404,14 +406,17 @@ Class OrderController extends Controller ...@@ -404,14 +406,17 @@ Class OrderController extends Controller
if ($tid == 1) { if ($tid == 1) {
$map['order_type_filter'] = [1]; $map['order_type_filter'] = [1];
} else { } else if ($tid == 2) {
$map['order_type_filter'] = [1, 3]; // 1. 网站 2. 京东 $map['order_type_filter'] = [1, 3]; // 1. 网站 2. 京东
} else if ($tid == 3) {
$map['order_goods_type'] = 1; // 联营订单
$map['order_type_filter'] = [2, 3]; // 2-ERP, 3-JD
} }
// 获取所有的业务员 (包括经理、交易员、客服、测试) // 获取所有的业务员 (包括经理、交易员、客服、测试)
$perm = new PermController; $perm = new PermController;
if ($tid == 1) { if ($tid == 1 || $tid == 3) {
$manager = $perm->getRoleUsers($request, '经理'); $manager = $perm->getRoleUsers($request, '经理');
$test = $perm->getRoleUsers($request, '测试'); $test = $perm->getRoleUsers($request, '测试');
$sales = $perm->getRoleUsers($request, '交易员'); $sales = $perm->getRoleUsers($request, '交易员');
...@@ -454,64 +459,9 @@ Class OrderController extends Controller ...@@ -454,64 +459,9 @@ Class OrderController extends Controller
// erp订单 // erp订单
public function erpOrder(Request $request) public function erpOrder(Request $request)
{ {
$info = $this->getPageInfo($request); $info = $this->getOrderInfo($request, 3);
$info['title'] = 'ERP订单'; $info['title'] = 'ERP订单';
$map = array();
// 页面参数
if ($request->isMethod('get')) {
$map['order_type'] = $request->input('order_type', '');
$map['order_contain'] = $request->input('order_contain', '');
$map['time_start'] = $request->input('time_start', '');
$map['time_end'] = $request->input('time_end', '');
$map['order_status'] = $request->input('order_status', '');
$map['order_send'] = $request->input('order_send', '');
$map['order_source'] = $request->input('order_source', '');
}
$map['order_goods_type'] = 1; // 联营订单
/* 查看ERP/JD订单 */
$map['order_type_filter'] = [2, 3]; // 2-ERP, 3-JD
// 非竞调账号,则查看真实数据
if ($info['username'] != 'vpadmin@ichunt.com') {
$map['is_fake'] = 0;
} else {
$map['vp_time_set'] = strtotime(Config('website.vp_time_set'));
}
// 获取所有的业务员 (包括经理和交易员)
$perm = new PermController;
$manager = $perm->getRoleUsers($request, '经理');
$sale_list = $perm->getRoleUsers($request, '交易员');
$test = $perm->getRoleUsers($request, '测试');
$sale_list = array_merge($manager, $sale_list, $test);
//获取订单列表
$url = Config('website.api_domain').'order/getAllOrder';
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['p'] = $request->input('p', 1); // 当前页码
$data['map'] = $map;
$response = json_decode(curlApi($url, $data), true);
// 分页
$page = new Page($response['data']['count'], 10);
$page->setConfig('theme', '%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
$show = $page->show();
$info['condition'] = $map;
$info['sale_list'] = $sale_list;
$info['list'] = $response['data']['data'];
$info['pay_count'] = $response['data']['pay_count'];
$info['count'] = $response['data']['count'];
$info['page'] = $show;
return view('erpOrder', $info); return view('erpOrder', $info);
} }
......
...@@ -82,6 +82,8 @@ class OrderModel extends Model ...@@ -82,6 +82,8 @@ class OrderModel extends Model
$query->where('o.order_sn', '=', $map['order_contain']); $query->where('o.order_sn', '=', $map['order_contain']);
} else if ($map['order_type'] == 2) { // 型号名称 } else if ($map['order_type'] == 2) { // 型号名称
$query->where('it.goods_name', '=', $map['order_contain']); $query->where('it.goods_name', '=', $map['order_contain']);
} else if ($map['order_type'] == 3) { // 发票抬头
$query->where('i.tax_title', '=', $map['order_contain']);
} else { // 会员账号 } else { // 会员账号
if (preg_match('/@/', $map['order_contain'])) { if (preg_match('/@/', $map['order_contain'])) {
$query->where('u.email', '=', $map['order_contain']); $query->where('u.email', '=', $map['order_contain']);
......
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
@if (empty($list)) @if (empty($list))
<tr> <tr>
<td colspan="10">没有查询到相关记录~</td> <td colspan="11" class="text-center">没有查询到相关记录~</td>
</tr> </tr>
@else @else
<tbody> <tbody>
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
<!-- 点击展示内容 --> <!-- 点击展示内容 -->
<tr class="show-other-content"> <tr class="show-other-content">
<td colspan="10"> <td colspan="11">
<table class="table table-hover table-bordered"> <table class="table table-hover table-bordered">
<tr> <tr>
<td class="table-list-title">订单编号</td> <td class="table-list-title">订单编号</td>
......
...@@ -363,15 +363,17 @@ ...@@ -363,15 +363,17 @@
</table> </table>
</div> </div>
<div class="row-fluid pagination"> <div class="row-fluid pagination">
<span class="show-list-info"> @if ($username != 'vpadmin@ichunt.com')
共{{$count ? $count : 0}}单, <span class="show-list-info">
{{$paid_order_count}}单已付款(包含预付款), 共{{$count ? $count : 0}}单,
下单用户数为{{$user_count}}人, {{$paid_order_count}}单已付款(包含预付款),
付款用户数为{{$paid_user_count}}人, 下单用户数为{{$user_count}}人,
应付金额 ¥{{$pay_count['rmb_count'] ? $pay_count['rmb_count'] : 0}}, ${{$pay_count['usd_count'] ? $pay_count['usd_count'] : 0}}, 付款用户数为{{$paid_user_count}}人,
实收金额 ¥{{$pay_count['rmb_pay'] ? $pay_count['rmb_pay'] : 0}}, 应付金额 ¥{{$pay_count['rmb_count'] ? $pay_count['rmb_count'] : 0}}, ${{$pay_count['usd_count'] ? $pay_count['usd_count'] : 0}},
${{$pay_count['usd_pay'] ? $pay_count['usd_pay'] : 0}} 实收金额 ¥{{$pay_count['rmb_pay'] ? $pay_count['rmb_pay'] : 0}},
</span> ${{$pay_count['usd_pay'] ? $pay_count['usd_pay'] : 0}}
</span>
@endif
<?php echo $page; ?> <?php echo $page; ?>
</div> </div>
......
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