Commit eb797f9b authored by clone's avatar clone

bug预约看铺

parent 937256f8
......@@ -51,8 +51,6 @@ class AppointmentTime extends Basic
//todo 验证楼盘信息
if (isset($params["house_id"]) && isset($params["house_title"])) {
$where_["id"] = $params["house_id"];
//$where_["title"] = $params["title"];
// $where_['show_all'] = array( 'eq', 0 );
$houseInfo = $this->houseInfoModel->getHouseDetail("id", $where_);
if (count($houseInfo) <= 0) {
return $this->response("101", "楼盘ID或楼盘名错误");
......@@ -68,12 +66,24 @@ class AppointmentTime extends Basic
if (!isset($params["expect_time"]) || $params['expect_time'] <= time()) {
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) {
return $this->response("200", "数据保存成功", $result["msg"]);
}else{
return $this->response("101", "数据保存失败");
}
return $this->response("101", "数据保存失败");
}
......
......@@ -31,12 +31,12 @@ class AttentionShop extends Basic
public function addOrUpdateAttention()
{
$params = $this->params;
$params = array(
/* $params = array(
// "id" => 2,
"user_id" => 3,
"house_id" => 2,
// "is_del" => 0
);
);*/
$msg = isset($params['id']) ? "修改" : "新增";
$result = $this->attentionModel->addOrUpdateAttentionShop($params);
if ($result['code'] == 200) {
......
......@@ -31,9 +31,7 @@ class AttentionModel extends Model
if (isset($params['house_id'])) {
$arr["house_id"] = $params['house_id'];
}
if (isset($params['is_del'])) {
$arr["is_del"] = $params['is_del'];
}
$saveWhere = array();
if (isset($params['id'])) { //取消关注
......@@ -42,6 +40,7 @@ class AttentionModel extends Model
->select();
if (count($result) > 0) {
$saveWhere["id"] = $params["id"];
$arr["is_del"] = 1;
} else {
return [ "code" => "101", "msg" => "数据不存在" ];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment