Commit 594f793e authored by clone's avatar clone

bug

parent a6c2240b
...@@ -4,6 +4,7 @@ namespace app\api\controller; ...@@ -4,6 +4,7 @@ namespace app\api\controller;
use app\api\extend\Basic; use app\api\extend\Basic;
use app\model\AttentionModel; use app\model\AttentionModel;
use app\model\GHousesImgs;
use think\Request; use think\Request;
use app\model\HouseImgs; use app\model\HouseImgs;
...@@ -19,12 +20,14 @@ class AttentionShop extends Basic ...@@ -19,12 +20,14 @@ class AttentionShop extends Basic
protected $attentionModel; protected $attentionModel;
protected $dbImg; protected $dbImg;
protected $imgModel;
public function __construct($request = null) public function __construct($request = null)
{ {
parent::__construct($request); parent::__construct($request);
$this->attentionModel = new AttentionModel(); $this->attentionModel = new AttentionModel();
$this->dbImg = new HouseImgs(); $this->dbImg = new HouseImgs();
$this->imgModel = new GHousesImgs();
} }
/** /**
...@@ -61,20 +64,20 @@ class AttentionShop extends Basic ...@@ -61,20 +64,20 @@ class AttentionShop extends Basic
*/ */
public function attentionList() public function attentionList()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( $params = array(
"user_id" => 47, "user_id" => 122,
"pageNo" => 1, "pageNo" => 1,
"pageSize" => 15, "pageSize" => 15,
);*/ );
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo']; $pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize']; $pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$order_ = 'a.create_time desc'; $order_ = 'a.create_time desc';
//b.room_num_left 前端显示已下架,不可点击到详情 //b.room_num_left 前端显示已下架,不可点击到详情
$field = "a.id,a.house_id,b.title,b.room_area,b.room_area2,b.price,b.shangpu_tags,b.shangpu_type,b.room_num_left $field = "a.id,a.house_id,b.external_title,b.shop_area_start as room_area,b.shop_area_end as room_area2,b.rent_price as price,
,b.rent_type,c.foreign_name"; b.shop_sign as shangpu_tags,b.shop_type as shangpu_type,b.residue_num as room_num_left,b.rent_type";
if (!isset($params["user_id"])) { if (!isset($params["user_id"])) {
return $this->response("101", "用户id不能为空"); return $this->response("101", "用户id不能为空");
...@@ -88,12 +91,11 @@ class AttentionShop extends Basic ...@@ -88,12 +91,11 @@ class AttentionShop extends Basic
foreach ($result as $key => $val) { foreach ($result as $key => $val) {
$result[$key]["api_path"] = IMG_PATH; $result[$key]["api_path"] = IMG_PATH;
$imgParam["house_id"] = $val["house_id"]; $imgParam["house_id"] = $val["house_id"];
$imgParam["imgtype"] = 1; //默认主图 $imgParam["img_type"] = 1; //默认主图
$imgArr = $this->dbImg->getHouseImages($imgParam, 1); $imgArr = $this->imgModel->getHouseImages($imgParam, 1);
$result[$key]["images"] = $imgArr; $result[$key]["images"] = $imgArr;
} }
return $this->response("200", "request success", $result); return $this->response("200", "request success", $result);
} }
......
...@@ -92,11 +92,11 @@ class AttentionModel extends Model ...@@ -92,11 +92,11 @@ class AttentionModel extends Model
$params["a.user_id"] = $param["user_id"]; $params["a.user_id"] = $param["user_id"];
$params["a.is_del"] = $param["is_del"]; $params["a.is_del"] = $param["is_del"];
//$params["b.room_num_left"] = array( "<>", 0 ); //剩余数为0 的商品不显示 //$params["b.room_num_left"] = array( "<>", 0 ); //剩余数为0 的商品不显示
$params["b.show_all"] = array( "eq", 0 ); //只显示公开的楼盘 $params["b.is_show"] = array( "eq", 0 ); //只显示公开的楼盘
return $this->field($field) return $this->field($field)
->alias("a") ->alias("a")
->join('houseinfos b', 'a.house_id = b.id', 'LEFT') ->join('g_houses b', 'a.house_id = b.id', 'LEFT')
->join('houseinfo_exts c', 'c.house_id = b.id', 'LEFT') ->join('g_houses_imgs c', 'c.house_id = b.id', 'LEFT')
->where($params) ->where($params)
->order($order_) ->order($order_)
->limit($pageSize) ->limit($pageSize)
......
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