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
7d8e7c47
Commit
7d8e7c47
authored
Jan 10, 2019
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
0cb2bb2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
+34
-4
UPhoneFollowUpTemporary.php
application/model/UPhoneFollowUpTemporary.php
+34
-4
No files found.
application/model/UPhoneFollowUpTemporary.php
View file @
7d8e7c47
...
@@ -20,21 +20,30 @@ class UPhoneFollowUpTemporary extends BaseModel
...
@@ -20,21 +20,30 @@ class UPhoneFollowUpTemporary extends BaseModel
function
__construct
(
$site_id
)
function
__construct
(
$site_id
)
{
{
$date
=
date
(
"Y-m-d"
,
time
());
$date
=
date
(
"Y-m-d"
,
time
());
$t_follow_up_task
=
new
FollowUpTask
();
if
(
!
$t_follow_up_task
->
isExistTable
(
$date
,
$site_id
)){
return
false
;
}
$this
->
follow_up
=
Db
(
$this
->
table
.
"_"
.
$site_id
.
"_"
.
$date
);
$this
->
follow_up
=
Db
(
$this
->
table
.
"_"
.
$site_id
.
"_"
.
$date
);
$this
->
siteId
=
$site_id
;
$this
->
siteId
=
$site_id
;
$this
->
table_name_string
=
'`'
.
$this
->
table
.
"_"
.
$site_id
.
"_"
.
$date
.
'`'
;
$this
->
table_name_string
=
'`'
.
$this
->
table
.
"_"
.
$site_id
.
"_"
.
$date
.
'`'
;
}
}
public
function
createTable
(){
$date
=
date
(
"Y-m-d"
,
time
());
$t_follow_up_task
=
new
FollowUpTask
();
if
(
!
$t_follow_up_task
->
isExistTable
(
$date
,
$this
->
siteId
)){
return
false
;
}
return
true
;
}
/**
/**
* 新增电话跟进-插入数据
* 新增电话跟进-插入数据
* @param $params
* @param $params
* @return int|string
* @return int|string
*/
*/
public
function
savePhoneFollow
(
$params
)
{
public
function
savePhoneFollow
(
$params
)
{
if
(
!
$this
->
createTable
()){
return
null
;
}
$arr
=
[];
$arr
=
[];
if
(
isset
(
$params
[
"content"
]))
{
if
(
isset
(
$params
[
"content"
]))
{
$arr
[
"content"
]
=
$params
[
"content"
];
$arr
[
"content"
]
=
$params
[
"content"
];
...
@@ -92,6 +101,9 @@ class UPhoneFollowUpTemporary extends BaseModel
...
@@ -92,6 +101,9 @@ class UPhoneFollowUpTemporary extends BaseModel
}
}
public
function
getFollowList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
public
function
getFollowList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
if
(
!
$this
->
createTable
()){
return
null
;
}
return
$this
->
follow_up
->
field
(
$field
)
return
$this
->
follow_up
->
field
(
$field
)
->
where
(
$params
)
->
where
(
$params
)
->
order
(
$order_
)
->
order
(
$order_
)
...
@@ -110,6 +122,9 @@ class UPhoneFollowUpTemporary extends BaseModel
...
@@ -110,6 +122,9 @@ class UPhoneFollowUpTemporary extends BaseModel
* @return int|string
* @return int|string
*/
*/
public
function
insertDefaultFollow
(
$agent_id
,
$user_id
,
$content
,
$type
)
{
public
function
insertDefaultFollow
(
$agent_id
,
$user_id
,
$content
,
$type
)
{
if
(
!
$this
->
createTable
()){
return
null
;
}
$data
[
'agent_id'
]
=
$agent_id
;
$data
[
'agent_id'
]
=
$agent_id
;
$data
[
'user_id'
]
=
$user_id
;
$data
[
'user_id'
]
=
$user_id
;
$data
[
'content'
]
=
$content
;
$data
[
'content'
]
=
$content
;
...
@@ -125,6 +140,9 @@ class UPhoneFollowUpTemporary extends BaseModel
...
@@ -125,6 +140,9 @@ class UPhoneFollowUpTemporary extends BaseModel
*/
*/
public
function
getFollowTotal
(
$params
)
public
function
getFollowTotal
(
$params
)
{
{
if
(
!
$this
->
createTable
()){
return
null
;
}
return
$this
->
follow_up
->
where
(
$params
)
return
$this
->
follow_up
->
where
(
$params
)
->
count
();
->
count
();
}
}
...
@@ -135,6 +153,9 @@ class UPhoneFollowUpTemporary extends BaseModel
...
@@ -135,6 +153,9 @@ class UPhoneFollowUpTemporary extends BaseModel
*/
*/
public
function
getPhoneFollowData
(
$field
,
$params
,
$order
)
public
function
getPhoneFollowData
(
$field
,
$params
,
$order
)
{
{
if
(
!
$this
->
createTable
()){
return
null
;
}
$result
=
$this
->
follow_up
$result
=
$this
->
follow_up
->
field
(
$field
)
->
field
(
$field
)
->
order
(
$order
)
->
order
(
$order
)
...
@@ -146,6 +167,9 @@ class UPhoneFollowUpTemporary extends BaseModel
...
@@ -146,6 +167,9 @@ class UPhoneFollowUpTemporary extends BaseModel
}
}
public
function
getFollowListV2
(
$site_id
,
$pageNo
=
1
,
$pageSize
=
15
,
$where
,
$filed
=
'`id`, `user_id`, `create_time`, `content`, `user_status`, `labels_id`, `agent_id`'
)
{
public
function
getFollowListV2
(
$site_id
,
$pageNo
=
1
,
$pageSize
=
15
,
$where
,
$filed
=
'`id`, `user_id`, `create_time`, `content`, `user_status`, `labels_id`, `agent_id`'
)
{
if
(
!
$this
->
createTable
()){
return
null
;
}
$start_index
=
(
$pageNo
-
1
)
*
$pageSize
;
$start_index
=
(
$pageNo
-
1
)
*
$pageSize
;
$sql
=
"SELECT * FROM
$sql
=
"SELECT * FROM
((SELECT
((SELECT
...
@@ -167,6 +191,9 @@ class UPhoneFollowUpTemporary extends BaseModel
...
@@ -167,6 +191,9 @@ class UPhoneFollowUpTemporary extends BaseModel
}
}
public
function
getFollowListV3
(
$site_id
,
$pageNo
=
1
,
$pageSize
=
15
,
$where
,
$filed
=
'`id`, `user_id`, `create_time`, `content`, `user_status`, `labels_id`, `agent_id`'
)
{
public
function
getFollowListV3
(
$site_id
,
$pageNo
=
1
,
$pageSize
=
15
,
$where
,
$filed
=
'`id`, `user_id`, `create_time`, `content`, `user_status`, `labels_id`, `agent_id`'
)
{
if
(
!
$this
->
createTable
()){
return
null
;
}
$sql
=
Db
::
table
(
'u_phone_follow_up_'
.
$site_id
)
->
field
(
$filed
)
->
where
(
$where
)
->
buildSql
();
$sql
=
Db
::
table
(
'u_phone_follow_up_'
.
$site_id
)
->
field
(
$filed
)
->
where
(
$where
)
->
buildSql
();
$sql_string
=
$this
->
table
(
$this
->
table_name_string
)
->
field
(
$filed
)
->
where
(
$where
)
->
union
([
$sql
],
true
)
->
buildSql
();
$sql_string
=
$this
->
table
(
$this
->
table_name_string
)
->
field
(
$filed
)
->
where
(
$where
)
->
union
([
$sql
],
true
)
->
buildSql
();
$data
=
Db
::
table
(
$sql_string
.
' a'
)
$data
=
Db
::
table
(
$sql_string
.
' a'
)
...
@@ -179,6 +206,9 @@ class UPhoneFollowUpTemporary extends BaseModel
...
@@ -179,6 +206,9 @@ class UPhoneFollowUpTemporary extends BaseModel
}
}
public
function
getUserFollowKey
(
$field
,
$where
,
$order
=
'id asc'
)
{
public
function
getUserFollowKey
(
$field
,
$where
,
$order
=
'id asc'
)
{
if
(
!
$this
->
createTable
()){
return
null
;
}
return
$this
->
UPhoneFollowUp
->
where
(
$where
)
return
$this
->
UPhoneFollowUp
->
where
(
$where
)
->
order
(
$order
)
->
order
(
$order
)
->
value
(
$field
);
->
value
(
$field
);
...
...
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