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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 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
...
@@ -90,16 +90,24 @@ 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'
);
$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
)){
$user
=
$UserMainModel
->
where
(
'user_id'
,
$user_id
)
->
select
(
'user_id'
,
'email'
,
'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
))
{
if
(
!
empty
(
$user
))
{
$perm
=
new
PermController
;
$perm
=
new
PermController
;
...
...
public/js/add_order.js
View file @
93f7880f
...
@@ -31,8 +31,9 @@
...
@@ -31,8 +31,9 @@
var
loading
=
this
;
var
loading
=
this
;
// 获取用户信息
// 获取用户信息
$
(
'.get-user'
).
click
(
function
(){
function
get_user
(){
var
mobile
=
$
(
this
).
siblings
(
'.search-user'
).
val
();
// var mobile = $(this).siblings('.search-user').val();
var
mobile
=
getUrlParam
(
'user_id'
);
if
(
!
mobile
)
return
false
;
if
(
!
mobile
)
return
false
;
...
@@ -46,7 +47,7 @@
...
@@ -46,7 +47,7 @@
$
.
ajax
({
$
.
ajax
({
url
:
'/ajax/getUserInfo'
,
url
:
'/ajax/getUserInfo'
,
type
:
'post'
,
type
:
'post'
,
data
:
{
mobile
:
mobile
.
trim
(),
goods_type
:
goods_type
},
data
:
{
user_id
:
mobile
.
trim
(),
goods_type
:
goods_type
},
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
resp
)
{
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
if
(
resp
.
errcode
==
0
)
{
...
@@ -99,7 +100,9 @@
...
@@ -99,7 +100,9 @@
layer
.
msg
(
resp
.
errmsg
)
layer
.
msg
(
resp
.
errmsg
)
},
},
})
})
})
}
get_user
();
// 选择收货地址
// 选择收货地址
$
(
'.user-info'
).
delegate
(
'#address'
,
'change'
,
function
()
{
$
(
'.user-info'
).
delegate
(
'#address'
,
'change'
,
function
()
{
...
@@ -970,3 +973,10 @@
...
@@ -970,3 +973,10 @@
}
}
});
});
})(
jQuery
)
})(
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 @@
...
@@ -5,7 +5,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"
hidden
>
<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>
<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