Commit 594f793e authored by clone's avatar clone

bug

parent a6c2240b
......@@ -4,6 +4,7 @@ namespace app\api\controller;
use app\api\extend\Basic;
use app\model\AttentionModel;
use app\model\GHousesImgs;
use think\Request;
use app\model\HouseImgs;
......@@ -19,12 +20,14 @@ class AttentionShop extends Basic
protected $attentionModel;
protected $dbImg;
protected $imgModel;
public function __construct($request = null)
{
parent::__construct($request);
$this->attentionModel = new AttentionModel();
$this->dbImg = new HouseImgs();
$this->imgModel = new GHousesImgs();
}
/**
......@@ -61,20 +64,20 @@ class AttentionShop extends Basic
*/
public function attentionList()
{
$params = $this->params;
/* $params = array(
"user_id" => 47,
"pageNo" => 1,
"pageSize" => 15,
);*/
$params = $this->params;
$params = array(
"user_id" => 122,
"pageNo" => 1,
"pageSize" => 15,
);
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$order_ = 'a.create_time desc';
//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
,b.rent_type,c.foreign_name";
$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.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"])) {
return $this->response("101", "用户id不能为空");
......@@ -88,12 +91,11 @@ class AttentionShop extends Basic
foreach ($result as $key => $val) {
$result[$key]["api_path"] = IMG_PATH;
$imgParam["house_id"] = $val["house_id"];
$imgParam["imgtype"] = 1; //默认主图
$imgArr = $this->dbImg->getHouseImages($imgParam, 1);
$imgParam["img_type"] = 1; //默认主图
$imgArr = $this->imgModel->getHouseImages($imgParam, 1);
$result[$key]["images"] = $imgArr;
}
return $this->response("200", "request success", $result);
}
......
......@@ -92,11 +92,11 @@ class AttentionModel extends Model
$params["a.user_id"] = $param["user_id"];
$params["a.is_del"] = $param["is_del"];
//$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)
->alias("a")
->join('houseinfos b', 'a.house_id = b.id', 'LEFT')
->join('houseinfo_exts c', 'c.house_id = b.id', 'LEFT')
->join('g_houses b', 'a.house_id = b.id', 'LEFT')
->join('g_houses_imgs c', 'c.house_id = b.id', 'LEFT')
->where($params)
->order($order_)
->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