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
8ca730ce
Commit
8ca730ce
authored
Feb 27, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
冻结经纪人
parent
89a5d94c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
0 deletions
+67
-0
AAgents.php
application/model/AAgents.php
+13
-0
route.php
application/route.php
+2
-0
FrostAgentTask.php
application/task/controller/FrostAgentTask.php
+52
-0
No files found.
application/model/AAgents.php
View file @
8ca730ce
...
@@ -386,6 +386,19 @@ class AAgents extends BaseModel
...
@@ -386,6 +386,19 @@ class AAgents extends BaseModel
->
select
();
->
select
();
}
}
public
function
selectFollowUpNumByAgent
(
$field
=
"a.id"
,
$table
,
$params
,
$num
)
{
$where
[
"district_id"
]
=
array
(
'not in'
,
array
(
'13'
,
'14'
,
'15'
)
);
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
$table
.
" as b"
,
"a.id = b.agent_id"
,
"right"
)
->
where
(
$params
)
->
group
(
"b.agent_id"
)
->
having
(
"count >
$num
"
)
->
select
();
}
/**
/**
* @param string $field
* @param string $field
* @param $params
* @param $params
...
...
application/route.php
View file @
8ca730ce
...
@@ -578,6 +578,8 @@ Route::group('task', [
...
@@ -578,6 +578,8 @@ Route::group('task', [
'test'
=>
[
'task/FollowUpTask/test'
,
[
'method'
=>
'get'
]],
'test'
=>
[
'task/FollowUpTask/test'
,
[
'method'
=>
'get'
]],
'isExistTable'
=>
[
'task/FollowUpTask/isExistTable'
,
[
'method'
=>
'get'
]],
'isExistTable'
=>
[
'task/FollowUpTask/isExistTable'
,
[
'method'
=>
'get'
]],
'moveFollowUpList'
=>
[
'task/FollowUpTask/moveFollowUpList'
,
[
'method'
=>
'get'
]],
'moveFollowUpList'
=>
[
'task/FollowUpTask/moveFollowUpList'
,
[
'method'
=>
'get'
]],
'frostAgent'
=>
[
'task/FrostAgentTask/frostAgent'
,
[
'method'
=>
'get'
]],
]);
]);
Route
::
group
(
'broker'
,
[
Route
::
group
(
'broker'
,
[
...
...
application/task/controller/FrostAgentTask.php
0 → 100644
View file @
8ca730ce
<?php
namespace
app\task\controller
;
/**
* Created by PhpStorm.
* User: fuju
* Date: 2019/2/27
* Time: 16:05
*/
use
app\model\AAgents
;
use
app\model\ASite
;
class
FrostAgentTask
{
private
$agentsModel
;
private
$table
=
'u_phone_follow_up_'
;
private
$date
;
private
$siteModel
;
function
__construct
()
{
$this
->
agentsModel
=
new
AAgents
();
$this
->
date
=
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$this
->
siteModel
=
new
ASite
();
}
public
function
frostAgent
(){
//select count(1) as count,a.phone from a_agents a RIGHT JOIN u_phone_follow_up_10001 b on a.id = b.agent_id
//GROUP BY b.agent_id HAVING count >15 ;
$site_arr
=
$this
->
siteModel
->
getSite
(
"id,name,city,is_del"
,
[
"is_del"
=>
0
]);
if
(
count
(
$site_arr
)
<=
0
)
{
return
;
}
$field
=
"count(1) as count,a.id"
;
$params
[
"a.status"
]
=
0
;
$params
[
"a.level"
]
=
10
;
foreach
(
$site_arr
as
$item
)
{
$table_name
=
$this
->
table
.
$item
[
"id"
]
.
"_"
.
$this
->
date
;
$params
[
"a.site_id"
]
=
$item
[
"id"
];
$agent_arr
=
$this
->
agentsModel
->
selectFollowUpNumByAgent
(
$field
,
$table_name
,
$params
,
15
);
//execute_update
$this
->
execute_update
(
$agent_arr
);
}
}
private
function
execute_update
(
$agent_arr
){
dump
(
$agent_arr
);
}
}
\ No newline at end of file
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