Commit 8ee9c683 authored by zhuwei's avatar zhuwei

bug

parent 5a9d010f
......@@ -96,6 +96,9 @@ class CollectHouse extends Basic
return $this->response("101", "请求参数错误");
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
/**
* id : 4
* title : vvvv
......@@ -125,7 +128,7 @@ class CollectHouse extends Basic
$field .= 'Houses.rent_price';
$get_params['agents_id'] = $params["agents_id"];
$res = $this->aCollectHouse->getCollectList($field,$get_params);
$res = $this->aCollectHouse->getCollectList($pageNo,$pageSize,$field,$get_params);
$look_shop_service = new LookShopService();
foreach ($res as $key => $val) {
$isLook = $look_shop_service->isLooked($params["agents_id"], $val["house_id"]);
......
......@@ -11,6 +11,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\VipService;
use app\model\ACollectUser;
use think\Request;
......@@ -34,6 +35,7 @@ class CollectUser extends Basic
*/
public function addCollectUser()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*$params = array(
......@@ -96,6 +98,8 @@ class CollectUser extends Basic
if (!isset($params["agents_id"])) {
return $this->response("101", "请求参数错误");
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$field = 'CollectUser.id,';
$field .= 'CollectUser.status,';
......@@ -106,10 +110,11 @@ class CollectUser extends Basic
$field .= 'Users.user_status,';
$field .= 'Users.industry_type,';
$field .= 'Users.price_demand,';
$field .= 'Users.vip,';
$field .= 'Users.area_demand';
$get_params['agents_id'] = $params["agents_id"];
$res = $this->aCollectUser->getCollectList($field,$get_params);
$res = $this->aCollectUser->getCollectList($pageNo,$pageSize,$field,$get_params);
foreach($res as $k=>$v)
{
$label = [];
......@@ -121,11 +126,16 @@ class CollectUser extends Basic
if($v['user_status'] != -1){
$res[$k]['label'] = implode(',',$label);
}
}
}
$data['list']=$res;
//dump($res);
$vip_services = new VipService();
$data['examine_vip'] = $vip_services->vip($params['agents_id']);
if ($res) {
return $this->response("200", "成功",$res);
return $this->response("200", "成功",$data);
} else {
return $this->response("101", "失败");
}
......
......@@ -97,7 +97,7 @@ class Basic extends Controller
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify();
//$this->tokenVerify();
// $this->userAuth(trim($requestPath));
}
unset($this->params["AuthToken"]);
......
......@@ -51,13 +51,15 @@ class ACollectHouse extends Model
* 查询收藏数据
* 朱伟 2018-07-04
*/
public function getCollectList($field,$params)
public function getCollectList($pageNo,$pageSize,$field,$params)
{
$result = Db::table($this->table)
->field($field)
->alias('CollectUser')
->join('g_houses Houses', 'CollectUser.house_id = Houses.id', 'left')
->where($params)
->limit($pageSize)
->page($pageNo)
->select();
//dump($this->getLastSql());
return $result;
......
......@@ -49,13 +49,15 @@ class ACollectUser extends Model
* 查询收藏数据
* 朱伟 2018-07-04
*/
public function getCollectList($field,$params)
public function getCollectList($pageNo,$pageSize,$field,$params)
{
$result = Db::table($this->table)
->field($field)
->alias('CollectUser')
->join('u_users Users', 'CollectUser.user_id = Users.id', 'left')
->where($params)
->limit($pageSize)
->page($pageNo)
->select();
//dump($this->getLastSql());
return $result;
......
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