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
f3980a4b
Commit
f3980a4b
authored
Jan 16, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
house_exclusive
parent
d86ee67d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
9 deletions
+65
-9
Shop.php
application/api_broker/controller/Shop.php
+9
-4
Houses.php
application/index/controller/Houses.php
+18
-5
HouseService.php
application/index/service/HouseService.php
+29
-0
GHousesToAgents.php
application/model/GHousesToAgents.php
+9
-0
No files found.
application/api_broker/controller/Shop.php
View file @
f3980a4b
...
...
@@ -1027,24 +1027,29 @@ class Shop extends Basic
/**
* 商铺列表添加和编辑独家
*
* @return \think\Response
*/
public
function
editExclusive
()
{
// $res = $this->gHousesModel->exclusive($this->params, $this->params['houses_id'], $this->agentId, $this->siteId);
if
(
empty
(
$this
->
params
[
'id'
]))
{
if
(
empty
(
$this
->
params
[
'id'
])
||
empty
(
$this
->
params
[
'exclusive_ids'
]))
{
return
$this
->
response
(
101
,
'参数错误'
);
}
$code
=
200
;
$msg
=
""
;
$house
=
new
HouseService
();
if
(
$this
->
params
[
'is_exclusive_type'
]
==
1
)
{
$house
=
new
HouseService
();
$result
=
$house
->
addHouse
(
$this
->
params
,
$this
->
agentId
,
1
,
0
,
'exclusive'
);
if
(
$result
[
'status'
]
==
'fail'
)
{
$code
=
101
;
$msg
=
$result
[
'msg'
];
}
}
else
{
$this
->
gHousesModel
->
editData
([
'is_exclusive_type'
=>
0
],
$this
->
params
[
'id'
]);
$result
=
$house
->
delAgentHouse
(
3
,
$this
->
params
[
'id'
],
$this
->
params
[
'exclusive_ids'
]);
if
(
!
$result
)
{
$code
=
101
;
$msg
=
'解除独家关系失败'
;
}
}
return
$this
->
response
(
$code
,
$msg
);
...
...
application/index/controller/Houses.php
View file @
f3980a4b
...
...
@@ -528,10 +528,6 @@ class Houses extends Basic
* 商铺列表添加和编辑独家
*
* @return \think\Response
* @throws \Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
editExclusive
()
{
...
...
@@ -539,7 +535,24 @@ class Houses extends Basic
return
$this
->
response
(
101
,
'参数错误'
);
}
$this
->
data
=
$this
->
house
->
exclusive
(
$this
->
params
,
$this
->
params
[
'houses_id'
],
$this
->
userId
,
$this
->
siteId
);
$house
=
new
HouseService
();
if
(
$this
->
params
[
'is_exclusive_type'
]
==
1
)
{
$data
=
$this
->
params
;
$data
[
'id'
]
=
$this
->
params
[
'houses_id'
];
unset
(
$data
[
'houses_id'
]);
$house
=
new
HouseService
();
$this
->
data
=
$house
->
addHouse
(
$data
,
$this
->
userId
,
0
,
$this
->
siteId
,
'exclusive'
);
if
(
$this
->
data
[
'status'
]
==
'fail'
)
{
$this
->
code
=
101
;
$this
->
msg
=
$this
->
data
[
'msg'
];
}
}
else
{
$result
=
$house
->
delAgentHouse
(
3
,
$this
->
params
[
'houses_id'
],
$this
->
params
[
'exclusive_id'
]);
if
(
!
$result
)
{
$this
->
code
=
101
;
$this
->
msg
=
'解除独家关系失败'
;
}
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
...
...
application/index/service/HouseService.php
View file @
f3980a4b
...
...
@@ -935,4 +935,32 @@ class HouseService
return
;
}
/**
* 删除经纪人与楼盘关系
*
* @param $type
* @param $house_id
* @param $agent_id
* @return GHousesToAgents|bool
*/
public
function
delAgentHouse
(
$type
,
$house_id
,
$agent_id
)
{
if
(
empty
(
$type
)
||
empty
(
$house_id
)
||
empty
(
$agent_id
))
{
return
false
;
}
$id
=
$this
->
m_house
->
getTotal
([
'id'
=>
$house_id
]);
if
(
empty
(
$id
))
{
return
false
;
}
$where
[
'houses_id'
]
=
$house_id
;
$where
[
'agents_id'
]
=
$agent_id
;
$where
[
'type'
]
=
$type
;
$is_ok
=
$this
->
agent_house
->
updateData
(
$where
,
[
'is_del'
=>
1
]);
if
(
$type
==
3
)
{
$this
->
m_house
->
editData
([
'is_exclusive_type'
=>
0
],
$house_id
);
}
return
$is_ok
;
}
}
\ No newline at end of file
application/model/GHousesToAgents.php
View file @
f3980a4b
...
...
@@ -573,4 +573,13 @@ class GHousesToAgents extends BaseModel
$result
=
$this
->
where
(
$where_
)
->
count
();
return
$result
;
}
/**
* @param $where
* @param $data
* @return GHousesToAgents
*/
public
function
updateData
(
$where
,
$data
)
{
return
$this
->
where
(
$where
)
->
update
(
$data
);
}
}
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