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
49ef53ed
Commit
49ef53ed
authored
Nov 21, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的预约看铺
parent
47648f06
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
97 additions
and
153 deletions
+97
-153
AppointmentTime.php
application/api/controller/AppointmentTime.php
+10
-3
AppointmentShop.php
application/api_broker/controller/AppointmentShop.php
+51
-0
Shop.php
application/api_broker/controller/Shop.php
+1
-1
AppointWatchShop.php
application/model/AppointWatchShop.php
+24
-0
GHouses.php
application/model/GHouses.php
+10
-0
HouseInfos.php
application/model/HouseInfos.php
+0
-116
HouseinfoExts.php
application/model/HouseinfoExts.php
+0
-33
route.php
application/route.php
+1
-0
No files found.
application/api/controller/AppointmentTime.php
View file @
49ef53ed
...
...
@@ -8,11 +8,11 @@ use app\model\AppointWatchShop;
use
app\model\Evaluate
;
use
app\model\GHouses
;
use
app\model\GHousesImgs
;
use
app\model\GHousesToAgents
;
use
app\model\GImageDepot
;
use
app\model\HouseInfos
;
use
app\model\OReportModel
;
use
think\helper\Time
;
use
app\model\HouseImgs
;
use
app\model\Users
;
/**
* Created by PhpStorm.
...
...
@@ -81,6 +81,12 @@ class AppointmentTime extends Basic
if
(
!
isset
(
$params
[
"expect_time"
])
||
$params
[
'expect_time'
]
<=
time
())
{
return
$this
->
response
(
"101"
,
"预约时间为空,或者小于当前时间"
);
}
$m_user
=
new
Users
();
$appoint_agent_id
=
$m_user
->
getUserByWhereValue
(
'agent_id'
,
[
'id'
=>
$this
->
userId
]);
if
(
empty
(
$appoint_agent_id
))
{
$m_house_agent
=
new
GHousesToAgents
();
$appoint_agent_id
=
$m_house_agent
->
getAgentHouseValue
(
'agents_id'
,[
'houses_id'
=>
$params
[
"house_id"
],
'type'
=>
2
]);
}
$addPrams
=
array
(
'expect_time'
=>
date
(
"Y-m-d H:i:s"
,
$params
[
"expect_time"
]
/
1000
),
'phone'
=>
$params
[
"phone"
],
...
...
@@ -90,7 +96,8 @@ class AppointmentTime extends Basic
'user_id'
=>
$params
[
"user_id"
],
'other_require'
=>
$params
[
"other_require"
],
'create_time'
=>
date
(
"Y-m-d H:i:s"
,
time
()),
'update_time'
=>
date
(
"Y-m-d H:i:s"
,
time
())
'update_time'
=>
date
(
"Y-m-d H:i:s"
,
time
()),
'appoint_agent_id'
=>
$appoint_agent_id
);
$result
=
$this
->
appointmentTimeModel
->
insertAppointWatchShop
(
$addPrams
);
if
(
$result
[
"code"
]
==
200
)
{
...
...
application/api_broker/controller/AppointmentShop.php
0 → 100644
View file @
49ef53ed
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/11/20
* Time: 16:28
*/
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\model\AppointWatchShop
;
use
app\model\GHouses
;
use
app\model\HouseInfos
;
use
app\model\Users
;
use
think\Request
;
class
AppointmentShop
extends
Basic
{
private
$m_watch
;
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
m_watch
=
new
AppointWatchShop
();
}
/**
* 我的客户预约看铺
*
* @return \think\Response
*/
public
function
getOurAppointment
()
{
$where
[
'a.appoint_agent_id'
]
=
1
;
// $where['a.appoint_agent_id'] = $this->agentId;
$where
[
'a.is_cancel'
]
=
0
;
$page_no
=
empty
(
$this
->
params
[
'page_no'
])
?
1
:
$this
->
params
[
'page_no'
];
$page_size
=
empty
(
$this
->
params
[
'page_size'
])
?
15
:
$this
->
params
[
'page_size'
];
$field
=
'a.house_id,a.appellation,a.phone,a.expect_time,a.other_require,b.create_time,'
;
$field
.=
'b.user_name,b.id as use_id'
;
$list
=
$this
->
m_watch
->
getAppointWatchOur
(
$page_no
,
$page_size
,
'a.id desc'
,
$field
,
$where
);
$m_house
=
new
GHouses
();
foreach
(
$list
as
$k
=>
$v
)
{
$list
[
$k
][
'house_title'
]
=
$m_house
->
getHouseValue
(
'internal_title'
,
[
'id'
=>
$v
[
'house_id'
]]);
}
return
$this
->
response
(
200
,
''
,
$list
);
}
}
\ No newline at end of file
application/api_broker/controller/Shop.php
View file @
49ef53ed
...
...
@@ -101,7 +101,7 @@ class Shop extends Basic
// $field = "id,internal_title as title,internal_address as address,city,disc,business_district_id,status,industry_type
$field
=
"id,internal_title as title,internal_address as address,city,disc,business_district_id,status,industry_type
,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,rent_price,is_lock
,is_exclusive_type,is_vip"
;
,is_exclusive_type,is_vip
,fit_industry_type
"
;
if
(
empty
(
$params
[
"city"
])){
$conditions
[
"city"
]
=
trim
(
$this
->
city
);
}
else
{
...
...
application/model/AppointWatchShop.php
View file @
49ef53ed
...
...
@@ -157,4 +157,28 @@ class AppointWatchShop extends BaseModel
->
where
(
$params
)
->
find
();
}
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAppointWatchOur
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_users b'
,
'a.user_id=b.id'
,
'left'
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
}
application/model/GHouses.php
View file @
49ef53ed
...
...
@@ -1616,4 +1616,14 @@ class GHouses extends BaseModel
//echo $this->getLastSql();
return
$result
;
}
/**
* @param $field
* @param $where
* @return mixed
*/
public
function
getHouseValue
(
$field
,
$where
)
{
return
$this
->
where
(
$where
)
->
value
(
$field
);
}
}
application/model/HouseInfos.php
deleted
100755 → 0
View file @
47648f06
<?php
namespace
app\model
;
use
think\Model
;
class
HouseInfos
extends
Model
{
protected
$table
=
'houseinfos'
;
protected
$dbHouseInfo
;
function
__construct
()
{
$this
->
dbHouseInfo
=
Db
(
$this
->
table
);
}
/**
* 获取商铺列表
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
function
getHouseInfoList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$spTagsArr
)
{
return
$this
->
dbHouseInfo
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
'houseinfo_exts b'
,
'a.id = b.house_id'
,
'LEFT'
)
->
where
(
$params
)
->
where
(
function
(
$query
)
use
(
$spTagsArr
)
{
$query
->
whereOr
(
$spTagsArr
);
})
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
/**
* 获取月均价
* @return float
*/
function
getAveragePrice
()
{
//price
$params
[
'rent_type'
]
=
array
(
"eq"
,
3
);
//1.月租金 2.营业额扣点 3.每平方米租金
$params
[
'room_num_left'
]
=
array
(
"<>"
,
0
);
//剩余店铺为0的不算
$sumPrice
=
$this
->
dbHouseInfo
->
where
(
$params
)
->
sum
(
"price"
);
$count_
=
$this
->
dbHouseInfo
->
field
(
"id"
)
->
where
(
$params
)
->
count
(
"id"
);
$averagePrice
=
round
(
$sumPrice
/
$count_
);
return
$averagePrice
;
}
/**
* 获取商铺详情
* @param $field
* @param $params
* @return mixed
*/
function
getHouseDetail
(
$field
,
$params
)
{
return
$data
=
$this
->
dbHouseInfo
->
field
(
$field
)
->
where
(
$params
)
->
find
(
$params
[
"id"
]);
}
/**
* 获取商铺详情 关联表
* @param $field
* @param $params
* @return mixed
*/
function
getHouseDetails
(
$field
,
$params
)
{
return
$data
=
$this
->
dbHouseInfo
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
'houseinfo_exts b'
,
'a.id = b.house_id'
,
'LEFT'
)
->
where
(
$params
)
->
find
(
$params
[
"a.id"
]);
}
function
getCityList
(
$field
,
$params
,
$group
)
{
return
$data
=
$this
->
dbHouseInfo
->
field
(
$field
)
->
where
(
$params
)
->
group
(
$group
)
->
select
();
}
function
getHousepusmessage
(
$id
)
{
$HouseInfosre
=
$this
->
dbHouseInfo
->
where
(
'id'
,
$id
)
->
field
(
'id,title,room_area,room_area2,price,rent_type'
)
->
select
();
return
$HouseInfosre
;
}
}
application/model/HouseinfoExts.php
deleted
100644 → 0
View file @
47648f06
<?php
namespace
app\model
;
use
think\Model
;
class
HouseinfoExts
extends
Model
{
protected
$table
=
'houseinfo_exts'
;
protected
$HouseinfoExts
;
function
__construct
()
{
$this
->
HouseinfoExts
=
Db
(
$this
->
table
);
}
function
getHouse_ext
(
$id
)
{
$HouseinfoExtsInfosre
=
$this
->
HouseinfoExts
->
where
(
'house_id'
,
$id
)
//->field('id,house_id,foreign_name,address_detail_c,province_c,province_code,city_c,city_code,district_c,district_code,foreign_advantage,created,modified')
->
select
();
return
$HouseinfoExtsInfosre
;
}
}
application/route.php
View file @
49ef53ed
...
...
@@ -691,6 +691,7 @@ Route::group('broker', [
'getAgentSiteList'
=>
[
'api_broker/Site/getAgentSiteList'
,
[
'method'
=>
'POST|GET'
]
],
//获取经纪人站点列表
'getPhoneBook'
=>
[
'api_broker/Agent/getPhoneBook'
,
[
'method'
=>
'POST|GET'
]
],
//消息页面--通讯录
'commentAndDeal'
=>
[
'api_broker/broker/commentAndDeal'
,
[
'method'
=>
'get'
]
],
//获取当前经纪人的评价和交易列表
'getOurAppointment'
=>
[
'api_broker/AppointmentShop/getOurAppointment'
,
[
'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