Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
b52e4a4d
Commit
b52e4a4d
authored
Apr 08, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户列表修改
parent
c825c3ac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
53 deletions
+87
-53
Member.php
application/index/controller/Member.php
+44
-20
users_list.html
application/index/view/member/users_list.html
+8
-5
Users.php
application/model/Users.php
+29
-26
user.js
public/resource/js/user.js
+6
-2
No files found.
application/index/controller/Member.php
View file @
b52e4a4d
...
@@ -45,44 +45,68 @@ class Member extends Basic{
...
@@ -45,44 +45,68 @@ class Member extends Basic{
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
// $where['status'] = 0;
$where
=
''
;
$type
=
0
;
if
(
!
empty
(
$params
[
'name'
]))
{
if
(
!
empty
(
$params
[
'activate'
])
&&
$params
[
'activate'
]
!=
-
1
)
{
$where
[
'a.user_nick'
]
=
[
'like'
,
$params
[
'name'
]
.
'%'
];
if
(
$params
[
'activate'
]
==
1
)
{
$where
.=
' a.status = 0'
;
}
else
{
$where
.=
' a.status = -1'
;
}
}
else
{
$where
=
' (a.status = 0 or a.status = -1)'
;
}
}
if
(
!
empty
(
$params
[
'phone'
]))
{
if
(
!
empty
(
$params
[
'phone'
]))
{
$where
[
'user_phone'
]
=
[
'like'
,
$params
[
'phone'
]
.
'%'
];
$where
.=
' AND concat(a.user_phone,a.user_nick) like "%'
.
$this
->
params
[
'phone'
]
.
'%"'
;
}
elseif
(
!
empty
(
$params
[
'invite_phone'
]))
{
$where
.=
' AND referrer_source = 10'
;
$where
.=
' AND referrer_id = (SELECT ID FROM u_users where user_phone LIKE "%'
.
$params
[
'invite_phone'
]
.
'%" LIMIT 1)'
;
$type
=
1
;
}
}
if
(
!
empty
(
$params
[
'invite'
]))
{
if
(
!
empty
(
$params
[
'start_date'
])
&&
empty
(
$params
[
'end_date'
]))
{
$where
[
'user_phone'
]
=
[
'like'
,
$params
[
'invite'
]
.
'%'
];
$where
.=
' AND a.create_time > "'
.
$params
[
'start_date'
]
.
' 00:00:00"'
;
$where
[
'invite'
]
=
1
;
}
}
if
(
!
empty
(
$params
[
'
id
'
]))
{
if
(
!
empty
(
$params
[
'
end_date'
])
&&
empty
(
$params
[
'start_date
'
]))
{
$where
[
'a.id'
]
=
$params
[
'id'
]
;
$where
.=
' AND a.create_time < "'
.
$params
[
'end_date'
]
.
' 23:59:59"'
;
}
}
if
(
!
empty
(
$params
[
'activate'
])
&&
$params
[
'activate'
]
!=
-
1
)
{
if
(
!
empty
(
$params
[
'start_date'
])
&&
!
empty
(
$params
[
'end_date'
]))
{
if
(
$params
[
'activate'
]
==
1
)
{
$where
.=
' AND a.create_time > "'
.
$params
[
'start_date'
]
.
' 00:00:00'
.
'" and a.create_time < "'
.
$params
[
'end_date'
]
.
' 23:59:59"'
;
$where
[
'a.status'
]
=
0
;
}
}
else
{
$where
[
'a.status'
]
=
-
1
;
if
(
!
empty
(
$params
[
'follow_start'
])
&&
empty
(
$params
[
'follow_end'
]))
{
}
$where
.=
' AND b.create_time > "'
.
$params
[
'follow_start'
]
.
' 00:00:00"'
;
$type
=
2
;
}
if
(
!
empty
(
$params
[
'follow_end'
])
&&
empty
(
$params
[
'follow_start'
]))
{
$where
.=
' AND b.create_time < "'
.
$params
[
'follow_end'
]
.
' 23:59:59"'
;
$type
=
2
;
}
if
(
!
empty
(
$params
[
'follow_start'
])
&&
!
empty
(
$params
[
'follow_end'
]))
{
$where
.=
' AND b.create_time > "'
.
$params
[
'follow_start'
]
.
' 00:00:00'
.
'" and b.create_time < "'
.
$params
[
'follow_end'
]
.
' 23:59:59"'
;
$type
=
2
;
}
if
(
!
empty
(
$params
[
'id'
]))
{
$where
.=
' AND a.id = '
.
$params
[
'id'
];
}
}
if
(
!
empty
(
$params
[
'login_status'
])
&&
$params
[
'login_status'
]
!=
-
1
)
{
if
(
!
empty
(
$params
[
'login_status'
])
&&
$params
[
'login_status'
]
!=
-
1
)
{
if
(
$params
[
'login_status'
]
==
1
)
{
if
(
$params
[
'login_status'
]
==
1
)
{
$where
[
'a.last_login_ip'
]
=
[
'not null'
]
;
$where
.=
' AND a.last_login_ip is not null'
;
}
else
{
}
else
{
$where
[
'a.last_login_ip'
]
=
[
'null'
]
;
$where
.=
' AND a.last_login_ip is null'
;
}
}
}
}
$fields
=
'a.id,a.user_nick,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.registration_time,a.user_name,a.last_login_ip,a.status'
;
$fields
=
'a.id,a.user_nick,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.registration_time,a.user_name,a.last_login_ip,a.status'
;
$data
[
'list'
]
=
$this
->
user
->
getUserAgent
(
$pageNo
,
$pageSize
,
'a.id DESC'
,
$fields
,
$where
);
$data
[
'list'
]
=
$this
->
user
->
getUserAgent
(
$pageNo
,
$pageSize
,
'a.id DESC'
,
$fields
,
$where
,
$type
);
$data
[
'total'
]
=
$this
->
user
->
getUserAgentTotal
(
$where
);
$data
[
'total'
]
=
$this
->
user
->
getUserAgentTotal
(
$where
,
$type
);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
);
}
}
...
...
application/index/view/member/users_list.html
View file @
b52e4a4d
...
@@ -26,6 +26,9 @@
...
@@ -26,6 +26,9 @@
list-style
:
none
;
list-style
:
none
;
line-height
:
30px
;
line-height
:
30px
;
}
}
.input
{
width
:
17%
!important
;
}
</style>
</style>
<!--导航star-->
<!--导航star-->
...
@@ -61,14 +64,14 @@
...
@@ -61,14 +64,14 @@
<span
class=
"fore-span ld-Marheight"
>
上传时间:
</span>
<span
class=
"fore-span ld-Marheight"
>
上传时间:
</span>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"start_date"
name=
"start_date"
type=
"date"
>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"start_date"
name=
"start_date"
type=
"date"
>
<span
class=
"fore-span ld-Marheight"
>
-
</span>
<span
class=
"fore-span ld-Marheight"
>
-
</span>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"end_date"
name=
"end_date"
type=
"date"
>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"end_date"
name=
"end_date"
type=
"date"
>
<span
class=
"fore-span ld-Marheight"
>
最后跟进时间:
</span>
<span
class=
"fore-span ld-Marheight"
>
最后跟进时间:
</span>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"
start_date1"
name=
"start_date
"
type=
"date"
>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"
follow_start"
name=
"follow_start
"
type=
"date"
>
<span
class=
"fore-span ld-Marheight"
>
-
</span>
<span
class=
"fore-span ld-Marheight"
>
-
</span>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"
end_date1"
name=
"end_date
"
type=
"date"
>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"
follow_end"
name=
"follow_end
"
type=
"date"
>
<div
class=
"row"
></div>
<div
class=
"row"
></div>
<input
class=
"form-control btn2 margin-top-ld"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"company_name"
name=
"name"
placeholder=
"姓名
"
type=
"text"
value=
""
>
<input
class=
"form-control btn2 margin-top-ld"
data-rule-phoneus=
"false"
data-rule-required=
"false"
name=
"phone"
placeholder=
"客户姓名或客户手机号
"
type=
"text"
value=
""
>
<input
class=
"form-control btn2 margin-top-ld
"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"mobile"
name=
"phone"
placeholder=
"手机号
"
type=
"text"
value=
""
>
<input
class=
"form-control btn2 margin-top-ld
input"
data-rule-phoneus=
"false"
data-rule-required=
"false"
name=
"invite_phone"
placeholder=
"邀请人手机号(普通用户)
"
type=
"text"
value=
""
>
<select
class=
"form-control btn2 margin-top-ld"
name=
"login_status"
>
<select
class=
"form-control btn2 margin-top-ld"
name=
"login_status"
>
<option
value=
"-1"
>
是否登录过
</option>
<option
value=
"-1"
>
是否登录过
</option>
...
...
application/model/Users.php
View file @
b52e4a4d
...
@@ -48,7 +48,9 @@ class Users extends Model
...
@@ -48,7 +48,9 @@ class Users extends Model
->
where
(
$param
)
->
where
(
$param
)
->
select
();
->
select
();
return
$data
;
return
$data
;
}
/**
}
/**
* 查询用户和经纪人
* 查询用户和经纪人
*
*
* @param int $pageNo
* @param int $pageNo
...
@@ -56,23 +58,29 @@ class Users extends Model
...
@@ -56,23 +58,29 @@ class Users extends Model
* @param string $order_
* @param string $order_
* @param string $fields
* @param string $fields
* @param string $params
* @param string $params
* @return mixed
* @param int $type
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
getUserAgent
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$fields
=
'*'
,
$params
=
''
,
$type
=
0
)
{
public
function
getUserAgent
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$fields
=
'*'
,
$params
=
''
)
{
$data
=
[];
$data
=
array
();
if
(
$type
==
1
)
{
if
(
!
empty
(
$params
[
'invite'
]))
{
unset
(
$params
[
'invite'
]);
$id
=
$this
->
field
(
'id'
)
->
where
(
'user_phone'
,
'LIKE'
,
$params
[
'user_phone'
][
'1'
]
.
'%'
)
->
find
();
unset
(
$params
[
'user_phone'
]);
$result
=
$this
->
field
(
$fields
)
$result
=
$this
->
field
(
$fields
)
->
alias
(
'a'
)
->
alias
(
'a'
)
->
where
(
$params
)
->
where
(
$params
)
->
where
(
'referrer_id'
,
'='
,
$id
->
id
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
elseif
(
$type
==
2
)
{
$result
=
$this
->
field
(
$fields
)
->
alias
(
'a'
)
->
join
(
'u_phone_follow_up b'
,
'a.id = b.user_id'
,
'left'
)
->
where
(
$params
)
->
order
(
$order_
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
page
(
$pageNo
)
...
@@ -86,8 +94,6 @@ class Users extends Model
...
@@ -86,8 +94,6 @@ class Users extends Model
->
select
();
->
select
();
}
}
$agents
=
new
Agents
();
foreach
(
$result
as
$k
=>
$v
)
{
foreach
(
$result
as
$k
=>
$v
)
{
$data
[
$k
]
=
$v
->
getData
();
$data
[
$k
]
=
$v
->
getData
();
...
@@ -97,37 +103,35 @@ class Users extends Model
...
@@ -97,37 +103,35 @@ class Users extends Model
$data
[
$k
][
'user_pic'
]
=
''
;
$data
[
$k
][
'user_pic'
]
=
''
;
}
}
//判断来源
$user_data
=
$this
->
field
(
'id,user_nick,user_phone'
)
->
where
(
'id'
,
$data
[
$k
][
'referrer_id'
])
->
find
();
if
(
$data
[
$k
][
'referrer_source'
]
==
10
)
{
$data
[
$k
][
'name'
]
=
$user_data
[
'user_nick'
];
$user_data
=
$this
->
field
(
'id,user_nick,user_phone'
)
->
where
(
'id'
,
$data
[
$k
][
'referrer_id'
])
->
find
();
$data
[
$k
][
'phone'
]
=
$user_data
[
'user_phone'
];
$data
[
$k
][
'realname'
]
=
$user_data
->
user_nick
;
$data
[
$k
][
'phone'
]
=
$user_data
->
user_phone
;
}
else
{
$agent_data
=
$agents
->
field
(
'realname,phone'
)
->
where
(
'id'
,
$data
[
$k
][
'referrer_id'
])
->
find
();
$data
[
$k
][
'realname'
]
=
isset
(
$agent_data
->
realname
)
?
$agent_data
->
realname
:
""
;
$data
[
$k
][
'phone'
]
=
isset
(
$agent_data
->
phone
)
?
$agent_data
->
phone
:
""
;
}
}
}
return
$data
;
return
$data
;
}
}
/**
/**
* 获取查询用户和经纪人总数
* 获取查询用户和经纪人总数
*
* @param $params
* @param $params
* @param int $type
* @return int|string
* @return int|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
getUserAgentTotal
(
$params
)
{
public
function
getUserAgentTotal
(
$params
,
$type
=
0
)
{
if
(
!
empty
(
$params
[
'invite'
]))
{
if
(
$type
==
1
)
{
unset
(
$params
[
'invite'
]);
$id
=
$this
->
field
(
'id'
)
->
where
(
'user_phone'
,
'LIKE'
,
$params
[
'user_phone'
][
'1'
]
.
'%'
)
->
find
();
$id
=
$this
->
field
(
'id'
)
->
where
(
'user_phone'
,
'LIKE'
,
$params
[
'user_phone'
][
'1'
]
.
'%'
)
->
find
();
unset
(
$params
[
'user_phone'
]);
$result
=
$this
->
alias
(
'a'
)
$result
=
$this
->
alias
(
'a'
)
->
where
(
$params
)
->
where
(
$params
)
->
where
(
'referrer_id'
,
'='
,
$id
->
id
)
->
where
(
'referrer_id'
,
'='
,
$id
->
id
)
->
count
();
->
count
();
}
elseif
(
$type
==
2
)
{
$result
=
$this
->
alias
(
'a'
)
->
join
(
'u_phone_follow_up b'
,
'a.id = b.user_id'
,
'left'
)
->
where
(
$params
)
->
count
();
}
else
{
}
else
{
$result
=
$this
->
alias
(
'a'
)
$result
=
$this
->
alias
(
'a'
)
->
where
(
$params
)
->
where
(
$params
)
...
@@ -136,7 +140,6 @@ class Users extends Model
...
@@ -136,7 +140,6 @@ class Users extends Model
return
$result
;
return
$result
;
}
}
/**
/**
* @param $params
* @param $params
* @return int|string
* @return int|string
...
...
public/resource/js/user.js
View file @
b52e4a4d
...
@@ -217,14 +217,18 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
...
@@ -217,14 +217,18 @@ define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', '
getList
:
function
(
pageNo
)
{
getList
:
function
(
pageNo
)
{
user
.
pageNo
=
pageNo
;
user
.
pageNo
=
pageNo
;
var
params
=
{};
var
params
=
{};
params
.
name
=
$
(
"input[name='name']"
).
val
();
params
.
phone
=
$
(
"input[name='phone']"
).
val
();
params
.
phone
=
$
(
"input[name='phone']"
).
val
();
params
.
invite_phone
=
$
(
"input[name='invite_phone']"
).
val
();
params
.
invite
=
$
(
"input[name='invite']"
).
val
();
params
.
invite
=
$
(
"input[name='invite']"
).
val
();
params
.
start_date
=
$
(
"#start_date"
).
val
();
params
.
end_date
=
$
(
"#end_date"
).
val
();
params
.
follow_start
=
$
(
"#follow_start"
).
val
();
params
.
follow_end
=
$
(
"#follow_end"
).
val
();
params
.
login_status
=
$
(
"select[name=login_status]"
).
val
();
params
.
login_status
=
$
(
"select[name=login_status]"
).
val
();
params
.
activate
=
$
(
"select[name=activate]"
).
val
();
params
.
activate
=
$
(
"select[name=activate]"
).
val
();
params
.
pageNo
=
user
.
pageNo
;
params
.
pageNo
=
user
.
pageNo
;
params
.
pageSize
=
user
.
pageSize
;
params
.
pageSize
=
user
.
pageSize
;
// console.log(params);return ;
$
.
ajax
({
$
.
ajax
({
url
:
'/index/usersList'
,
url
:
'/index/usersList'
,
type
:
'GET'
,
type
:
'GET'
,
...
...
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