Commit eb797f9b authored by clone's avatar clone

bug预约看铺

parent 937256f8
...@@ -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", "数据保存失败");
} }
......
...@@ -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) {
......
...@@ -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" => "数据不存在" ];
} }
......
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