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
298f47ae
Commit
298f47ae
authored
Jul 08, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预约楼盘客方
parent
e26fc5bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
AppointmentTime.php
application/api/controller/AppointmentTime.php
+5
-3
Users.php
application/model/Users.php
+17
-0
No files found.
application/api/controller/AppointmentTime.php
View file @
298f47ae
...
@@ -67,7 +67,7 @@ class AppointmentTime extends Basic
...
@@ -67,7 +67,7 @@ class AppointmentTime extends Basic
//todo 验证楼盘信息
//todo 验证楼盘信息
if
(
isset
(
$params
[
"house_id"
])
&&
isset
(
$params
[
"house_title"
]))
{
if
(
isset
(
$params
[
"house_id"
])
&&
isset
(
$params
[
"house_title"
]))
{
$where_
[
"id"
]
=
$params
[
"house_id"
];
$where_
[
"id"
]
=
$params
[
"house_id"
];
$houseInfo
=
$this
->
houseInfoModel
->
getHouseDetail
(
"id"
,
$where_
);
$houseInfo
=
$this
->
houseInfoModel
->
getHouseDetail
(
"id
,city
"
,
$where_
);
if
(
count
(
$houseInfo
)
<=
0
)
{
if
(
count
(
$houseInfo
)
<=
0
)
{
return
$this
->
response
(
"101"
,
"楼盘ID或楼盘名错误"
);
return
$this
->
response
(
"101"
,
"楼盘ID或楼盘名错误"
);
}
}
...
@@ -83,10 +83,12 @@ class AppointmentTime extends Basic
...
@@ -83,10 +83,12 @@ class AppointmentTime extends Basic
return
$this
->
response
(
"101"
,
"预约时间为空,或者小于当前时间"
);
return
$this
->
response
(
"101"
,
"预约时间为空,或者小于当前时间"
);
}
}
$m_user
=
new
Users
();
$m_user
=
new
Users
();
$appoint_agent_id
=
$m_user
->
get
UserByWhereValue
(
'agent_id'
,
[
'id'
=>
$this
->
userId
]);
$appoint_agent_id
=
$m_user
->
get
AgentBySiteIdCity
(
'c.id'
,
[
'a.id'
=>
$this
->
userId
,
'd.city'
=>
$houseInfo
[
'city'
]
]);
if
(
empty
(
$appoint_agent_id
))
{
if
(
empty
(
$appoint_agent_id
[
'id'
]
))
{
$m_house_agent
=
new
GHousesToAgents
();
$m_house_agent
=
new
GHousesToAgents
();
$appoint_agent_id
=
$m_house_agent
->
getAgentHouseValue
(
'agents_id'
,[
'houses_id'
=>
$params
[
"house_id"
],
'type'
=>
2
]);
$appoint_agent_id
=
$m_house_agent
->
getAgentHouseValue
(
'agents_id'
,[
'houses_id'
=>
$params
[
"house_id"
],
'type'
=>
2
]);
}
else
{
$appoint_agent_id
=
$appoint_agent_id
[
'id'
];
}
}
$addPrams
=
array
(
$addPrams
=
array
(
'expect_time'
=>
date
(
"Y-m-d H:i:s"
,
$params
[
"expect_time"
]
/
1000
),
'expect_time'
=>
date
(
"Y-m-d H:i:s"
,
$params
[
"expect_time"
]
/
1000
),
...
...
application/model/Users.php
View file @
298f47ae
...
@@ -1096,5 +1096,22 @@ class Users extends Model
...
@@ -1096,5 +1096,22 @@ class Users extends Model
->
limit
(
1
)
->
limit
(
1
)
->
select
();
->
select
();
}
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAgentBySiteIdCity
(
$field
,
$params
){
return
Db
::
name
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"u_user_agent b"
,
"a.id = b.user_id"
,
"left"
)
->
join
(
"a_agents c"
,
"a.agent_id=b.id"
,
"left"
)
->
join
(
'a_site d'
,
'c.site_id = d.id'
,
'left'
)
->
where
(
$params
)
->
limit
(
1
)
->
select
();
}
}
}
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