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
244413a0
Commit
244413a0
authored
Nov 01, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
站点检测
parent
19132205
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
5 deletions
+52
-5
Houses.php
application/index/controller/Houses.php
+1
-1
BrokerService.php
application/index/service/BrokerService.php
+31
-3
AuthGroupSite.php
application/model/AuthGroupSite.php
+20
-1
No files found.
application/index/controller/Houses.php
View file @
244413a0
...
...
@@ -314,7 +314,7 @@ class Houses extends Basic
}
$fields
=
'id,shop_type,internal_title,rent_price,is_show,create_time,residue_num,rent_type,status,
shop_area_start,shop_area_end,industry_type,disc,is_carefully_chosen,is_exclusive_type,is_lock,vip'
;
shop_area_start,shop_area_end,industry_type,disc,is_carefully_chosen,is_exclusive_type,is_lock,
is_
vip'
;
/*楼盘编号*/
if
(
$this
->
params
[
'id'
]
!=
NULL
)
{
...
...
application/index/service/BrokerService.php
View file @
244413a0
...
...
@@ -16,11 +16,10 @@ use app\model\AAgents;
use
app\model\ABindingDevice
;
use
app\model\ADistrict
;
use
app\model\AOperatingRecords
;
use
app\model\ASite
;
use
app\model\A
uthGroup
Site
;
use
app\model\GHousesToAgents
;
use
app\model\OMarchInModel
;
use
app\model\Users
;
use
think\Request
;
class
BrokerService
{
...
...
@@ -43,7 +42,6 @@ class BrokerService
*/
public
function
saveAgentData
(
array
$data
,
int
$operation_id
)
{
$change_old_id
=
0
;
$is_new_id
=
1
;
$result
[
'status'
]
=
'fail'
;
$validate
=
new
AAgentValidate
();
...
...
@@ -262,4 +260,33 @@ class BrokerService
return
$result
;
}
/**
* 检查角色是否属于某个站点
*
* @param $agent_id
* @param $site_id
* @return bool
*/
public
function
checkSite
(
$agent_id
,
$site_id
)
{
$m_site
=
new
AuthGroupSite
();
if
(
empty
(
$agent_id
))
{
return
false
;
}
$auth_group_id
=
$this
->
m_agent
->
getAgentsById
(
$agent_id
,
'auth_group_id'
);
if
(
$auth_group_id
)
{
$where
[
'group_id'
]
=
$auth_group_id
;
$where
[
'status'
]
=
0
;
$where
[]
=
[
'EXP'
,
'find_in_set('
.
$site_id
.
', site_id)'
];
$id
=
$m_site
->
getSite
(
'id'
,
$where
);
if
(
count
(
$id
[
'data'
])
>
0
)
{
$result
=
true
;
}
else
{
$result
=
false
;
}
}
else
{
$result
=
false
;
}
return
$result
;
}
}
\ No newline at end of file
application/model/AuthGroupSite.php
View file @
244413a0
...
...
@@ -27,7 +27,6 @@ class AuthGroupSite extends BaseModel
}
/**
* @param $field
* @param $where
* @return mixed
*/
...
...
@@ -50,4 +49,23 @@ class AuthGroupSite extends BaseModel
return
$data
;
}
/**
* @param $field
* @param $where
* @return mixed
*/
public
function
getSite
(
$field
,
$where
)
{
$data
[
'data'
]
=
[];
try
{
$data
[
'data'
]
=
$this
->
field
(
$field
)
->
where
(
$where
)
->
select
();
$data
[
'status'
]
=
'successful'
;
}
catch
(
\Exception
$e
)
{
$data
[
'status'
]
=
'fail'
;
$data
[
'msg'
]
=
$e
->
getMessage
();
}
return
$data
;
}
}
\ 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