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
9bed56f8
Commit
9bed56f8
authored
Apr 02, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发布开盘
parent
69b6cd64
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
227 additions
and
0 deletions
+227
-0
Square.php
application/api_broker/controller/Square.php
+35
-0
SquareService.php
application/api_broker/service/SquareService.php
+35
-0
Square.php
application/index/controller/Square.php
+43
-0
BSquare.php
application/model/BSquare.php
+107
-0
route.php
application/route.php
+7
-0
No files found.
application/api_broker/controller/Square.php
0 → 100644
View file @
9bed56f8
<?php
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\SquareService
;
class
Square
extends
Basic
{
private
$s_square
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
s_square
=
new
SquareService
();
}
public
function
addSquare
()
{
$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
->
saveSquare
(
$this
->
agentId
,
$params
[
'title'
],
$params
[
'content'
],
$params
[
'cover_img'
],
$params
[
'site_id'
],
$params
[
'district_id'
]);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
}
\ No newline at end of file
application/api_broker/service/SquareService.php
0 → 100644
View file @
9bed56f8
<?php
namespace
app\api_broker\service
;
use
app\model\BSquare
;
class
SquareService
{
private
$m_square
;
public
function
__construct
()
{
$this
->
m_square
=
new
BSquare
();
}
public
function
saveSquare
(
$agent_id
,
$title
,
$content
,
$cover_img
,
$site_id
,
$district_id
)
{
$insert
[
"agent_id"
]
=
$agent_id
;
//经纪人id
$insert
[
"title"
]
=
$title
;
//标题
$insert
[
"content"
]
=
$content
;
//text
$insert
[
"cover_img"
]
=
$cover_img
;
//封面图
$insert
[
"site_id"
]
=
$site_id
;
//站点id
$insert
[
"district_id"
]
=
$district_id
;
//部门id
$insert
[
"status"
]
=
0
;
//状态: 0正常 1删除
$res
=
$this
->
m_square
->
saveSquare
(
$insert
);
//int(1)
if
(
$res
==
1
){
return
true
;
}
else
{
return
false
;
}
}
}
\ No newline at end of file
application/index/controller/Square.php
0 → 100644
View file @
9bed56f8
<?php
namespace
app\index\controller
;
use
app\api_broker\service\SquareService
;
use
app\index\extend\Basic
;
use
app\model\ASite
;
use
think\Request
;
class
Square
extends
Basic
{
protected
$s_square
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
s_square
=
new
SquareService
();
}
public
function
addSquare
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$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"
,
"参数不全"
);
}
$res
=
$this
->
s_square
->
saveSquare
(
$this
->
userId
,
$params
[
'title'
],
$params
[
'content'
],
$params
[
'cover_img'
],
$params
[
'site_id'
],
$params
[
'district_id'
]);
if
(
$res
)
{
return
$this
->
response
(
"200"
,
"成功"
);
}
else
{
return
$this
->
response
(
"101"
,
"失败"
);
}
}
}
\ No newline at end of file
application/model/BSquare.php
0 → 100755
View file @
9bed56f8
<?php
namespace
app\model
;
use
think\Db
;
use
think\Model
;
class
BSquare
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'b_square'
;
public
function
saveSquare
(
$data
)
{
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
$data
[
'create_time'
]
=
$time
;
$data
[
'update_time'
]
=
$time
;
return
$this
->
insert
(
$data
);
}
/**
* 查询数据
*/
public
function
getSquare
(
$field
,
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
//->alias('a')
->
where
(
$params
)
->
select
();
//dump($this->getLastSql());
return
$result
;
}
/**
* 更新数据
*/
public
function
updateSquare
(
$params
)
{
$result
=
$this
->
update
(
$params
);
//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;
// }
//
//
// /**
// * 查询收藏数据统计
// * 朱伟 2018-08-10
// */
// public function getCollectListTotal($field,$params)
// {
// $order = "CollectUser.create_time desc";
// $result = Db::table($this->table)
// ->field($field)
// ->alias('CollectUser')
// ->join('g_houses Houses', 'CollectUser.house_id = Houses.id', 'left')
// ->where($params)
// ->count();
// //dump($this->getLastSql());
// return $result;
// }
//
//
// /**
// * 更新数据
// * 朱伟 2018-08-08
// */
// public function delCollectHouse($id)
// {
// $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 @
9bed56f8
...
...
@@ -439,6 +439,9 @@ Route::group('index', [
'check'
=>
[
'index/AccountBalance/check'
,
[
'method'
=>
'get|post'
]],
'videoCheckList'
=>
[
'index/VideoCheck/videoCheckList'
,
[
'method'
=>
'get|post'
]],
//开盘广场
'addSquare'
=>
[
'index/Square/addSquare'
,
[
'method'
=>
'GET|POST'
]],
]);
...
...
@@ -843,6 +846,9 @@ Route::group('broker', [
'getRandKingListByAgentId'
=>
[
'api_broker/RankingList/getRandKingListByAgentId'
,
[
'method'
=>
'GET|POST'
]],
'getStoreRandKingListByAgentId'
=>
[
'api_broker/RankingList/getStoreRandKingListByAgentId'
,
[
'method'
=>
'GET|POST'
]],
//开盘广场
'addSquare'
=>
[
'api_broker/Square/addSquare'
,
[
'method'
=>
'GET|POST'
]],
]);
//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
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