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
eea7f83f
Commit
eea7f83f
authored
Apr 02, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开盘广场列表
parent
9bed56f8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
18 deletions
+111
-18
Square.php
application/api_broker/controller/Square.php
+15
-0
SquareService.php
application/api_broker/service/SquareService.php
+42
-0
Square.php
application/index/controller/Square.php
+18
-0
BSquare.php
application/model/BSquare.php
+33
-18
route.php
application/route.php
+3
-0
No files found.
application/api_broker/controller/Square.php
View file @
eea7f83f
...
...
@@ -29,6 +29,20 @@ class Square extends Basic
}
public
function
getSquareList
()
{
$params
=
$this
->
params
;
$result
=
$this
->
s_square
->
getSquareList
(
$params
);
if
(
$result
){
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
}
}
\ No newline at end of file
application/api_broker/service/SquareService.php
View file @
eea7f83f
...
...
@@ -31,4 +31,45 @@ class SquareService
}
}
public
function
getSquareList
(
$params
){
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
//搜索 时间
if
(
!
empty
(
$params
[
'start_date'
])
&&
empty
(
$params
[
'end_date'
]))
{
$get_params
[
'Square.create_time'
]
=
[
'between time'
,
[
$params
[
'start_date'
]
.
' 00:00:00'
,
$params
[
'end_date'
]
.
' 23:59:59'
]
];
}
//城市
if
(
!
empty
(
$params
[
'site_id'
]))
{
$get_params
[
'Square.site_id'
]
=
$params
[
'site_id'
];
}
//部门
if
(
!
empty
(
$params
[
'district_id'
]))
{
$get_params
[
'Square.district_id'
]
=
$params
[
'district_id'
];
}
//文章标题
if
(
!
empty
(
$params
[
'title'
]))
{
$get_params
[
'Square.title'
]
=
[
'LIKE'
,
'%'
.
$params
[
'title'
]
.
'%'
];
}
$field
=
'Square.id,'
;
//
$field
.=
'Square.title,'
;
//标题
$field
.=
'Agent.name,'
;
//发布人
$field
.=
'Site.name as site_name,'
;
//城市
$field
.=
'District.district_name,'
;
//部门
$field
.=
'Square.create_time'
;
//发布时间
$get_params
[
'Square.status'
]
=
0
;
$res
=
$this
->
m_square
->
getSquareList
(
$pageNo
,
$pageSize
,
$field
,
$get_params
);
$res_total
=
$this
->
m_square
->
getSquareListTotal
(
$field
,
$get_params
);
// foreach ($res as $key => $val) {
//
// }
return
[
'data'
=>
$res
,
'total'
=>
$res_total
];
}
}
\ No newline at end of file
application/index/controller/Square.php
View file @
eea7f83f
...
...
@@ -37,6 +37,23 @@ class Square extends Basic
}
public
function
getSquareList
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$result
=
$this
->
s_square
->
getSquareList
(
$params
);
if
(
$result
){
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
}
}
\ No newline at end of file
application/model/BSquare.php
View file @
eea7f83f
...
...
@@ -44,25 +44,40 @@ class BSquare extends Model
}
public
function
getSquareList
(
$pageNo
,
$pageSize
,
$field
,
$params
)
{
$order
=
"Square.create_time desc"
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
'Square'
)
->
join
(
'a_agents Agent'
,
'Agent.id = Square.agent_id'
,
'right'
)
->
join
(
'a_site Site'
,
'Site.id = Square.site_id'
,
'right'
)
->
join
(
'a_district District'
,
'District.id = Square.district_id'
,
'right'
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order
)
->
select
();
//dump($this->getLastSql());
return
$result
;
}
public
function
getSquareListTotal
(
$field
,
$params
)
{
$order
=
"Square.create_time desc"
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
'Square'
)
->
join
(
'a_agents Agent'
,
'Agent.id = Square.agent_id'
,
'right'
)
->
join
(
'a_site Site'
,
'Site.id = Square.site_id'
,
'right'
)
->
join
(
'a_district District'
,
'District.id = Square.district_id'
,
'right'
)
->
where
(
$params
)
->
count
();
//dump($this->getLastSql());
return
$result
;
}
// /**
// * 查询收藏数据
// */
// public function getCollectList($pageNo,$pageSize,$field,$params)
// {
// $order = "CollectUser.update_time desc";
// $result = Db::table($this->table)
// ->field($field)
// ->alias('CollectUser')
// ->join('g_houses Houses', 'CollectUser.house_id = Houses.id', 'right')
// ->where($params)
// ->limit($pageSize)
// ->page($pageNo)
// ->order($order)
// ->select();
// //dump($this->getLastSql());
// return $result;
// }
//
//
// /**
...
...
application/route.php
View file @
eea7f83f
...
...
@@ -442,6 +442,8 @@ Route::group('index', [
//开盘广场
'addSquare'
=>
[
'index/Square/addSquare'
,
[
'method'
=>
'GET|POST'
]],
'getSquareList'
=>
[
'index/Square/getSquareList'
,
[
'method'
=>
'GET|POST'
]],
]);
...
...
@@ -848,6 +850,7 @@ Route::group('broker', [
//开盘广场
'addSquare'
=>
[
'api_broker/Square/addSquare'
,
[
'method'
=>
'GET|POST'
]],
'getSquareList'
=>
[
'api_broker/Square/getSquareList'
,
[
'method'
=>
'GET|POST'
]],
]);
...
...
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