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
84830494
Commit
84830494
authored
Apr 02, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开盘广场-删除
parent
eea7f83f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
122 additions
and
41 deletions
+122
-41
Square.php
application/api_broker/controller/Square.php
+19
-0
SquareService.php
application/api_broker/service/SquareService.php
+33
-1
Square.php
application/index/controller/Square.php
+41
-0
BSquare.php
application/model/BSquare.php
+26
-40
route.php
application/route.php
+3
-0
No files found.
application/api_broker/controller/Square.php
View file @
84830494
...
@@ -43,6 +43,24 @@ class Square extends Basic
...
@@ -43,6 +43,24 @@ class Square extends Basic
}
}
public
function
getSquareInfo
(){
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
'id'
]))
{
return
$this
->
response
(
"101"
,
"参数不全"
);
}
$result
=
$this
->
s_square
->
getSquareInfo
(
$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 @
84830494
...
@@ -55,6 +55,7 @@ class SquareService
...
@@ -55,6 +55,7 @@ class SquareService
$field
=
'Square.id,'
;
//
$field
=
'Square.id,'
;
//
$field
.=
'Square.title,'
;
//标题
$field
.=
'Square.title,'
;
//标题
$field
.=
'Square.cover_img,'
;
//cover_img
$field
.=
'Agent.name,'
;
//发布人
$field
.=
'Agent.name,'
;
//发布人
$field
.=
'Site.name as site_name,'
;
//城市
$field
.=
'Site.name as site_name,'
;
//城市
$field
.=
'District.district_name,'
;
//部门
$field
.=
'District.district_name,'
;
//部门
...
@@ -65,11 +66,41 @@ class SquareService
...
@@ -65,11 +66,41 @@ class SquareService
$res
=
$this
->
m_square
->
getSquareList
(
$pageNo
,
$pageSize
,
$field
,
$get_params
);
$res
=
$this
->
m_square
->
getSquareList
(
$pageNo
,
$pageSize
,
$field
,
$get_params
);
$res_total
=
$this
->
m_square
->
getSquareListTotal
(
$field
,
$get_params
);
$res_total
=
$this
->
m_square
->
getSquareListTotal
(
$field
,
$get_params
);
foreach
(
$res
as
$key
=>
$val
)
{
$res
[
$key
][
'image_path'
]
=
'http://n.sinaimg.cn/ent/transform/20170921/FVGl-fymesmp0851702.jpg'
;
}
return
[
'data'
=>
$res
,
'total'
=>
$res_total
];
}
public
function
getSquareInfo
(
$params
){
$field
=
'Square.id,'
;
//
$field
.=
'Square.title,'
;
//标题
$field
.=
'Square.content,'
;
//标题
$field
.=
'Agent.name,'
;
//发布人
$field
.=
'Site.name as site_name,'
;
//城市
$field
.=
'District.district_name,'
;
//部门
$field
.=
'Square.create_time'
;
//发布时间
$get_params
[
'Square.id'
]
=
$params
[
'id'
];
$get_params
[
'Square.status'
]
=
0
;
$res
=
$this
->
m_square
->
getSquareInfo
(
$field
,
$get_params
);
// foreach ($res as $key => $val) {
// foreach ($res as $key => $val) {
//
//
// }
// }
return
[
'data'
=>
$res
,
'total'
=>
$res_total
];
return
[
'data'
=>
$res
];
}
}
public
function
delSquare
(
$id
)
{
$where_params
[
'id'
]
=
$id
;
$update_params
[
'status'
]
=
1
;
$res
=
$this
->
m_square
->
updateStatus
(
$where_params
,
$update_params
);
return
$res
;
}
}
}
\ No newline at end of file
application/index/controller/Square.php
View file @
84830494
...
@@ -42,6 +42,9 @@ class Square extends Basic
...
@@ -42,6 +42,9 @@ class Square extends Basic
header
(
'Access-Control-Allow-Origin:*'
);
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
'title'
])
or
!
isset
(
$params
[
'content'
])
or
!
isset
(
$params
[
'site_id'
])
or
!
isset
(
$params
[
'cover_img'
])
or
!
isset
(
$params
[
'district_id'
]))
{
return
$this
->
response
(
"101"
,
"参数不全"
);
}
$result
=
$this
->
s_square
->
getSquareList
(
$params
);
$result
=
$this
->
s_square
->
getSquareList
(
$params
);
...
@@ -52,6 +55,44 @@ class Square extends Basic
...
@@ -52,6 +55,44 @@ class Square extends Basic
}
}
}
}
public
function
getSquareInfo
(){
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
'id'
]))
{
return
$this
->
response
(
"101"
,
"参数不全"
);
}
$result
=
$this
->
s_square
->
getSquareInfo
(
$params
);
if
(
$result
){
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
}
public
function
delSquare
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
'id'
]))
{
return
$this
->
response
(
"101"
,
"参数不全"
);
}
if
(
!
is_numeric
(
$params
[
'id'
]))
{
return
$this
->
response
(
"101"
,
"参数错误"
);
}
$result
=
$this
->
s_square
->
delSquare
(
$params
[
'id'
]);
if
(
$result
){
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"成功"
,
$result
);
}
}
...
...
application/model/BSquare.php
View file @
84830494
...
@@ -78,45 +78,31 @@ class BSquare extends Model
...
@@ -78,45 +78,31 @@ class BSquare extends Model
return
$result
;
return
$result
;
}
}
//
public
function
getSquareInfo
(
$field
,
$params
)
//
{
// /**
$order
=
"Square.create_time desc"
;
// * 查询收藏数据统计
$result
=
Db
::
table
(
$this
->
table
)
// * 朱伟 2018-08-10
->
field
(
$field
)
// */
->
alias
(
'Square'
)
// public function getCollectListTotal($field,$params)
->
join
(
'a_agents Agent'
,
'Agent.id = Square.agent_id'
,
'right'
)
// {
->
join
(
'a_site Site'
,
'Site.id = Square.site_id'
,
'right'
)
// $order = "CollectUser.create_time desc";
->
join
(
'a_district District'
,
'District.id = Square.district_id'
,
'right'
)
// $result = Db::table($this->table)
->
where
(
$params
)
// ->field($field)
->
order
(
$order
)
// ->alias('CollectUser')
->
find
();
// ->join('g_houses Houses', 'CollectUser.house_id = Houses.id', 'left')
//dump($this->getLastSql());
// ->where($params)
return
$result
;
// ->count();
}
// //dump($this->getLastSql());
// return $result;
// }
//
//
public
function
updateStatus
(
$where_params
,
$update_params
)
// /**
{
// * 更新数据
$result
=
$this
->
where
(
$where_params
)
->
update
(
$update_params
);
// * 朱伟 2018-08-08
// dump($this->getLastSql());
// */
// big_log($this->getLastSql());
// public function delCollectHouse($id)
return
$result
;
// {
}
// $result = Db::table($this->table)
// ->where('house_id', $id)
// ->update([ 'status' => 3 ]);
// //dump($this->getLastSql());
// return $result;
// }
//
// public function updateStatus($agents_id,$house_id)
// {
// $result = $this->where(['agents_id'=>$agents_id,'house_id'=>$house_id])->update(['status'=>2]);
// //dump($this->getLastSql());
// // big_log($this->getLastSql());
// return $result;
// }
}
}
application/route.php
View file @
84830494
...
@@ -443,6 +443,8 @@ Route::group('index', [
...
@@ -443,6 +443,8 @@ Route::group('index', [
//开盘广场
//开盘广场
'addSquare'
=>
[
'index/Square/addSquare'
,
[
'method'
=>
'GET|POST'
]],
'addSquare'
=>
[
'index/Square/addSquare'
,
[
'method'
=>
'GET|POST'
]],
'getSquareList'
=>
[
'index/Square/getSquareList'
,
[
'method'
=>
'GET|POST'
]],
'getSquareList'
=>
[
'index/Square/getSquareList'
,
[
'method'
=>
'GET|POST'
]],
'getSquareInfo'
=>
[
'index/Square/getSquareInfo'
,
[
'method'
=>
'GET|POST'
]],
'delSquare'
=>
[
'index/Square/delSquare'
,
[
'method'
=>
'GET|POST'
]],
]);
]);
...
@@ -851,6 +853,7 @@ Route::group('broker', [
...
@@ -851,6 +853,7 @@ Route::group('broker', [
//开盘广场
//开盘广场
'addSquare'
=>
[
'api_broker/Square/addSquare'
,
[
'method'
=>
'GET|POST'
]],
'addSquare'
=>
[
'api_broker/Square/addSquare'
,
[
'method'
=>
'GET|POST'
]],
'getSquareList'
=>
[
'api_broker/Square/getSquareList'
,
[
'method'
=>
'GET|POST'
]],
'getSquareList'
=>
[
'api_broker/Square/getSquareList'
,
[
'method'
=>
'GET|POST'
]],
'getSquareInfo'
=>
[
'api_broker/Square/getSquareInfo'
,
[
'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