Commit 4422d7a0 by 朱继来

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

parents 5497fc08 06580cb8
...@@ -62,6 +62,16 @@ Class AddOrderController extends Controller ...@@ -62,6 +62,16 @@ Class AddOrderController extends Controller
$info['title'] = '新增联营订单'; $info['title'] = '新增联营订单';
$info['sale_id'] = $request->user->userId; $info['sale_id'] = $request->user->userId;
$crm_user_id = $request->input('user_id', 0);
$info['crm_account'] = '';
if ($crm_user_id) {
$UserMainModel = new UserMainModel();
$user_info = $UserMainModel->find($crm_user_id);
$info['crm_account'] = $user_info['mobile'] ? $user_info['mobile'] : $user_info['email'];
}
return view('addOrder', $info); return view('addOrder', $info);
} }
...@@ -73,6 +83,16 @@ Class AddOrderController extends Controller ...@@ -73,6 +83,16 @@ Class AddOrderController extends Controller
$info['title'] = '新增自营线上订单'; $info['title'] = '新增自营线上订单';
$info['sale_id'] = $request->user->userId; $info['sale_id'] = $request->user->userId;
$crm_user_id = $request->input('user_id', 0);
$info['crm_account'] = '';
if ($crm_user_id) {
$UserMainModel = new UserMainModel();
$user_info = $UserMainModel->find($crm_user_id);
$info['crm_account'] = $user_info['mobile'] ? $user_info['mobile'] : $user_info['email'];
}
return view('addOnline', $info); return view('addOnline', $info);
} }
...@@ -92,21 +112,22 @@ Class AddOrderController extends Controller ...@@ -92,21 +112,22 @@ Class AddOrderController extends Controller
{ {
if ($request->isMethod('post')) { if ($request->isMethod('post')) {
$mobile = $request->input('mobile'); $mobile = $request->input('mobile');
$user_id = $request->input('user_id'); // $user_id = $request->input('user_id');
$goods_type = $request->input('goods_type'); // 类型,1-联营,2-自营 $goods_type = $request->input('goods_type'); // 类型,1-联营,2-自营
$operator_id = $request->user->userId; $operator_id = $request->user->userId;
$UserMainModel = new UserMainModel; $UserMainModel = new UserMainModel;
if(!empty($user_id) && strlen($request->input('user_id'))<11 ){ // if(!empty($user_id) && strlen($request->input('user_id'))<11 ){
$user = $UserMainModel->where('user_id', $user_id)->select('user_id', 'email','mobile', 'is_test')->orderBy('create_time', 'desc')->first(); // if(!empty($user_id)){
}else{ // $user = $UserMainModel->where('user_id', $user_id)->select('user_id', 'email','mobile', 'is_test')->orderBy('create_time', 'desc')->first();
// }else{
if (preg_match('/@/', $mobile)) { if (preg_match('/@/', $mobile)) {
$user = $UserMainModel->where('email', $mobile)->select('user_id', 'email', 'is_test')->orderBy('create_time', 'desc')->first(); $user = $UserMainModel->where('email', $mobile)->select('user_id', 'email', 'is_test')->orderBy('create_time', 'desc')->first();
} else { } else {
$user = $UserMainModel->where('mobile', $mobile)->select('user_id', 'mobile', 'is_test')->orderBy('create_time', 'desc')->first(); $user = $UserMainModel->where('mobile', $mobile)->select('user_id', 'mobile', 'is_test')->orderBy('create_time', 'desc')->first();
} }
} // }
if (empty($user)) return ['errcode' => -1, 'errmsg' => '未找用户信息']; if (empty($user)) return ['errcode' => -1, 'errmsg' => '未找用户信息'];
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
$menu_href = json_decode($menus); $menu_href = json_decode($menus);
} }
$path = $parse_url['path']; // path路径 $path = isset($parse_url['path']) ? $parse_url['path'] : ''; // path路径
if (in_array($path, $menu_href)) { if (in_array($path, $menu_href)) {
if (preg_match('/\/web\//', $path)) { if (preg_match('/\/web\//', $path)) {
......
...@@ -313,7 +313,7 @@ function export_csv($data = [], $header_data = [], $file_name = '') ...@@ -313,7 +313,7 @@ function export_csv($data = [], $header_data = [], $file_name = '')
$fp = fopen('php://output', 'a'); $fp = fopen('php://output', 'a');
if (!empty($header_data)) { if (!empty($header_data)) {
foreach ($header_data as $key => $value) { foreach ($header_data as $key => $value) {
$header_data[$key] = iconv('utf-8', 'gbk', $value); $header_data[$key] = iconv('utf-8', 'gbk//TRANSLIT//IGNORE', $value);
} }
fputcsv($fp, $header_data); fputcsv($fp, $header_data);
} }
...@@ -331,7 +331,7 @@ function export_csv($data = [], $header_data = [], $file_name = '') ...@@ -331,7 +331,7 @@ function export_csv($data = [], $header_data = [], $file_name = '')
} }
$row = $data[$i]; $row = $data[$i];
foreach ($row as $key => $value) { foreach ($row as $key => $value) {
$row[$key] = iconv('utf-8', 'gbk', $value); $row[$key] = iconv('utf-8', 'gbk//TRANSLIT//IGNORE', $value);
} }
fputcsv($fp, $row); fputcsv($fp, $row);
} }
......
...@@ -31,14 +31,12 @@ ...@@ -31,14 +31,12 @@
var loading = this; var loading = this;
// 获取用户信息 // 获取用户信息
function get_user(mobile = -1){ function get_user(){
// var mobile = $(this).siblings('.search-user').val(); var mobile = $('.search-user').val();
if(mobile == -1){
var mobile = getUrlParam('user_id');
}
// if(mobile == -1){
// var mobile = getUrlParam('user_id');
// }
if (!mobile) return false; if (!mobile) return false;
...@@ -49,12 +47,10 @@ ...@@ -49,12 +47,10 @@
$('#business_type').val(1).attr('disabled', false); $('#business_type').val(1).attr('disabled', false);
} }
$.ajax({ $.ajax({
url: '/ajax/getUserInfo', url: '/ajax/getUserInfo',
type: 'post', type: 'post',
data: {user_id:mobile.trim(), goods_type: goods_type,mobile:mobile}, data: {goods_type: goods_type, mobile: mobile},
dataType: 'json', dataType: 'json',
success: function (resp) { success: function (resp) {
if (resp.errcode == 0) { if (resp.errcode == 0) {
...@@ -112,8 +108,9 @@ ...@@ -112,8 +108,9 @@
get_user(); get_user();
$('.get-user').click(function(){ $('.get-user').click(function(){
var mobile = $(this).siblings('.search-user').val(); // var mobile = $(this).siblings('.search-user').val();
get_user(mobile) // get_user(mobile)
get_user();
}) })
// 选择收货地址 // 选择收货地址
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="ibox-content create-order"> <div class="ibox-content create-order">
<div class="row" style="margin-bottom: 30px;"> <div class="row" style="margin-bottom: 30px;">
<div class="col-sm-12" > <div class="col-sm-12" >
<input type="text" class="search-user user-mobile" name="user-mobile" value="" placeholder="请输入会员账号"> <input type="text" class="search-user" name="user-mobile" value="{{ $crm_account }}" placeholder="请输入会员账号">
<a class="btn btn-info get-user">获取用户信息</a> <a class="btn btn-info get-user">获取用户信息</a>
<span>快捷入口: <span>快捷入口:
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="ibox-content create-order"> <div class="ibox-content create-order">
<div class="row" style="margin-bottom: 30px;"> <div class="row" style="margin-bottom: 30px;">
<div class="col-sm-12"> <div class="col-sm-12">
<input type="text" class="search-user" name="user-mobile" value="" placeholder="请输入会员账号"> <input type="text" class="search-user" name="user-mobile" value="{{ $crm_account }}" placeholder="请输入会员账号">
<a class="btn btn-info get-user">获取用户信息</a> <a class="btn btn-info get-user">获取用户信息</a>
<span>快捷入口: <span>快捷入口:
......
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