Commit b86340a8 authored by clone's avatar clone

预约看铺bug

parent 193be7ef
...@@ -44,15 +44,15 @@ class AppointmentTime extends Basic ...@@ -44,15 +44,15 @@ class AppointmentTime extends Basic
"house_title" => "楼盘1", "house_title" => "楼盘1",
"appellation" => "张三", "appellation" => "张三",
"phone" => "13817616312", "phone" => "13817616312",
"expect_time" => time(), "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_["title"] = $params["title"];
$where_['show_all'] = array( 'eq', 0 ); // $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或楼盘名错误");
...@@ -65,7 +65,7 @@ class AppointmentTime extends Basic ...@@ -65,7 +65,7 @@ class AppointmentTime extends Basic
return $this->response("101", "手机号为空或手机号无效"); return $this->response("101", "手机号为空或手机号无效");
} }
if (!isset($params["expect_time"]) || $params['expect_time'] <= Time::today()) { if (!isset($params["expect_time"]) || $params['expect_time'] <= time()) {
return $this->response("101", "预约时间为空,或者小于当前时间"); return $this->response("101", "预约时间为空,或者小于当前时间");
} }
$result = $this->appointmentTimeModel->insertAppointWatchShop($params); $result = $this->appointmentTimeModel->insertAppointWatchShop($params);
...@@ -121,10 +121,10 @@ class AppointmentTime extends Basic ...@@ -121,10 +121,10 @@ class AppointmentTime extends Basic
} }
if(count($result) > 0 ){ if (count($result) > 0) {
return $this->response("200","request success" ,$result); return $this->response("200", "request success", $result);
}else{ } else {
return $this->response("200","此条件没有找到数据" ); return $this->response("200", "此条件没有找到数据");
} }
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace app\model; namespace app\model;
use think\Model; use think\Model;
use think\Db;
class AppointWatchShop extends Model class AppointWatchShop extends Model
{ {
...@@ -21,10 +22,9 @@ class AppointWatchShop extends Model ...@@ -21,10 +22,9 @@ class AppointWatchShop extends Model
*/ */
public function insertAppointWatchShop($arr) public function insertAppointWatchShop($arr)
{ {
$appointWatchShop = $this->db;
Db::startTrans(); Db::startTrans();
try { try {
$id = $appointWatchShop->save($arr); $id = $this->save($arr);
Db::commit(); Db::commit();
return [ "code" => "200", "msg" => $id ]; return [ "code" => "200", "msg" => $id ];
} catch (\Exception $e) { } catch (\Exception $e) {
...@@ -43,7 +43,7 @@ class AppointWatchShop extends Model ...@@ -43,7 +43,7 @@ class AppointWatchShop extends Model
*/ */
public function getAppointWatchShopList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params) public function getAppointWatchShopList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params)
{ {
return $this->db return $this
->field($field) ->field($field)
->where($params) ->where($params)
->order($order_) ->order($order_)
......
...@@ -95,7 +95,7 @@ Route::group('api', [ ...@@ -95,7 +95,7 @@ Route::group('api', [
//post AppointmentTime //post AppointmentTime
'getAppointmentSeeShopList' => [ 'api/appointmentTime/getAppointmentSeeShopList', [ 'method' => 'post' ] ], 'getAppointmentSeeShopList' => [ 'api/appointmentTime/getAppointmentSeeShopList', [ 'method' => 'post' ] ],
'addAppointmentSeeShop' => [ 'api/appointmentTime/addAppointmentSeeShop', [ 'method' => 'post' ] ], 'addAppointmentSeeShop' => [ 'api/appointmentTime/addAppointmentSeeShop', [ 'method' => 'post|get' ] ],
//tradeLog //tradeLog
......
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