Commit 87a3ecab by 朱继来

调整erp订单

parent 508e5e76
Showing with 8 additions and 58 deletions
......@@ -357,6 +357,7 @@ Class OrderController extends Controller
$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'] = $request->input('order_source', '');
$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', '');
......@@ -374,6 +375,7 @@ Class OrderController extends Controller
$data['sale_id'] = $request->user->userId;
}
// 自营客服权限
if ($tid == 2 && $info['role'] == 6) {
$map['check_jd_order'] = 1; // 只允许查看京东自营订单
}
......@@ -389,14 +391,17 @@ Class OrderController extends Controller
if ($tid == 1) {
$map['order_type_filter'] = [1];
} else {
} else if ($tid == 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;
if ($tid == 1) {
if ($tid == 1 || $tid == 3) {
$manager = $perm->getRoleUsers($request, '经理');
$test = $perm->getRoleUsers($request, '测试');
$sales = $perm->getRoleUsers($request, '交易员');
......@@ -439,64 +444,9 @@ Class OrderController extends Controller
// erp订单
public function erpOrder(Request $request)
{
$info = $this->getPageInfo($request);
$info = $this->getOrderInfo($request, 3);
$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);
}
......
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