Commit 66e85574 by 朱继来

添加账号邮件搜索

parent 862032e6
......@@ -137,7 +137,11 @@ Class AddOrderController extends Controller
if ($request->isMethod('post')) {
$mobile = $request->input('mobile');
$user = DB::connection('order')->table('lie_user_main')->where('mobile', $mobile)->select('user_id', 'mobile', 'is_test')->first();
if (preg_match('/@/', $mobile)) {
$user = DB::connection('order')->table('lie_user_main')->where('email', $mobile)->select('user_id', 'email', 'is_test')->first();
} else {
$user = DB::connection('order')->table('lie_user_main')->where('mobile', $mobile)->select('user_id', 'mobile', 'is_test')->first();
}
if (!empty($user)) {
// 收货地址
......
......@@ -33,12 +33,18 @@
success: function (resp) {
if (resp.errcode == 0) {
var data = resp.data;
var reg = /@/;
$('.user-info').show();
// 账号信息
$('.user_id').val(data.user.user_id);
$('.user-mobile').text(data.user.mobile);
if (reg.test(mobile)) {
$('.user-mobile').text(data.user.email);
} else {
$('.user-mobile').text(data.user.mobile);
}
var is_test = data.user.is_test ? '是' : '否';
$('.user-test').text(is_test);
......
......@@ -18,7 +18,7 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span>手机号码</span>
<span>会员账号</span>
<span>{{Config('website.internal-account')}}</span>
</div>
</div>
......
......@@ -18,7 +18,7 @@
.get-user{padding: 3px 6px; margin-right: 20px;}
</style>
<div class="col-sm-6">
<input type="text" class="search-user" name="user-mobile" value="" placeholder="请输入用户手机号码">
<input type="text" class="search-user" name="user-mobile" value="" placeholder="请输入会员账号">
<a class="btn btn-info get-user">获取用户信息</a>
<span>快捷入口:<a href="{{Config('website.add-user-url')}}" target="_blank">新增用户账号</a></span>
......@@ -34,7 +34,7 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span>手机号码</span>
<span>会员账号</span>
<span class="user-mobile"></span>
</div>
</div>
......
......@@ -18,7 +18,7 @@
.get-user{padding: 3px 6px; margin-right: 20px;}
</style>
<div class="col-sm-6">
<input type="text" class="search-user" name="user-mobile" value="" placeholder="请输入用户手机号码">
<input type="text" class="search-user" name="user-mobile" value="" placeholder="请输入会员账号">
<a class="btn btn-info get-user">获取用户信息</a>
<span>快捷入口:<a href="{{Config('website.add-user-url')}}" target="_blank">新增用户账号</a></span>
......@@ -34,7 +34,7 @@
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<span>手机号码</span>
<span>会员账号</span>
<span class="user-mobile"></span>
</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