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
5f3f15bd
Commit
5f3f15bd
authored
Jan 10, 2019
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
name
parent
e231b0cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
1 deletion
+94
-1
route.php
application/route.php
+5
-1
FollowUpTask.php
application/task/controller/FollowUpTask.php
+89
-0
No files found.
application/route.php
View file @
5f3f15bd
...
...
@@ -552,7 +552,11 @@ Route::group('task', [
'updateShopAgeLimit'
=>
[
'task/JobTask/updateShopAgeLimit'
,
[
'method'
=>
'get'
]],
//默认年限
'push'
=>
[
'task/PushMessageTask/push'
,
[
'method'
=>
'get'
]],
//推送和客户推送
'updateLandlordLimit'
=>
[
'task/JobTask/updateLandlordLimit'
,
[
'method'
=>
'get'
]]
//转换房东手机号
'updateLandlordLimit'
=>
[
'task/JobTask/updateLandlordLimit'
,
[
'method'
=>
'get'
]],
//转换房东手机号
'test'
=>
[
'task/FollowUpTask/test'
,
[
'method'
=>
'get'
]],
'isExistTable'
=>
[
'task/FollowUpTask/isExistTable'
,
[
'method'
=>
'get'
]],
]);
Route
::
group
(
'broker'
,
[
...
...
application/task/controller/FollowUpTask.php
0 → 100644
View file @
5f3f15bd
<?php
namespace
app\task\controller
;
use
app\extra\RedisExt
;
use
app\model\UPhoneFollowUpTemporary
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2019/1/10
* Time : 2:20 PM
* Intro:
*/
class
FollowUpTask
{
private
$redis_
;
private
$table
=
'u_phone_follow_up_'
;
private
$phoneFollowUpModel
;
public
function
__construct
()
{
$this
->
redis_
=
RedisExt
::
getRedis
();
}
public
function
test
()
{
$this
->
isExistTable
(
"2019-01-10"
,
10006
);
}
public
function
isExistTable
(
$time
,
$siteId
)
{
//todo 1.判断表是否存在,不存在则创建,
$date
=
date
(
"Y-m-d"
,
time
());
//时间是今天
if
(
$time
>=
$date
&&
$time
<=
$date
.
" 23:59:59"
)
{
$phoneFollowUpModel
=
new
UPhoneFollowUpTemporary
(
$siteId
);
$table_name
=
$this
->
table
.
$siteId
.
"_"
.
$date
;
//存在表
if
(
$this
->
redis_
->
get
(
$table_name
)
>
0
)
{
return
true
;
}
$isTable
=
$phoneFollowUpModel
->
query
(
'SHOW TABLES LIKE "'
.
$table_name
.
'"'
);
if
(
$isTable
)
{
$this
->
redis_
->
set
(
$table_name
,
1
,
24
*
3600
);
return
true
;
//存在表
}
else
{
//创建表
return
$this
->
createTemp
(
$phoneFollowUpModel
,
$table_name
);
}
}
}
public
function
createTemp
(
$db
,
$tableName
)
{
if
(
!
$tableName
)
{
return
false
;
}
$sql
=
"CREATE TABLE `"
.
$tableName
.
"` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '电话跟进表',
`content` varchar(255) DEFAULT '' COMMENT '跟进内容',
`labels_id` int(10) DEFAULT '0' COMMENT 'u_labels表主键',
`user_id` int(10) unsigned DEFAULT '0' COMMENT 'u_users ID用户表id',
`agent_id` int(10) unsigned DEFAULT '0' COMMENT 'agent表id',
`province` varchar(60) DEFAULT '' COMMENT '省份',
`city` varchar(60) DEFAULT '' COMMENT '城市',
`disc` varchar(60) DEFAULT '' COMMENT '区域',
`type` int(10) unsigned DEFAULT '0' COMMENT '0 电话跟进 1普通跟进 2不知道是什么,3打电话未跟进',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_status` tinyint(2) DEFAULT '0' COMMENT '客户状态(0:求租;1:已租;-1:无效)',
PRIMARY KEY (`id`),
KEY `idx_agent_id` (`agent_id`),
KEY `idx_user_id` (`user_id`),
KEY `idx_create_time` (`create_time`),
KEY `idx_city` (`city`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8"
;
if
(
false
!==
$db
->
execute
(
$sql
)){
return
true
;
}
else
{
return
false
;
}
}
}
\ 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