Commit 25c26998 authored by clone's avatar clone

预约看铺列表

parent 8a844696
......@@ -6,6 +6,7 @@ use app\api\extend\Basic;
use app\model\AppointWatchShop;
use app\model\HouseInfos;
use think\helper\Time;
use app\model\HouseImgs;
/**
* Created by PhpStorm.
......@@ -20,12 +21,14 @@ class AppointmentTime extends Basic
protected $db;
protected $appointmentTimeModel;
protected $houseInfoModel;
protected $dbImg;
function __construct($request = null)
{
parent::__construct($request);
$this->appointmentTimeModel = new AppointWatchShop();
$this->houseInfoModel = new HouseInfos();
$this->dbImg = new HouseImgs();
}
/**
......@@ -72,6 +75,10 @@ class AppointmentTime extends Basic
}
/**查询预约看铺列表
*
* @return \think\Response
*/
public function getAppointmentSeeShopList()
{
/* $params = array(
......@@ -82,7 +89,9 @@ class AppointmentTime extends Basic
);*/
$params = $this->params;
$field = "id,user_id,agent_id,house_id,house_title,appellation,phone,expect_time,other_require,status,
$field = "id,user_id,agents_id,house_id,house_title,appellation,phone,expect_time,other_require,status,
is_cancel,is_evaluate,create_time";
......@@ -97,10 +106,19 @@ class AppointmentTime extends Basic
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$where_["status"] = array( "in", $params["status"] );
$where_["status"] = array( "eq", $params["status"] );
$where_["user_id"] = array( "eq", $params["user_id"] );
$result = $this->appointmentTimeModel->getAppointWatchShopList($pageNo, $pageSize, "id desc", $field, $where_);
//获取图片信息
foreach ($result as $key => $val) {
$result[$key]["api_path"] = IMG_PATH;
$param["house_id"] = $val["house_id"];
$param["imgtype"] = 1; //默认主图
$result[$key]["images"] = $this->dbImg->getHouseImages($param, 1);
}
if(count($result) > 0 ){
return $this->response("200","request success" ,$result);
}else{
......
......@@ -43,7 +43,7 @@ class AppointWatchShop extends Model
*/
public function getAppointWatchShopList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params)
{
return $data = $this->db
return $this->db
->field($field)
->where($params)
->order($order_)
......
......@@ -66,8 +66,14 @@ Route::group('api',[
//get banner
'bannerList' => ['api/banner/getBannerList', ['method' => 'get']],
//get averagePriceAndTurnover
'averagePriceAndTurnover' => ['api/index/averagePriceAndTurnover',['method' => 'get']]
//get index
'averagePriceAndTurnover' => ['api/index/averagePriceAndTurnover',['method' => 'get']],
//post AppointmentTime
'getAppointmentSeeShopList' => ['api/appointmentTime/getAppointmentSeeShopList',['method' => 'post']],
......
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