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
16442262
Commit
16442262
authored
Jun 03, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
楼盘标签列表
parent
cd2ad586
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
355 additions
and
0 deletions
+355
-0
OfficeGLabel.php
application/index/controller/OfficeGLabel.php
+176
-0
OfficeLabel.php
application/index/controller/OfficeLabel.php
+176
-0
Basic.php
application/index/extend/Basic.php
+1
-0
route.php
application/route.php
+2
-0
No files found.
application/index/controller/OfficeGLabel.php
0 → 100644
View file @
16442262
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/2/6
* Time: 15:03
*/
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\model\FollowUp
;
use
app\model\GLabels
;
use
app\model\ULabels
;
use
app\model\UPhoneFollowUp
;
use
app\model\UPhoneFollowUpTemporary
;
use
think\Session
;
class
OfficeGLabel
extends
Basic
{
/**
* 添加标签
* @return \think\Response|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
index
(){
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
$labels
=
new
GLabels
();
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
params
[
'name'
])
{
$data
[
'name'
]
=
$this
->
params
[
'name'
];
$data
[
'operation_id'
]
=
Session
::
get
(
'userId'
);
$data
[
'type'
]
=
$this
->
params
[
'type'
];
if
(
$this
->
params
[
'id'
])
{
$result
[
'data'
]
=
$labels
->
save
(
$data
,
[
'id'
=>
$this
->
params
[
'id'
]]);
}
else
{
$result
[
'data'
]
=
$labels
->
save
(
$data
);
}
}
else
{
$result
[
'code'
]
=
101
;
$result
[
'msg'
]
=
'name is null'
;
}
$return
=
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
else
{
if
(
$this
->
params
[
'id'
])
{
$result
[
'data'
]
=
$labels
->
where
(
'id'
,
$this
->
params
[
'id'
])
->
find
();
$return
=
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
else
{
//标签页面
$return
=
view
(
'index'
);
}
}
return
$return
;
}
/**
* 楼盘标签
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getLabelsList
()
{
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$labels
=
new
GLabels
();
$field
=
'id,name,create_time'
;
$where
[
'type'
]
=
0
;
$result
[
'data'
][
'list'
]
=
$labels
->
getList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$result
[
'data'
][
'total'
]
=
$labels
->
getTotal
(
$where
);
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
//*****************************************************************************************用户标签
/**用户添加编辑
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
updateULabel
(){
$group_id
=
$this
->
request
->
param
(
'id'
);
$table
=
new
ULabels
();
if
(
$this
->
request
->
isPost
())
{
$data
=
input
(
'post.'
);
$data
[
'operation_id'
]
=
Session
::
get
(
"user_info.id"
);
//操作人id
if
(
$table
->
repetition
(
'name'
,
$data
[
'name'
])
&&
empty
(
$data
[
'id'
])){
return
$this
->
response
(
100
,
'url存在重复值'
);
}
//新增或者编辑数据
if
(
empty
(
$data
[
'id'
])){
$id
=
''
;
}
else
{
$id
=
$data
[
'id'
];
}
$data
[
'free'
]
=
$this
->
params
[
'free'
];
//新增或者编辑数据
if
(
$table
->
editData
(
$data
,
$id
))
{
return
$this
->
response
(
200
,
'成功'
);
}
else
{
return
$this
->
response
(
100
,
'无修改'
);
}
}
else
{
$where
=
"id =
{
$group_id
}
"
;
$info
=
$table
->
uleList
(
$where
);
return
$this
->
response
(
200
,
'成功'
,
$info
[
0
]);
}
}
/**
* 用户标签
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getULabelsList
()
{
if
(
$this
->
request
->
isAjax
())
{
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
//获取当前模块可操作按钮start********************************
$userRule
=
Session
::
get
(
'userRule'
);
// $result['data']['cz']=$userRule['cz'];
$result
[
'data'
][
'cz'
]
=
1
;
//获取当前模块可操作按钮end**********************************
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$labels
=
New
ULabels
;
$field
=
'id,name,create_time,free'
;
$where
[
'type'
]
=
1
;
$result
[
'data'
][
'list'
]
=
$labels
->
getList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$result
[
'data'
][
'total'
]
=
$labels
->
getTotal
(
$where
);
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
else
{
return
view
(
'u_label_index'
);
}
}
/**
* 获取用户上一次跟进状态
*
* @return \think\Response
*/
public
function
getUserLabel
()
{
if
(
empty
(
$this
->
params
[
'user_id'
]))
{
return
$this
->
response
(
101
,
'没有用户信息'
);
}
$follow_temp
=
new
UPhoneFollowUpTemporary
(
$this
->
siteId
);
$user_status
=
$follow_temp
->
getUserFollowKey
(
'user_status'
,
[
'user_id'
=>
$this
->
params
[
'user_id'
]],
'id DESC'
);
if
(
empty
(
$user_status
))
{
$follow
=
new
UPhoneFollowUp
(
$this
->
siteId
);
$user_status
=
$follow
->
getUserFollowKey
(
'user_status'
,
[
'user_id'
=>
$this
->
params
[
'user_id'
]],
'id DESC'
);
}
return
$this
->
response
(
200
,
''
,
$user_status
);
}
}
\ No newline at end of file
application/index/controller/OfficeLabel.php
0 → 100644
View file @
16442262
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/2/6
* Time: 15:03
*/
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\model\FollowUp
;
use
app\model\GLabels
;
use
app\model\ULabels
;
use
app\model\UPhoneFollowUp
;
use
app\model\UPhoneFollowUpTemporary
;
use
think\Session
;
class
OfficeLabel
extends
Basic
{
/**
* 添加标签
* @return \think\Response|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
index
(){
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
$labels
=
new
GLabels
();
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
params
[
'name'
])
{
$data
[
'name'
]
=
$this
->
params
[
'name'
];
$data
[
'operation_id'
]
=
Session
::
get
(
'userId'
);
$data
[
'type'
]
=
$this
->
params
[
'type'
];
if
(
$this
->
params
[
'id'
])
{
$result
[
'data'
]
=
$labels
->
save
(
$data
,
[
'id'
=>
$this
->
params
[
'id'
]]);
}
else
{
$result
[
'data'
]
=
$labels
->
save
(
$data
);
}
}
else
{
$result
[
'code'
]
=
101
;
$result
[
'msg'
]
=
'name is null'
;
}
$return
=
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
else
{
if
(
$this
->
params
[
'id'
])
{
$result
[
'data'
]
=
$labels
->
where
(
'id'
,
$this
->
params
[
'id'
])
->
find
();
$return
=
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
else
{
//标签页面
$return
=
view
(
'index'
);
}
}
return
$return
;
}
/**
* 楼盘标签
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getLabelsList
()
{
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$labels
=
new
GLabels
();
$field
=
'id,name,create_time'
;
$where
[
'type'
]
=
0
;
$result
[
'data'
][
'list'
]
=
$labels
->
getList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$result
[
'data'
][
'total'
]
=
$labels
->
getTotal
(
$where
);
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
//*****************************************************************************************用户标签
/**用户添加编辑
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
updateULabel
(){
$group_id
=
$this
->
request
->
param
(
'id'
);
$table
=
new
ULabels
();
if
(
$this
->
request
->
isPost
())
{
$data
=
input
(
'post.'
);
$data
[
'operation_id'
]
=
Session
::
get
(
"user_info.id"
);
//操作人id
if
(
$table
->
repetition
(
'name'
,
$data
[
'name'
])
&&
empty
(
$data
[
'id'
])){
return
$this
->
response
(
100
,
'url存在重复值'
);
}
//新增或者编辑数据
if
(
empty
(
$data
[
'id'
])){
$id
=
''
;
}
else
{
$id
=
$data
[
'id'
];
}
$data
[
'free'
]
=
$this
->
params
[
'free'
];
//新增或者编辑数据
if
(
$table
->
editData
(
$data
,
$id
))
{
return
$this
->
response
(
200
,
'成功'
);
}
else
{
return
$this
->
response
(
100
,
'无修改'
);
}
}
else
{
$where
=
"id =
{
$group_id
}
"
;
$info
=
$table
->
uleList
(
$where
);
return
$this
->
response
(
200
,
'成功'
,
$info
[
0
]);
}
}
/**
* 用户标签
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getULabelsList
()
{
if
(
$this
->
request
->
isAjax
())
{
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
//获取当前模块可操作按钮start********************************
$userRule
=
Session
::
get
(
'userRule'
);
// $result['data']['cz']=$userRule['cz'];
$result
[
'data'
][
'cz'
]
=
1
;
//获取当前模块可操作按钮end**********************************
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$labels
=
New
ULabels
;
$field
=
'id,name,create_time,free'
;
$where
[
'type'
]
=
1
;
$result
[
'data'
][
'list'
]
=
$labels
->
getList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$result
[
'data'
][
'total'
]
=
$labels
->
getTotal
(
$where
);
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
else
{
return
view
(
'u_label_index'
);
}
}
/**
* 获取用户上一次跟进状态
*
* @return \think\Response
*/
public
function
getUserLabel
()
{
if
(
empty
(
$this
->
params
[
'user_id'
]))
{
return
$this
->
response
(
101
,
'没有用户信息'
);
}
$follow_temp
=
new
UPhoneFollowUpTemporary
(
$this
->
siteId
);
$user_status
=
$follow_temp
->
getUserFollowKey
(
'user_status'
,
[
'user_id'
=>
$this
->
params
[
'user_id'
]],
'id DESC'
);
if
(
empty
(
$user_status
))
{
$follow
=
new
UPhoneFollowUp
(
$this
->
siteId
);
$user_status
=
$follow
->
getUserFollowKey
(
'user_status'
,
[
'user_id'
=>
$this
->
params
[
'user_id'
]],
'id DESC'
);
}
return
$this
->
response
(
200
,
''
,
$user_status
);
}
}
\ No newline at end of file
application/index/extend/Basic.php
View file @
16442262
...
@@ -93,6 +93,7 @@ class Basic extends Controller
...
@@ -93,6 +93,7 @@ class Basic extends Controller
'index/baiduText'
,
'index/baiduText'
,
'index/getBroker_new'
,
'index/getBroker_new'
,
'index/dailyBackImg'
,
'index/dailyBackImg'
,
'office_index/getLabelsList'
,
);
);
/**
/**
...
...
application/route.php
View file @
16442262
...
@@ -988,6 +988,7 @@ Route::group('office_index', [
...
@@ -988,6 +988,7 @@ Route::group('office_index', [
'delBuilding'
=>
[
'index/OfficeManage/delBuilding'
,
[
'method'
=>
'GET'
]],
//删除楼盘
'delBuilding'
=>
[
'index/OfficeManage/delBuilding'
,
[
'method'
=>
'GET'
]],
//删除楼盘
'getRoomList'
=>
[
'index/OfficeRoom/getRoomList'
,
[
'method'
=>
'GET'
]],
//删除楼盘
'getRoomList'
=>
[
'index/OfficeRoom/getRoomList'
,
[
'method'
=>
'GET'
]],
//删除楼盘
'getList'
=>
[
'index/Station/getList'
,
[
'method'
=>
'GET'
]],
//城市地铁
'getList'
=>
[
'index/Station/getList'
,
[
'method'
=>
'GET'
]],
//城市地铁
'getLabelsList'
=>
[
'index/OfficeLabel/getLabelsList'
,
[
'method'
=>
'get'
]],
//楼盘标签列表
]);
]);
//Route::miss('api/index/miss');//处理错误的url
//Route::miss('api/index/miss');//处理错误的url
\ 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