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
33ef0b9f
Commit
33ef0b9f
authored
Jul 11, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vip相关
parent
3979554f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
101 additions
and
6 deletions
+101
-6
Broker.php
application/api_broker/controller/Broker.php
+2
-0
Client.php
application/api_broker/controller/Client.php
+14
-2
User.php
application/api_broker/controller/User.php
+7
-3
VipService.php
application/api_broker/service/VipService.php
+51
-0
AuthGroup.php
application/model/AuthGroup.php
+12
-0
AuthRule.php
application/model/AuthRule.php
+13
-0
Users.php
application/model/Users.php
+1
-1
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Broker.php
View file @
33ef0b9f
...
@@ -415,6 +415,8 @@ class Broker extends Basic
...
@@ -415,6 +415,8 @@ class Broker extends Basic
}
}
}
}
/**
/**
* 客户动态展示加搜索加客户详情
* 客户动态展示加搜索加客户详情
*
*
...
...
application/api_broker/controller/Client.php
View file @
33ef0b9f
...
@@ -8,6 +8,9 @@ use app\model\AAgents;
...
@@ -8,6 +8,9 @@ use app\model\AAgents;
use
app\model\ULabels
;
use
app\model\ULabels
;
use
app\model\Users
;
use
app\model\Users
;
use
app\model\UPhoneFollowPp
;
use
app\model\UPhoneFollowPp
;
use
app\model\AuthGroup
;
use
app\model\AuthRule
;
use
app\api_broker\service\VipService
;
/**
/**
* Created by PhpStorm.
* Created by PhpStorm.
...
@@ -151,8 +154,8 @@ class Client extends Basic
...
@@ -151,8 +154,8 @@ class Client extends Basic
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
//当前时间
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
//当前时间
$params
=
$this
->
request
->
param
();
$params
=
$this
->
request
->
param
();
/*
$params['type'] = 0;
$params
[
'type'
]
=
0
;
$params['agent_id'] = '5775';
*/
$params
[
'agent_id'
]
=
'5775'
;
if
(
empty
(
$params
[
'agent_id'
])){
if
(
empty
(
$params
[
'agent_id'
])){
...
@@ -181,11 +184,17 @@ class Client extends Basic
...
@@ -181,11 +184,17 @@ class Client extends Basic
$total
=
$table
->
getMyUserCount
(
$where
);
$total
=
$table
->
getMyUserCount
(
$where
);
$data
[
'total'
]
=
ceil
(
$total
/
$pageSize
);
$data
[
'total'
]
=
ceil
(
$total
/
$pageSize
);
$data
[
'page'
]
=
$pageNo
;
$data
[
'page'
]
=
$pageNo
;
$vip_services
=
new
VipService
();
$data
[
'examine_vip'
]
=
$vip_services
->
vip
(
$params
[
'agent_id'
]);
return
$this
->
response
(
200
,
'成功'
,
$data
);
return
$this
->
response
(
200
,
'成功'
,
$data
);
}
}
/**搜索客户跟进
/**搜索客户跟进
* @return \think\Response
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
...
@@ -354,6 +363,9 @@ class Client extends Basic
...
@@ -354,6 +363,9 @@ class Client extends Basic
$data
[
'pagenum'
]
=
$pagenum
;
$data
[
'pagenum'
]
=
$pagenum
;
$data
[
'total'
]
=
$total
;
$data
[
'total'
]
=
$total
;
$data
[
'search_type'
]
=
$search_type
;
$data
[
'search_type'
]
=
$search_type
;
$vip_services
=
new
VipService
();
$data
[
'examine_vip'
]
=
$vip_services
->
vip
(
$params
[
'agent_id'
]);
return
$this
->
response
(
"200"
,
"success!"
,
$data
);
return
$this
->
response
(
"200"
,
"success!"
,
$data
);
}
}
...
...
application/api_broker/controller/User.php
View file @
33ef0b9f
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
app\api_broker\controller
;
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\VipService
;
use
app\model\Users
;
use
app\model\Users
;
use
think\Request
;
use
think\Request
;
...
@@ -72,7 +73,7 @@ class User extends Basic
...
@@ -72,7 +73,7 @@ class User extends Basic
"pageSize" => 15,
"pageSize" => 15,
"status" => -1,
"status" => -1,
);*/
);*/
$field
=
"id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand"
;
$field
=
"id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand
,vip
"
;
$conditions
=
[];
$conditions
=
[];
...
@@ -121,8 +122,10 @@ class User extends Basic
...
@@ -121,8 +122,10 @@ class User extends Basic
if
(
empty
(
$userList
))
{
if
(
empty
(
$userList
))
{
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
}
}
$vip_services
=
new
VipService
();
return
$this
->
response
(
"200"
,
'request success'
,
[
"user_date"
=>
$userList
]);
$data
[
'examine_vip'
]
=
$vip_services
->
vip
(
$params
[
'agent_id'
]);
$data
[
'user_date'
]
=
$userList
;
return
$this
->
response
(
"200"
,
'request success'
,
$data
);
}
}
}
}
\ No newline at end of file
application/api_broker/service/VipService.php
0 → 100644
View file @
33ef0b9f
<?php
namespace
app\api_broker\service
;
use
app\model\AAgents
;
use
app\model\AuthGroup
;
use
app\model\AuthRule
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018-07-10
* Time: 17:09:38
*/
class
VipService
{
/**
* 是否具有查看vip客户权限
*
*/
public
function
vip
(
$id
)
{
//$id= 5743;
$agent
=
new
AAgents
();
$fields
=
'auth_group_id'
;
$auth_group_id
=
$agent
->
getAgentsById
(
$id
,
$fields
);
//var_dump($auth_group_id);
$auth_group
=
New
AuthGroup
();
$id
=
$auth_group_id
;
$fields
=
'rules'
;
$rules
=
$auth_group
->
getAuthGroupById
(
$id
,
$fields
);
$auth_group
=
New
AuthRule
();
$name
=
'auth_vip'
;
$fields
=
'id'
;
$sauth_ruel_id
=
$auth_group
->
getAuthRuleByName
(
$name
,
$fields
);
$rules_arr
=
explode
(
','
,
$rules
);
if
(
in_array
(
$sauth_ruel_id
,
$rules_arr
))
{
return
0
;
}
else
{
return
1
;
}
}
}
\ No newline at end of file
application/model/AuthGroup.php
View file @
33ef0b9f
...
@@ -232,4 +232,16 @@ class AuthGroup extends BaseModel
...
@@ -232,4 +232,16 @@ class AuthGroup extends BaseModel
return
$this
->
where
(
$where
)
return
$this
->
where
(
$where
)
->
value
(
$key
);
->
value
(
$key
);
}
}
/**
* 根据id获取单个字段值
*
* @param $id
* @param $fields
* @return mixed
*/
public
function
getAuthGroupById
(
$id
,
$fields
)
{
return
$this
->
where
(
'id'
,
$id
)
->
value
(
$fields
);
}
}
}
application/model/AuthRule.php
View file @
33ef0b9f
...
@@ -195,4 +195,16 @@ class AuthRule extends BaseModel
...
@@ -195,4 +195,16 @@ class AuthRule extends BaseModel
->
where
(
$where
)
->
where
(
$where
)
->
find
();
->
find
();
}
}
/**
* 根据id获取单个字段值
*
* @param $id
* @param $fields
* @return mixed
*/
public
function
getAuthRuleByName
(
$name
,
$fields
)
{
return
$this
->
where
(
'name'
,
$name
)
->
value
(
$fields
);
}
}
}
\ No newline at end of file
application/model/Users.php
View file @
33ef0b9f
...
@@ -500,7 +500,7 @@ class Users extends Model
...
@@ -500,7 +500,7 @@ class Users extends Model
//->where('create_time','< time',$Two_days_ago)//小于两天前,即排除48小时内受保护的客户
//->where('create_time','< time',$Two_days_ago)//小于两天前,即排除48小时内受保护的客户
->
limit
(
$pagesize
)
->
limit
(
$pagesize
)
->
page
(
$pagenum
)
->
page
(
$pagenum
)
->
field
(
'id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand'
)
->
field
(
'id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand
,vip
'
)
->
select
();
->
select
();
}
}
...
...
application/route.php
View file @
33ef0b9f
...
@@ -407,6 +407,7 @@ Route::group('broker', [
...
@@ -407,6 +407,7 @@ Route::group('broker', [
'getLabelsList'
=>
[
'api_broker/label/getLabelsList'
,
[
'method'
=>
'get'
]
],
//标签列表
'getLabelsList'
=>
[
'api_broker/label/getLabelsList'
,
[
'method'
=>
'get'
]
],
//标签列表
'add_phone_follow_up'
=>
[
'api_broker/broker/add_phone_follow_up'
,
[
'method'
=>
'get|post'
]
],
//新增-客户电话跟进
'add_phone_follow_up'
=>
[
'api_broker/broker/add_phone_follow_up'
,
[
'method'
=>
'get|post'
]
],
//新增-客户电话跟进
'useraction_search'
=>
[
'api_broker/broker/useraction_search'
,
[
'method'
=>
'get|post'
]
],
//新增-客户电话跟进
'useraction_search'
=>
[
'api_broker/broker/useraction_search'
,
[
'method'
=>
'get|post'
]
],
//新增-客户电话跟进
'vip'
=>
[
'api_broker/broker/vip'
,
[
'method'
=>
'get|post'
]
],
'userStateSearch'
=>
[
'api_broker/broker/userStateSearch'
,
[
'method'
=>
'get|post'
]
],
//新增-客户电话跟进
'userStateSearch'
=>
[
'api_broker/broker/userStateSearch'
,
[
'method'
=>
'get|post'
]
],
//新增-客户电话跟进
'user_search'
=>
[
'api_broker/broker/user_search'
,
[
'method'
=>
'get|post'
]
],
//客户搜索
'user_search'
=>
[
'api_broker/broker/user_search'
,
[
'method'
=>
'get|post'
]
],
//客户搜索
'bindAXB'
=>
[
'api_broker/CellPhone/bindAXB'
,
[
'method'
=>
'post'
]
],
//隐私号码
'bindAXB'
=>
[
'api_broker/CellPhone/bindAXB'
,
[
'method'
=>
'post'
]
],
//隐私号码
...
...
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