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
eb797f9b
Commit
eb797f9b
authored
Dec 18, 2017
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug预约看铺
parent
937256f8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
18 deletions
+27
-18
AppointmentTime.php
application/api/controller/AppointmentTime.php
+23
-13
AttentionShop.php
application/api/controller/AttentionShop.php
+2
-2
AttentionModel.php
application/model/AttentionModel.php
+2
-3
No files found.
application/api/controller/AppointmentTime.php
View file @
eb797f9b
...
@@ -38,21 +38,19 @@ class AppointmentTime extends Basic
...
@@ -38,21 +38,19 @@ class AppointmentTime extends Basic
public
function
addAppointmentSeeShop
()
public
function
addAppointmentSeeShop
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
/*
$params = array(
"user_id" => 1,
"user_id" => 1,
"house_id" => 1,
"house_id" => 1,
"house_title" => "楼盘1",
"house_title" => "楼盘1",
"appellation" => "张三",
"appellation" => "张三",
"phone" => "13817616312",
"phone" => "13817616312",
"expect_time" => time() + 1000,
"expect_time" => time() + 1000,
"other_require" => "没有其他要求"
"other_require" => "没有其他要求"
);*/
);*/
//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"
];
//$where_["title"] = $params["title"];
// $where_['show_all'] = array( 'eq', 0 );
$houseInfo
=
$this
->
houseInfoModel
->
getHouseDetail
(
"id"
,
$where_
);
$houseInfo
=
$this
->
houseInfoModel
->
getHouseDetail
(
"id"
,
$where_
);
if
(
count
(
$houseInfo
)
<=
0
)
{
if
(
count
(
$houseInfo
)
<=
0
)
{
return
$this
->
response
(
"101"
,
"楼盘ID或楼盘名错误"
);
return
$this
->
response
(
"101"
,
"楼盘ID或楼盘名错误"
);
...
@@ -68,12 +66,24 @@ class AppointmentTime extends Basic
...
@@ -68,12 +66,24 @@ class AppointmentTime extends Basic
if
(
!
isset
(
$params
[
"expect_time"
])
||
$params
[
'expect_time'
]
<=
time
())
{
if
(
!
isset
(
$params
[
"expect_time"
])
||
$params
[
'expect_time'
]
<=
time
())
{
return
$this
->
response
(
"101"
,
"预约时间为空,或者小于当前时间"
);
return
$this
->
response
(
"101"
,
"预约时间为空,或者小于当前时间"
);
}
}
$result
=
$this
->
appointmentTimeModel
->
insertAppointWatchShop
(
$params
);
$addPrams
=
array
(
'expect_time'
=>
date
(
"Y-m-d H:i:s"
,
strtotime
(
$params
[
"expect_time"
]
/
1000
)),
'phone'
=>
$params
[
"phone"
],
'house_title'
=>
$params
[
"house_title"
],
'house_id'
=>
$params
[
"house_id"
],
'appellation'
=>
$params
[
"appellation"
],
'user_id'
=>
$params
[
"user_id"
],
'create_time'
=>
date
(
"Y-m-d H:i:s"
,
time
()),
'update_time'
=>
date
(
"Y-m-d H:i:s"
,
time
())
);
$result
=
$this
->
appointmentTimeModel
->
insertAppointWatchShop
(
$addPrams
);
if
(
$result
[
"code"
]
==
200
)
{
if
(
$result
[
"code"
]
==
200
)
{
return
$this
->
response
(
"200"
,
"数据保存成功"
,
$result
[
"msg"
]);
return
$this
->
response
(
"200"
,
"数据保存成功"
,
$result
[
"msg"
]);
}
else
{
return
$this
->
response
(
"101"
,
"数据保存失败"
);
}
}
return
$this
->
response
(
"101"
,
"数据保存失败"
);
}
}
...
...
application/api/controller/AttentionShop.php
View file @
eb797f9b
...
@@ -31,12 +31,12 @@ class AttentionShop extends Basic
...
@@ -31,12 +31,12 @@ class AttentionShop extends Basic
public
function
addOrUpdateAttention
()
public
function
addOrUpdateAttention
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
$params
=
array
(
/*
$params = array(
// "id" => 2,
// "id" => 2,
"user_id" => 3,
"user_id" => 3,
"house_id" => 2,
"house_id" => 2,
// "is_del" => 0
// "is_del" => 0
);
);
*/
$msg
=
isset
(
$params
[
'id'
])
?
"修改"
:
"新增"
;
$msg
=
isset
(
$params
[
'id'
])
?
"修改"
:
"新增"
;
$result
=
$this
->
attentionModel
->
addOrUpdateAttentionShop
(
$params
);
$result
=
$this
->
attentionModel
->
addOrUpdateAttentionShop
(
$params
);
if
(
$result
[
'code'
]
==
200
)
{
if
(
$result
[
'code'
]
==
200
)
{
...
...
application/model/AttentionModel.php
View file @
eb797f9b
...
@@ -31,9 +31,7 @@ class AttentionModel extends Model
...
@@ -31,9 +31,7 @@ class AttentionModel extends Model
if
(
isset
(
$params
[
'house_id'
]))
{
if
(
isset
(
$params
[
'house_id'
]))
{
$arr
[
"house_id"
]
=
$params
[
'house_id'
];
$arr
[
"house_id"
]
=
$params
[
'house_id'
];
}
}
if
(
isset
(
$params
[
'is_del'
]))
{
$arr
[
"is_del"
]
=
$params
[
'is_del'
];
}
$saveWhere
=
array
();
$saveWhere
=
array
();
if
(
isset
(
$params
[
'id'
]))
{
//取消关注
if
(
isset
(
$params
[
'id'
]))
{
//取消关注
...
@@ -42,6 +40,7 @@ class AttentionModel extends Model
...
@@ -42,6 +40,7 @@ class AttentionModel extends Model
->
select
();
->
select
();
if
(
count
(
$result
)
>
0
)
{
if
(
count
(
$result
)
>
0
)
{
$saveWhere
[
"id"
]
=
$params
[
"id"
];
$saveWhere
[
"id"
]
=
$params
[
"id"
];
$arr
[
"is_del"
]
=
1
;
}
else
{
}
else
{
return
[
"code"
=>
"101"
,
"msg"
=>
"数据不存在"
];
return
[
"code"
=>
"101"
,
"msg"
=>
"数据不存在"
];
}
}
...
...
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