Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
93f7880f
authored
Oct 24, 2019
by
allen
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
crm转移到订单系统
parent
7aec11d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
13 deletions
app/Http/Controllers/AddOrderController.php
public/js/add_order.js
resources/views/addOnline/content.blade.php
app/Http/Controllers/AddOrderController.php
View file @
93f7880f
...
...
@@ -90,16 +90,24 @@ Class AddOrderController extends Controller
{
if
(
$request
->
isMethod
(
'post'
))
{
$mobile
=
$request
->
input
(
'mobile'
);
$user_id
=
$request
->
input
(
'user_id'
);
$goods_type
=
$request
->
input
(
'goods_type'
);
// 类型,1-联营,2-自营
$operator_id
=
$request
->
user
->
userId
;
$UserMainModel
=
new
UserMainModel
;
if
(
preg_match
(
'/@/'
,
$mobile
))
{
$user
=
$UserMainModel
->
where
(
'email'
,
$mobile
)
->
select
(
'user_id'
,
'email'
,
'is_test'
)
->
orderBy
(
'create_time'
,
'desc'
)
->
first
();
}
else
{
$user
=
$UserMainModel
->
where
(
'mobile'
,
$mobile
)
->
select
(
'user_id'
,
'mobile'
,
'is_test'
)
->
orderBy
(
'create_time'
,
'desc'
)
->
first
();
}
if
(
!
empty
(
$user_id
)){
$user
=
$UserMainModel
->
where
(
'user_id'
,
$user_id
)
->
select
(
'user_id'
,
'email'
,
'is_test'
)
->
orderBy
(
'create_time'
,
'desc'
)
->
first
();
}
else
{
if
(
preg_match
(
'/@/'
,
$mobile
))
{
$user
=
$UserMainModel
->
where
(
'email'
,
$mobile
)
->
select
(
'user_id'
,
'email'
,
'is_test'
)
->
orderBy
(
'create_time'
,
'desc'
)
->
first
();
}
else
{
$user
=
$UserMainModel
->
where
(
'mobile'
,
$mobile
)
->
select
(
'user_id'
,
'mobile'
,
'is_test'
)
->
orderBy
(
'create_time'
,
'desc'
)
->
first
();
}
}
if
(
!
empty
(
$user
))
{
$perm
=
new
PermController
;
...
...
public/js/add_order.js
View file @
93f7880f
...
...
@@ -31,9 +31,10 @@
var
loading
=
this
;
// 获取用户信息
$
(
'.get-user'
).
click
(
function
(){
var
mobile
=
$
(
this
).
siblings
(
'.search-user'
).
val
();
function
get_user
(){
// var mobile = $(this).siblings('.search-user').val();
var
mobile
=
getUrlParam
(
'user_id'
);
if
(
!
mobile
)
return
false
;
// 自营其他订单类型---仓库损耗
...
...
@@ -46,7 +47,7 @@
$
.
ajax
({
url
:
'/ajax/getUserInfo'
,
type
:
'post'
,
data
:
{
mobile
:
mobile
.
trim
(),
goods_type
:
goods_type
},
data
:
{
user_id
:
mobile
.
trim
(),
goods_type
:
goods_type
},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
...
...
@@ -99,7 +100,9 @@
layer
.
msg
(
resp
.
errmsg
)
},
})
})
}
get_user
();
// 选择收货地址
$
(
'.user-info'
).
delegate
(
'#address'
,
'change'
,
function
()
{
...
...
@@ -969,4 +972,11 @@
},
}
});
})(
jQuery
)
\ No newline at end of file
})(
jQuery
)
//获取url中的参数
function
getUrlParam
(
name
)
{
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
//构造一个含有目标参数的正则表达式对象
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
//匹配目标参数
if
(
r
!=
null
)
return
unescape
(
r
[
2
]);
return
null
;
//返回参数值
}
\ No newline at end of file
resources/views/addOnline/content.blade.php
View file @
93f7880f
...
...
@@ -5,7 +5,7 @@
<div
class=
"ibox-content create-order"
>
<div
class=
"row"
style=
"margin-bottom: 30px;"
>
<div
class=
"col-sm-12"
>
<div
class=
"col-sm-12"
hidden
>
<input
type=
"text"
class=
"search-user"
name=
"user-mobile"
value=
""
placeholder=
"请输入会员账号"
>
<a
class=
"btn btn-info get-user"
>
获取用户信息
</a>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment