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
c8dc6f9e
Commit
c8dc6f9e
authored
Jan 10, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
model
parent
3fb4a335
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
28 deletions
+38
-28
Remark.php
application/index/controller/Remark.php
+3
-2
PhoneFollowUpService.php
application/index/service/PhoneFollowUpService.php
+12
-26
UPhoneFollowUpTemporary.php
application/model/UPhoneFollowUpTemporary.php
+23
-0
No files found.
application/index/controller/Remark.php
View file @
c8dc6f9e
...
...
@@ -226,8 +226,9 @@ class Remark extends Basic
$code
=
101
;
$list
=
[];
}
$data
[
'list'
]
=
$list
;
$data
[
'total'
]
=
40000
;
$data
[
'data'
][
'list'
]
=
$list
;
$data
[
'data'
][
'total'
]
=
40000
;
return
$this
->
response
(
$code
,
$msg
,
$data
);
}
...
...
application/index/service/PhoneFollowUpService.php
View file @
c8dc6f9e
...
...
@@ -59,33 +59,30 @@ class PhoneFollowUpService
}
return
[
'code'
=>
'101'
,
'data'
=>
$msg
];
}
$where
=
' 1=1 '
;
if
(
empty
(
$start_time
)
||
empty
(
$end_time
))
{
return
[
'code'
=>
'101'
,
'data'
=>
'时间不能为空'
];
}
else
{
$where
[
'create_time'
]
=
[
'between'
,
[
$start_time
.
' 00:00:00'
,
$end_time
.
' 23:59:59'
]]
;
$where
.=
' AND create_time BETWEEN "'
.
$start_time
.
' 00:00:00" AND "'
.
$end_time
.
' 23:59:59"'
;
}
$data
=
[];
if
(
isset
(
$params
[
'user_id'
]))
{
$where
[
'user_id'
]
=
$params
[
'user_id'
]
;
$where
.=
" AND user_id=
{
$params
[
'user_id'
]
}
"
;
}
if
(
isset
(
$params
[
'agent_id'
]))
{
$where
[
'agent_id'
]
=
$params
[
'agent_id'
]
;
$where
.=
" AND agent_id =
{
$params
[
'agent_id'
]
}
"
;
}
if
(
!
empty
(
$params
[
'store_id'
]))
{
$agent_where
[
'store_id'
]
=
$params
[
'remark_store_id'
];
unset
(
$params
[
'store_id'
]);
}
if
(
!
empty
(
$params
[
'district_id'
]))
{
$agent_where
[
'district_id'
]
=
$params
[
'district_id'
];
unset
(
$params
[
'district_id'
]);
}
if
(
!
empty
(
$agent_where
))
{
$m_agent
=
new
AAgents
();
$agent_id
=
$m_agent
->
getAgentsByWhereColumn
(
$agent_where
,
'id'
);
...
...
@@ -93,27 +90,17 @@ class PhoneFollowUpService
if
(
empty
(
$agent_id
))
{
return
$data
;
}
else
{
$where
[
'agent_id'
]
=
[
'in'
,
$agent_id
]
;
$where
.=
" AND agent_id in {implode(',',
$agent_id
)}"
;
}
}
$date
=
time
();
$start_time
=
strtotime
(
$start_time
);
$end_time
=
strtotime
(
$end_time
);
$data
=
$this
->
phoneFollowUpTemporary
->
getFollowList
(
$page_no
,
$page_size
,
$order_
=
'id desc'
,
$field
,
$where
);
$num
=
count
(
$data
);
if
(
empty
(
$data
)
||
$num
<
$page_size
)
{
$count
=
(
int
)
$page_size
-
(
int
)
$data
;
if
(
$count
>
0
)
{
$new_count
=
$this
->
phoneFollowUpTemporary
->
getFollowTotal
(
$where
);
// $count = $new_count
$old_data
=
$this
->
phoneFollowUp
->
getFollowList
(
1
,
$count
,
$order_
=
'id desc'
,
$field
,
$where
);
//拼接数据
foreach
(
$old_data
as
$v
)
{
$data
[
$count
]
=
$v
;
$count
++
;
}
}
else
{
$data
=
$this
->
phoneFollowUp
->
getFollowList
(
$page_no
,
$page_size
,
$order_
=
'id desc'
,
$field
,
$where
);
}
if
(
$start_time
==
$end_time
&&
$start_time
<
$date
)
{
$data
=
$this
->
phoneFollowUpTemporary
->
getFollowListV2
(
$page_no
,
$page_size
,
$where
,
$field
);
}
else
{
$data
=
$this
->
phoneFollowUp
->
getFollowList
(
$page_no
,
$page_size
,
$order_
=
'id desc'
,
$field
,
$where
);
}
$s_user_service
=
new
UserService
();
...
...
@@ -128,7 +115,6 @@ class PhoneFollowUpService
$data
[
$k
][
'is_outpace_call_num'
]
=
$s_user_Log_service
->
userDetailIsOutpaceCallNum
(
$v
[
'user_id'
],
$user_res
[
'user_phone'
],
$agent_id
);
}
return
[
'code'
=>
'200'
,
'data'
=>
$data
];
}
...
...
application/model/UPhoneFollowUpTemporary.php
View file @
c8dc6f9e
...
...
@@ -15,12 +15,14 @@ class UPhoneFollowUpTemporary extends BaseModel
protected
$UPhoneFollowUp
;
protected
$siteId
;
protected
$table_name_string
;
function
__construct
(
$site_id
)
{
$date
=
date
(
"Y-m-d"
,
time
());
$this
->
UPhoneFollowUp
=
Db
(
$this
->
table
.
"_"
.
$site_id
.
"_"
.
$date
);
$this
->
siteId
=
$site_id
;
$this
->
table_name_string
=
'`'
.
$this
->
table
.
"_"
.
$site_id
.
"_"
.
$date
.
'`'
;
}
/**
...
...
@@ -139,4 +141,25 @@ class UPhoneFollowUpTemporary extends BaseModel
//dump($this->getLastSql());
return
$result
;
}
public
function
getFollowListV2
(
$pageNo
=
1
,
$pageSize
=
15
,
$where
,
$filed
=
'`id`, `user_id`, `create_time`, `content`, `user_status`, `labels_id`, `agent_id`'
)
{
$start_index
=
(
$pageNo
-
1
)
*
$pageSize
;
$sql
=
"SELECT * FROM
((SELECT
$filed
FROM
$this->table_name_string
WHERE
$where
)
UNION
(SELECT
$filed
FROM
u_phone_follow_up_10001
WHERE
$where
) ) as aa ORDER BY `id` DESC limit
$start_index
,
$pageSize
"
;
return
$this
->
UPhoneFollowUp
->
query
(
$sql
);
}
}
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