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
4c65a1f9
Commit
4c65a1f9
authored
Oct 31, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vip盘权限限制
parent
d1a07866
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
13 deletions
+77
-13
Shop.php
application/api_broker/controller/Shop.php
+12
-1
VipService.php
application/api_broker/service/VipService.php
+2
-3
Houses.php
application/index/controller/Houses.php
+1
-1
Basic.php
application/index/extend/Basic.php
+1
-1
HouseService.php
application/index/service/HouseService.php
+45
-0
AAgents.php
application/model/AAgents.php
+11
-2
GHousesToAgents.php
application/model/GHousesToAgents.php
+5
-5
No files found.
application/api_broker/controller/Shop.php
View file @
4c65a1f9
...
...
@@ -447,7 +447,18 @@ class Shop extends Basic
$param
[
"img_type"
]
=
3
;
//图片类型:1效果图,2实景图,3样板图,4户型图,5交通图
$result
[
"plan_images"
]
=
$this
->
gHousesImgModel
->
getHouseImages
(
$param
,
1
);
if
(
$params
[
'site_area'
]
==
3
||
$params
[
"site_area"
]
==
4
)
{
$result
[
'landlord_phone'
]
=
json_decode
(
$result
[
'landlord_phone'
],
true
);
$house_service
=
new
HouseService
();
$is_show_landlord
=
$house_service
->
checkLandlordShow
(
$this
->
agentId
,
$result
[
'id'
]);
if
(
$is_show_landlord
)
{
$result
[
'landlord_phone'
]
=
json_decode
(
$result
[
'landlord_phone'
],
true
);
$result
[
'is_show_landlord'
]
=
1
;
}
else
{
$result
[
'landlord_phone'
]
=
[
'name'
=>
''
,
'phone'
=>
''
];
$result
[
'is_show_landlord'
]
=
0
;
}
// $result['create_time'] = date('Y-m-d', strtotime($result['create_time']));
}
...
...
application/api_broker/service/VipService.php
View file @
4c65a1f9
...
...
@@ -29,16 +29,15 @@ class VipService
$auth_group_id
=
$agent
->
getAgentsById
(
$id
,
$fields
);
$auth_group
=
New
AuthGroup
();
$id
=
$auth_group_id
;
$fields
=
'rules'
;
$rules
=
$auth_group
->
getAuthGroupById
(
$id
,
$fields
);
$rules
=
$auth_group
->
getAuthGroupById
(
$
auth_group_
id
,
$fields
);
$auth_group
=
New
AuthRule
();
$fields
=
'id'
;
$auth_rule_id
=
$auth_group
->
getAuthRuleByName
(
$name
,
$fields
);
$rules_arr
=
explode
(
','
,
$rules
);
if
(
in_array
(
$auth_rule_id
,
$rules_arr
))
{
if
(
in_array
(
$auth_rule_id
,
$rules_arr
)
||
$id
==
1
)
{
return
0
;
}
else
{
return
1
;
...
...
application/index/controller/Houses.php
View file @
4c65a1f9
...
...
@@ -778,7 +778,7 @@ class Houses extends Basic
}
/**
*
是否对C端显示
*
vip盘
*
* @return \think\Response
*/
...
...
application/index/extend/Basic.php
View file @
4c65a1f9
...
...
@@ -187,7 +187,7 @@ class Basic extends Controller
if
(
$requestPath
==
'index/editExclusive'
&&
isset
(
$this
->
params
[
'exclusive_id'
]))
{
$m_house_agent
=
new
GHousesToAgents
();
//独家方
$exclusive_num
=
$m_house_agent
->
getAgentHouseNum
(
$this
->
params
[
'exclusive_id'
],
3
);
$exclusive_num
=
$m_house_agent
->
getAgentHouseNum
(
$this
->
params
[
'exclusive_id'
],
$this
->
params
[
'id'
],
3
);
if
(
$exclusive_num
>
0
)
{
$is_auth
=
1
;
}
...
...
application/index/service/HouseService.php
View file @
4c65a1f9
...
...
@@ -10,6 +10,7 @@ namespace app\index\service;
use
app\api_broker\service\PushMessageService
;
use
app\api_broker\service\VipService
;
use
app\index\validate\HouseValidate
;
use
app\model\AAgents
;
use
app\model\GBusinessDistrict
;
...
...
@@ -416,4 +417,47 @@ class HouseService
}
}
/**
* 检查是否显示房东手机号和姓名
*
* @param int $agent_id
* @param int $house_id
* @return bool
*/
public
function
checkLandlordShow
(
int
$agent_id
,
int
$house_id
)
:
bool
{
$result
=
false
;
$service_vip
=
new
VipService
();
$rule
=
$service_vip
->
vip
(
$agent_id
,
'index/vipHouse'
);
//检查权限
if
(
!
$rule
)
{
return
true
;
}
$house_where
[
'houses_id'
]
=
$house_id
;
$house_where
[
'type'
]
=
2
;
$agent_id_arr
=
$this
->
agent_house
->
getHouseAgent
(
'b.id,b.district_id'
,
$house_where
);
if
(
$agent_id_arr
[
'status'
]
!=
'fail'
)
{
foreach
(
$agent_id_arr
as
$v
)
{
//盘方
if
(
$agent_id
==
$v
[
'id'
])
{
$result
=
true
;
break
;
}
$where_district
[
'district_id'
]
=
$v
[
'district_id'
];
$where_district
[
'level'
]
=
[
'in'
,
'30,40'
];
$district_id
=
$this
->
agent
->
getAgentsByWhere
(
$where_district
,
'id'
);
//部门总监
if
(
$agent_id
==
$district_id
)
{
$result
=
true
;
break
;
}
}
}
return
$result
;
}
}
\ No newline at end of file
application/model/AAgents.php
View file @
4c65a1f9
...
...
@@ -729,8 +729,17 @@ class AAgents extends BaseModel
*/
public
function
getAgentsById
(
$id
,
$fields
)
{
$return
=
$this
->
where
(
'id'
,
$id
)
->
value
(
$fields
);
return
$return
;
return
$this
->
where
(
'id'
,
$id
)
->
value
(
$fields
);
}
/**
* @param $where
* @param $fields
* @return mixed
*/
public
function
getAgentsByWhere
(
$where
,
$fields
)
{
return
$this
->
where
(
$where
)
->
value
(
$fields
);
}
/**
...
...
application/model/GHousesToAgents.php
View file @
4c65a1f9
...
...
@@ -403,16 +403,18 @@ class GHousesToAgents extends BaseModel
/**
* @param $agent_id
* @param $house_id
* @param int $type
* @return int|string
*/
public
function
getAgentHouseNum
(
$agent_id
,
$type
=
3
)
{
public
function
getAgentHouseNum
(
$agent_id
,
$
house_id
,
$
type
=
3
)
{
return
$this
->
alias
(
'a'
)
->
field
(
'a.id'
)
->
join
(
'a_agents b'
,
'a.agents_id=b.id'
,
'left'
)
->
where
(
'a.is_del'
,
0
)
->
where
(
'a.type'
,
$type
)
->
where
(
'a.agents_id'
,
$agent_id
)
->
where
(
'a.houses_id'
,
$house_id
)
->
count
();
}
...
...
@@ -430,10 +432,8 @@ class GHousesToAgents extends BaseModel
/**
* @param $field
* @param $type
* @param $houses_id
* @param int $is_del
* @return array
* @param $where
* @return mixed
*/
public
function
getAgentHouseValue
(
$field
,
$where
)
{
return
$this
->
where
(
$where
)
...
...
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