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
03702502
Commit
03702502
authored
Mar 13, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
针对商铺列表特殊权限管理
parent
8d25bc94
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
13 deletions
+54
-13
Broker.php
application/index/controller/Broker.php
+3
-0
Houses.php
application/index/controller/Houses.php
+4
-3
Basic.php
application/index/extend/Basic.php
+17
-4
GHouses.php
application/model/GHouses.php
+27
-5
route.php
application/route.php
+3
-1
No files found.
application/index/controller/Broker.php
View file @
03702502
...
...
@@ -95,6 +95,9 @@ class Broker extends Basic
* 获取经纪人列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getBrokerList
()
{
$data
[
'status'
]
=
200
;
...
...
application/index/controller/Houses.php
View file @
03702502
...
...
@@ -13,6 +13,7 @@ use app\index\extend\Basic;
use
app\model\AAgents
;
use
app\model\GHouses
;
use
think\Request
;
use
think\Session
;
class
Houses
extends
Basic
...
...
@@ -176,7 +177,7 @@ class Houses extends Basic
$where
[
'id'
]
=
$params
[
'id'
];
}
$where
[
'status'
]
=
[
'<>'
,
3
];
$data
[
'data'
][
'list'
]
=
$this
->
house
->
getHouseList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$fields
,
$where
);
$data
[
'data'
][
'list'
]
=
$this
->
house
->
getHouseList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$fields
,
$where
,
$this
->
userId
);
$data
[
'data'
][
'total'
]
=
$this
->
house
->
getTotal
(
$where
);
}
else
{
//盘方人搜索
...
...
@@ -187,10 +188,10 @@ class Houses extends Basic
$where
[
'a.status'
]
=
[
'<>'
,
3
];
$where
[
'c.name'
]
=
[
'LIKE'
,
$params
[
'dish'
]
.
'%'
];
$where
[
'b.type'
]
=
[
'='
,
1
];
$data
[
'data'
][
'list'
]
=
$this
->
house
->
getHouseListDish
(
$pageNo
,
$pageSize
,
'a.id DESC'
,
$fields
,
$where
);
$data
[
'data'
][
'list'
]
=
$this
->
house
->
getHouseListDish
(
$pageNo
,
$pageSize
,
'a.id DESC'
,
$fields
,
$where
,
$this
->
userId
);
$data
[
'data'
][
'total'
]
=
$this
->
house
->
getHouseListDishTotal
(
$where
);
}
$data
[
'data'
][
'auth_c'
]
=
Session
::
get
(
'user_info.auth'
);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
...
...
application/index/extend/Basic.php
View file @
03702502
...
...
@@ -110,11 +110,24 @@ class Basic extends Controller
}
}
if
(
$auth_id
==
'0'
){
$is_auth
=
0
;
}
else
{
$exclude_auth
=
[
'index/addHousesAgents'
,
'index/addHousesAgentsDish'
,
'index/addHousesAgentsExclusive'
,
'index/houseEdit'
,
];
if
(
in_array
(
$requestPath
,
$exclude_auth
))
{
if
(
empty
(
$this
->
params
[
'upload_id'
])
||
(
$this
->
params
[
'upload_id'
]
!=
$this
->
userId
))
{
$is_auth
=
0
;
}
else
{
$is_auth
=
1
;
}
}
if
(
$is_auth
==
0
)
{
$agents
=
new
AAgents
();
$is_auth
=
$agents
->
agentsAuth
(
$auth_id
,
Session
::
get
(
'userId'
)
);
$is_auth
=
$agents
->
agentsAuth
(
$auth_id
,
$this
->
userId
);
$is_auth
=
empty
(
$is_auth
[
'id'
])
?
0
:
1
;
}
...
...
application/model/GHouses.php
View file @
03702502
...
...
@@ -99,14 +99,15 @@ class GHouses extends BaseModel
* @param string $order_
* @param string $field
* @param string $params
* @return mixed
* @param string $agents_id
* @return array|false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getHouseList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
public
function
getHouseList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
,
$agents_id
=
''
)
{
$data
=
$this
->
field
(
$field
)
$data
=
$this
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
...
...
@@ -114,6 +115,11 @@ class GHouses extends BaseModel
->
select
();
$house_id
=
array
();
foreach
(
$data
as
$k
=>
$v
)
{
if
(
$v
[
'upload_id'
]
==
$agents_id
)
{
$data
[
$k
][
'auth_edit_house'
]
=
1
;
}
else
{
$data
[
$k
][
'auth_edit_house'
]
=
0
;
}
$house_id
[
$k
]
=
$v
[
'id'
];
$v
->
create_time
=
date
(
'Y-m-d'
,
strtotime
(
$v
->
create_time
));
}
...
...
@@ -131,6 +137,11 @@ class GHouses extends BaseModel
->
select
();
foreach
(
$data
as
$k
=>
$v
)
{
if
(
$v
[
'upload_id'
]
==
$agents_id
)
{
$data
[
$k
][
'auth_edit_house'
]
=
1
;
}
else
{
$data
[
$k
][
'auth_edit_house'
]
=
0
;
}
$result
[
$k
]
=
$v
->
toArray
();
$dish_name
=
''
;
$result
[
$k
][
'dish_name'
]
=
''
;
...
...
@@ -158,14 +169,15 @@ class GHouses extends BaseModel
* @param string $order_
* @param string $field
* @param string $params
* @param string $agents_id
* @return array|false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getHouseListDish
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
public
function
getHouseListDish
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
,
$agents_id
=
''
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'g_houses_to_agents b'
,
'a.id=b.houses_id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agents_id=c.id'
,
'left'
)
->
where
(
$params
)
...
...
@@ -175,6 +187,11 @@ class GHouses extends BaseModel
->
select
();
$house_id
=
array
();
foreach
(
$data
as
$k
=>
$v
)
{
if
(
$v
[
'upload_id'
]
==
$agents_id
)
{
$data
[
$k
][
'auth_edit_house'
]
=
1
;
}
else
{
$data
[
$k
][
'auth_edit_house'
]
=
0
;
}
$house_id
[
$k
]
=
$v
[
'id'
];
}
...
...
@@ -191,6 +208,11 @@ class GHouses extends BaseModel
->
select
();
foreach
(
$data
as
$k
=>
$v
)
{
if
(
$v
[
'upload_id'
]
==
$agents_id
)
{
$data
[
$k
][
'auth_edit_house'
]
=
1
;
}
else
{
$data
[
$k
][
'auth_edit_house'
]
=
0
;
}
$result
[
$k
]
=
$v
->
toArray
();
$dish_name
=
''
;
$result
[
$k
][
'dish_name'
]
=
''
;
...
...
application/route.php
View file @
03702502
...
...
@@ -70,7 +70,9 @@ Route::group('index', [
'getBroker'
=>
[
'index/broker/getBroker'
,[
'method'
=>
'get'
]],
'getBroker_new'
=>
[
'index/broker/getBroker_new'
,[
'method'
=>
'get'
]],
'getBrokerList'
=>
[
'index/broker/getBrokerList'
,[
'method'
=>
'get'
]],
//门店列表的经纪人
'addHousesAgents'
=>
[
'index/broker/AddHousesAgents'
,
[
'method'
=>
'POST'
]],
//新增楼盘与经纪人关系
'addHousesAgents'
=>
[
'index/broker/AddHousesAgents'
,
[
'method'
=>
'POST'
]],
//新增楼盘与经纪人关系(案场权限人)
'addHousesAgentsDish'
=>
[
'index/broker/AddHousesAgents'
,
[
'method'
=>
'POST'
]],
//新增楼盘与经纪人关系(盘方)
'addHousesAgentsExclusive'
=>
[
'index/broker/AddHousesAgents'
,
[
'method'
=>
'POST'
]],
//新增楼盘与经纪人关系(独家)
'delTohouses'
=>
[
'index/broker/delTohouses'
,
[
'method'
=>
'POST'
]],
//解除经纪人和楼盘关系
'getAgentsTohouses'
=>
[
'index/broker/getAgentsTohouses'
,
[
'method'
=>
'GET'
]],
//获取经纪人和楼盘关系信息
...
...
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