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
25baa234
Commit
25baa234
authored
Dec 12, 2017
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的成交记录
parent
129473fc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
186 additions
and
42 deletions
+186
-42
Shop.php
application/api/controller/Shop.php
+45
-12
Sublet.php
application/api/controller/Sublet.php
+51
-23
TradeLog.php
application/api/controller/TradeLog.php
+59
-0
HouseInfos.php
application/model/HouseInfos.php
+1
-1
Labels.php
application/model/Labels.php
+15
-1
SubletModel.php
application/model/SubletModel.php
+10
-4
route.php
application/route.php
+5
-1
No files found.
application/api/controller/Shop.php
View file @
25baa234
...
...
@@ -12,17 +12,20 @@ namespace app\api\controller;
use
app\api\extend\Basic
;
use
app\model\HouseImgs
;
use
app\model\HouseInfos
;
use
app\model\Labels
;
class
Shop
extends
Basic
{
protected
$db
;
protected
$dbImg
;
protected
$labels
;
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
db
=
new
HouseInfos
();
$this
->
dbImg
=
new
HouseImgs
();
$this
->
labels
=
new
Labels
();
}
/**
...
...
@@ -35,6 +38,7 @@ class Shop extends Basic
"site_area" => 2, //来源 1首页 2搜索
"title" => "尚美",
"carefully_chosen" => 0,
"disc" => "黄浦区",
"yetai" => "休闲娱乐",
"area_start" => 45,//面积起始范围 room_area2
"area_end" => 65,//面积结束范围
...
...
@@ -155,6 +159,10 @@ class Shop extends Basic
}
/**
* 搜索页搜索条件
* @return \think\Response
*/
public
function
filtrateCondition
()
{
$field
=
"city,disc"
;
...
...
@@ -162,21 +170,45 @@ class Shop extends Basic
$param
[
'room_num_left'
]
=
array
(
'<>'
,
0
);
$group_
=
"disc"
;
$cityList
=
$this
->
db
->
getCityList
(
$field
,
$param
,
$group_
);
print_r
(
$cityList
);
exit
;
/* $return['data']['yetai'] = array( '全部', '餐饮美食', '零售', '休闲娱乐', '其他' );//业态
$return['data']['money'] = array( array( 'id' => '', 'value' => '全部' ), array( 'id' => '0', 'value' => '3万以上' ), array( 'id' => '1', 'value' => '1万-3万' ), array( 'id' => '2', 'value' => '1万以下' ) );//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
$return['data']['more'] = array( '全部' );//更多
$return['data']['acreage'] = array( array( 'id' => '', 'value' => '全部' ), array( 'id' => '0', 'value' => '30m²以内' ), array( 'id' => '1', 'value' => '30-60m²' ), array( 'id' => '2', 'value' => '60-100m²' ), array( 'id' => '3', 'value' => '100m²以上' ) );//面积
$Label = $this->Label->find("all");
if ($Label) {
foreach ($Label AS $k3 => $v3) {
if ($v3['Label']['name']) {
$return['data']['more'][] = $v3['Label']['name'];
foreach
(
$cityList
as
$k
=>
$v
)
{
$cityArr
[]
=
$v
[
"city"
];
}
$cityArr
=
array_unique
(
$cityArr
);
$i
=
0
;
$result
[
"area"
][
$i
][
"city"
]
=
"全部"
;
$result
[
"area"
][
$i
][
"disc"
][]
=
"全部"
;
foreach
(
$cityArr
as
$key
=>
$val
)
{
$i
++
;
$result
[
"area"
][
$i
][
"city"
]
=
$val
;
$result
[
"area"
][
$i
][
"disc"
][]
=
"全"
.
$val
;
foreach
(
$cityList
as
$k
=>
$v
)
{
if
(
$val
==
$v
[
"city"
])
{
$result
[
"area"
][
$i
][
"disc"
][]
=
$v
[
"disc"
];
}
}
}
$result
[
'yetai'
]
=
array
(
'全部'
,
'餐饮美食'
,
'零售'
,
'休闲娱乐'
,
'其他'
);
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
$result
[
'money'
]
=
array
(
array
(
'id'
=>
'-1'
,
'value'
=>
'全部'
),
array
(
'id'
=>
'0'
,
'value'
=>
'3万以上'
),
array
(
'id'
=>
'1'
,
'value'
=>
'1万-3万'
),
array
(
'id'
=>
'2'
,
'value'
=>
'1万以下'
)
);
//面积
$result
[
'acreage'
]
=
array
(
array
(
'id'
=>
'-1'
,
'value'
=>
'全部'
),
array
(
'id'
=>
'0'
,
'value'
=>
'30m²以内'
),
array
(
'id'
=>
'1'
,
'value'
=>
'30-60m²'
),
array
(
'id'
=>
'2'
,
'value'
=>
'60-100m²'
),
array
(
'id'
=>
'3'
,
'value'
=>
'100m²以上'
)
);
$result
[
'more'
][]
=
"更多"
;
$labelsResult
=
$this
->
labels
->
getLabels
();
if
(
count
(
$labelsResult
)
>
0
)
{
foreach
(
$labelsResult
as
$labelsKey
=>
$labelsVal
)
{
if
(
$labelsVal
[
'name'
])
{
$result
[
'more'
][]
=
$labelsVal
[
'name'
];
}
}
}
*/
}
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
}
\ No newline at end of file
application/api/controller/Sublet.php
View file @
25baa234
...
...
@@ -23,29 +23,57 @@ class Sublet extends Basic
$this
->
subletMode
=
new
SubletModel
();
}
public
function
addSublet
(){
//$params = $this->params;
/**
* `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '我的转租记录表',
`user_id` int(10) DEFAULT NULL COMMENT '用户id',
`manage_status` tinyint(3) DEFAULT '0' COMMENT '经营状态 0:餐饮美食 1:零售 2:休闲娱乐 3:其他',
`address_detail` varchar(255) DEFAULT '' COMMENT '详细地址',
`province` varchar(125) DEFAULT NULL COMMENT '省',
`province_code` int(10) DEFAULT NULL COMMENT '省code 对应regions表code',
`city` varchar(125) DEFAULT '' COMMENT '市',
`city_id` int(10) DEFAULT NULL COMMENT '市id',
`district` varchar(125) DEFAULT '' COMMENT '区',
`district_id` int(10) DEFAULT NULL COMMENT '区id',
`expected_rent` int(11) DEFAULT '0' COMMENT '期望租金 存分',
`appellation` varchar(125) DEFAULT '' COMMENT '称呼',
`tel` varchar(20) DEFAULT '' COMMENT '联系方式',
`status` tinyint(3) DEFAULT '0' COMMENT '状态 0:已发布 1:电话核实 2:商铺上架',
`agents_id` int(10) DEFAULT NULL COMMENT '经纪人 对应agents表(对接经纪人)',
`create_time` timestamp NULL DEFAULT NULL,
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
*/
$params
=
array
(
);
public
function
addSublet
()
{
$params
=
$this
->
params
;
/* $params = array(
"user_id" => 1,
"manage_type" => 0,
"address_detail" => "shanghaishi",
"province" => "湖南省",
"province_code" => "10001",
"city" => "长沙市",
"city_code" => "200001",
"district" => "芙蓉区",
"district_code" => "300001",
"expected_rent" => 2000,
"appellation" => "zhangsan",
"tel" => 13817616162,
);*/
if
(
!
isset
(
$params
[
"manage_type"
]))
{
$this
->
response
(
"101"
,
"经营业态不能为空"
);
}
if
(
!
isset
(
$params
[
"address_detail"
]))
{
$this
->
response
(
"101"
,
"详细地址不能为空"
);
}
if
(
!
isset
(
$params
[
"province"
])
||
!
isset
(
$params
[
"province_code"
])
||
!
isset
(
$params
[
"city"
])
||
!
isset
(
$params
[
"city_code"
])
||
!
isset
(
$params
[
"district"
])
||
!
isset
(
$params
[
"district_code"
]))
{
$this
->
response
(
"101"
,
"省市区不能为空"
);
}
if
(
!
isset
(
$params
[
"expected_rent"
]))
{
$this
->
response
(
"101"
,
"期望租金不能为空"
);
}
if
(
!
isset
(
$params
[
"appellation"
]))
{
$this
->
response
(
"101"
,
"称呼不能为空"
);
}
if
(
!
isset
(
$params
[
"tel"
])
||
!
preg_match
(
'/1[345678]\d{9}/'
,
$params
[
"phone"
]))
{
$this
->
response
(
"101"
,
"手机号检验错误"
);
}
$params
[
"create_time"
]
=
time
();
$params
[
"update_time"
]
=
time
();
$result
=
$this
->
subletMode
->
addSublet
(
$params
);
if
(
$result
[
"code"
]
==
200
)
{
return
$this
->
response
(
"200"
,
"数据保存成功"
,
$result
[
"msg"
]);
}
return
$this
->
response
(
"101"
,
"数据保存失败"
);
}
}
application/api/controller/TradeLog.php
0 → 100644
View file @
25baa234
<?php
namespace
app\api\controller
;
use
app\api\extend\Basic
;
use
app\model\HouseImgs
;
use
app\model\JournalAccounts
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2017/12/12
* Time : 17:24
* Intro:
*/
class
TradeLog
extends
Basic
{
protected
$journalAccountsMode
;
protected
$dbImg
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
journalAccountsMode
=
new
JournalAccounts
();
$this
->
dbImg
=
new
HouseImgs
();
}
public
function
getTradeList
()
{
$params
=
$this
->
params
;
$param
=
array
(
"phone"
=>
"158****6165"
,
"pageNo"
=>
1
,
"pageSize"
=>
15
,
);
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$order_
=
'a.created desc'
;
$field
=
"a.id,a.tradecode,a.singntime,b.phpone,b.house_id"
;
$result
=
$this
->
journalAccountsMode
->
getJournalAccountsList
(
$pageNo
,
$pageSize
,
$order_
,
$field
,
$param
);
foreach
(
$result
as
$key
=>
$val
)
{
$result
[
$key
][
"api_path"
]
=
IMG_PATH
;
$param
[
"house_id"
]
=
$val
[
"id"
];
$param
[
"imgtype"
]
=
1
;
//默认主图
$result
[
$key
][
"images"
]
=
$this
->
dbImg
->
getHouseImages
(
$param
,
1
);
}
}
}
\ No newline at end of file
application/model/HouseInfos.php
View file @
25baa234
...
...
@@ -78,7 +78,7 @@ class HouseInfos extends Model
return
$data
=
$this
->
dbHouseInfo
->
field
(
$field
)
->
where
(
$params
)
->
group
()
->
group
(
$group
)
->
select
();
}
...
...
application/model/Labels.php
View file @
25baa234
...
...
@@ -6,5 +6,19 @@ use think\Model;
class
Labels
extends
Model
{
//
// 设置当前模型对应的完整数据表名称
protected
$table
=
'labels'
;
protected
$db
;
function
__construct
()
{
$this
->
db
=
Db
(
$this
->
table
);
}
public
function
getLabels
()
{
return
$data
=
$this
->
db
->
field
(
"id,name"
)
->
select
();
}
}
application/model/SubletModel.php
View file @
25baa234
...
...
@@ -15,11 +15,17 @@ class SubletModel extends Model
$this
->
db
=
Db
(
$this
->
table
);
}
public
function
addSublet
(
$param
s
)
public
function
addSublet
(
$param
)
{
//todo 新增
Db
::
startTrans
();
try
{
$id
=
$this
->
save
(
$param
);
Db
::
commit
();
return
[
"code"
=>
"200"
,
"msg"
=>
$id
];
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
[
"code"
=>
"101"
,
"msg"
=>
"失败,数据异常"
];
}
}
...
...
application/route.php
View file @
25baa234
...
...
@@ -65,7 +65,7 @@ Route::group('api',[
// shop
'shopList'
=>
[
'api/shop/getShopList'
,
[
'method'
=>
'post'
]],
'filtrateCondition'
=>
[
'api/shop/filtrateCondition'
,
[
'method'
=>
'post'
]],
'filtrateCondition'
=>
[
'api/shop/filtrateCondition'
,
[
'method'
=>
'
get |
post'
]],
'shopDetail'
=>
[
'api/shop/getShopDetail'
,
[
'method'
=>
'get'
]],
//get banner
...
...
@@ -79,6 +79,10 @@ Route::group('api',[
'getAppointmentSeeShopList'
=>
[
'api/appointmentTime/getAppointmentSeeShopList'
,[
'method'
=>
'post'
]],
//tradeLog
'getTradeList'
=>
[
'api/TradeLog/getTradeList'
,[
'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