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
3660d0b0
Commit
3660d0b0
authored
Jan 20, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人列表
parent
3e82d5a2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
4 deletions
+87
-4
Broker.php
application/index/controller/Broker.php
+33
-0
Houses.php
application/index/controller/Houses.php
+5
-4
AAgents.php
application/model/AAgents.php
+17
-0
GHouses.php
application/model/GHouses.php
+30
-0
route.php
application/route.php
+2
-0
No files found.
application/index/controller/Broker.php
View file @
3660d0b0
...
@@ -10,6 +10,7 @@ namespace app\index\controller;
...
@@ -10,6 +10,7 @@ namespace app\index\controller;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\model\AAgents
;
use
app\model\Agents
;
use
app\model\Agents
;
class
Broker
extends
Basic
class
Broker
extends
Basic
...
@@ -48,4 +49,35 @@ class Broker extends Basic
...
@@ -48,4 +49,35 @@ class Broker extends Basic
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
}
/**
* 获取经纪人列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getBroker_new
()
{
$data
[
'status'
]
=
200
;
$data
[
'data'
]
=
''
;
$data
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
10
:
$params
[
'pageSize'
];
if
(
$params
[
'phone'
])
{
$where
=
'phone like "'
.
$params
[
'phone'
]
.
'%" or name like "'
.
$params
[
'phone'
]
.
'%"'
;
}
if
(
$where
)
{
$agent
=
new
AAgents
();
$field
=
'id,name,phone'
;
$data
[
'data'
]
=
$agent
->
getList
(
$pageNo
,
$pageSize
,
''
,
$field
,
$where
);
}
else
{
$data
[
'msg'
]
=
'没有经纪人信息'
;
}
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
}
}
\ No newline at end of file
application/index/controller/Houses.php
View file @
3660d0b0
...
@@ -98,7 +98,7 @@ class Houses extends Basic
...
@@ -98,7 +98,7 @@ class Houses extends Basic
*
*
* @return \think\Response
* @return \think\Response
*/
*/
public
function
getHouse
()
{
public
function
getHouse
List
()
{
$data
[
'status'
]
=
200
;
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$data
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
$params
=
$this
->
request
->
param
();
...
@@ -106,9 +106,10 @@ class Houses extends Basic
...
@@ -106,9 +106,10 @@ class Houses extends Basic
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$house
=
new
GHouses
();
$house
=
new
GHouses
();
$where
=
'status <> 3'
;
$where
=
'status <> 2'
;
$data
[
'list'
]
=
$house
->
getHouseInfoList
(
$pageNo
,
$pageSize
,
'id DESC'
,
'*'
,
$where
);
$fields
=
''
;
// $data['total'] = $house->($where);
$data
[
'data'
][
'list'
]
=
$house
->
getHouseList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$fields
,
$where
);
$data
[
'data'
][
'total'
]
=
$house
->
getTotal
(
$where
);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
}
...
...
application/model/AAgents.php
0 → 100644
View file @
3660d0b0
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/1/20
* Time: 17:52
*/
namespace
app\model
;
class
AAgents
extends
BaseModel
{
}
\ No newline at end of file
application/model/GHouses.php
View file @
3660d0b0
...
@@ -4,6 +4,8 @@ namespace app\model;
...
@@ -4,6 +4,8 @@ namespace app\model;
use
think\Db
;
class
GHouses
extends
BaseModel
class
GHouses
extends
BaseModel
{
{
protected
$table
=
'g_houses'
;
protected
$table
=
'g_houses'
;
...
@@ -43,4 +45,32 @@ class GHouses extends BaseModel
...
@@ -43,4 +45,32 @@ class GHouses extends BaseModel
}
}
return
$data
;
return
$data
;
}
}
/**
* 楼盘列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return mixed
* @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
=
''
)
{
$data
=
$this
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
foreach
(
$data
as
$k
=>
$v
)
{
$result
[
$k
]
=
$v
->
getData
();
$rsult
[
$k
][
'dish'
]
=
Db
::
table
(
'g_houses_to_agents'
)
->
where
(
'houses_id'
,
$result
[
$k
][
'house_id'
])
->
select
();
}
return
$result
;
}
}
}
application/route.php
View file @
3660d0b0
...
@@ -66,6 +66,7 @@ Route::group('index', [
...
@@ -66,6 +66,7 @@ Route::group('index', [
//查询经纪人
//查询经纪人
'getBroker'
=>
[
'index/broker/getBroker'
,[
'method'
=>
'get'
]],
'getBroker'
=>
[
'index/broker/getBroker'
,[
'method'
=>
'get'
]],
'getBroker_new'
=>
[
'index/broker/getBroker_new'
,[
'method'
=>
'get'
]],
//版本管理
//版本管理
'version'
=>
[
'index/version/index'
,[
'method'
=>
'get'
]],
'version'
=>
[
'index/version/index'
,[
'method'
=>
'get'
]],
...
@@ -84,6 +85,7 @@ Route::group('index', [
...
@@ -84,6 +85,7 @@ Route::group('index', [
'houseEdit'
=>
[
'index/Houses/edit'
,
[
'method'
=>
'get|post'
]],
//编辑商铺
'houseEdit'
=>
[
'index/Houses/edit'
,
[
'method'
=>
'get|post'
]],
//编辑商铺
'houseDel'
=>
[
'index/Houses/del'
,
[
'method'
=>
'get'
]],
//删除商铺
'houseDel'
=>
[
'index/Houses/del'
,
[
'method'
=>
'get'
]],
//删除商铺
'regions'
=>
[
'index/BusinessDistrict/regions'
,
[
'method'
=>
'get'
]],
//获取省市区数据
'regions'
=>
[
'index/BusinessDistrict/regions'
,
[
'method'
=>
'get'
]],
//获取省市区数据
'getHouseList'
=>
[
'index/houses/getHouseList'
,
[
'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