Commit 17bd7f93 authored by zhuwei's avatar zhuwei

1

parent 7fc5c153
...@@ -165,7 +165,32 @@ class LookShop extends Basic ...@@ -165,7 +165,32 @@ class LookShop extends Basic
* 客户浏览记录 * 客户浏览记录
* @return \think\Response * @return \think\Response
*/ */
public function getLookShopList() // public function getLookShopList()
// {
// $params = $this->params;
// $checkResult = $this->validate($params, "UserLookShopValidate.getLookShopList");
// if (true !== $checkResult) {
// return $this->response("101", $checkResult);
// }
// $pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
// $pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
// $s_look_Shop = new LookShopService();
// $field = 'a.type,a.create_time,b.buyer_nick,b.buyer_img,c.id as user_id';
// $conditions['a.source'] = 1;
// $conditions['a.house_id'] = $params['house_id'];
// $result = $s_look_Shop->getLookShopList($conditions,$field,$pageNo, $pageSize);
// if($result){
// return $this->response("200", "success", $result);
// }else{
// return $this->response("101", "暂无数据", []);
// }
// }
/**
* 客户浏览记录
* @return \think\Response
*/
public function getLookShopListV2()
{ {
$params = $this->params; $params = $this->params;
$checkResult = $this->validate($params, "UserLookShopValidate.getLookShopList"); $checkResult = $this->validate($params, "UserLookShopValidate.getLookShopList");
...@@ -175,10 +200,7 @@ class LookShop extends Basic ...@@ -175,10 +200,7 @@ class LookShop extends Basic
$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'];
$s_look_Shop = new LookShopService(); $s_look_Shop = new LookShopService();
$field = 'a.type,a.create_time,b.buyer_nick,b.buyer_img,c.id as user_id'; $result = $s_look_Shop->getLookShopListV2($params,$pageNo, $pageSize);
$conditions['a.source'] = 1;
$conditions['a.house_id'] = $params['house_id'];
$result = $s_look_Shop->getLookShopList($conditions,$field,$pageNo, $pageSize);
if($result){ if($result){
return $this->response("200", "success", $result); return $this->response("200", "success", $result);
}else{ }else{
......
...@@ -1359,7 +1359,7 @@ class Shop extends Basic ...@@ -1359,7 +1359,7 @@ class Shop extends Basic
//t_look_shop_user //t_look_shop_user
$lookShopUserModel = new TLookShopUser(); $lookShopUserModel = new TLookShopUser();
$where_["house_id"] = $params["house_id"]; $where_["house_id"] = $params["house_id"];
$where_["source"] = 0; // $where_["source"] = 0;
$logArr = $lookShopUserModel->getLogList($where_, "id,user_id,type,house_id,create_time as look_day", $pageNo, $pageSize); $logArr = $lookShopUserModel->getLogList($where_, "id,user_id,type,house_id,create_time as look_day", $pageNo, $pageSize);
return $this->response("200", "success", $logArr); return $this->response("200", "success", $logArr);
......
...@@ -245,20 +245,49 @@ class LookShopService ...@@ -245,20 +245,49 @@ class LookShopService
* @param $pageSize * @param $pageSize
* @return bool * @return bool
*/ */
public function getLookShopList($conditions,$field,$pageNo, $pageSize) // public function getLookShopList($conditions,$field,$pageNo, $pageSize)
// {
// $m_look_shop = new TLookShopUser();
// $list = $m_look_shop->getLookShopList($conditions, $field, $pageNo, $pageSize);
// if (!$list) {
// return false;
// }
// // $count = $m_look_shop->getLookShopListCount($conditions,$field);
// // $result["list"] = $list;
// // $result["total"] = $count;
// return $list;
// }
/**
* 客户浏览记录
* @param $conditions
* @param $pageNo
* @param $pageSize
* @return bool|false|\PDOStatement|string|\think\Collection
*/
public function getLookShopListV2($conditions,$pageNo, $pageSize)
{ {
$m_look_shop = new TLookShopUser(); $m_look_shop = new TLookShopUser();
$list = $m_look_shop->getLookShopList($conditions, $field, $pageNo, $pageSize); $field = 'a.type,a.user_id,a.create_time,a.source,b.buyer_nick,b.buyer_img,c.id';
$conditions_['a.house_id'] = $conditions['house_id'];
$list = $m_look_shop->getLookShopList($conditions_, $field, $pageNo, $pageSize);
if (!$list) { if (!$list) {
return false; return false;
} }
// $count = $m_look_shop->getLookShopListCount($conditions,$field); $u_user = new Users();
// $result["list"] = $list; foreach ($list as $k => $v) {
// $result["total"] = $count; if($v['source'] == 0){
$fields = "b.buyer_nick,b.buyer_img";
$result = $u_user->getUserInfoById(['user_id'=>$v['user_id']], $fields);
$list[$k]['buyer_nick'] = $result['buyer_nick'];
$list[$k]['buyer_img'] = $result['buyer_img'];
}else{
$list[$k]['user_id'] = $v['id'];
}
}
return $list; return $list;
} }
/** /**
* 我的看铺记录 * 我的看铺记录
* @param $user_id * @param $user_id
...@@ -276,16 +305,12 @@ class LookShopService ...@@ -276,16 +305,12 @@ class LookShopService
} }
$field = 'a.type,a.create_time,a.house_id'; $field = 'a.type,a.create_time,a.house_id';
$conditions['a.source'] = 1;
$conditions['a.user_id'] = $result[0]["id"]; $conditions['a.user_id'] = $result[0]["id"];
$m_look_shop = new TLookShopUser(); $m_look_shop = new TLookShopUser();
$list = $m_look_shop->getLookShopList($conditions, $field, $pageNo, $pageSize); $list = $m_look_shop->getLookShopList($conditions, $field, $pageNo, $pageSize);
if (!$list) { if (!$list) {
return false; return false;
} }
// $count = $m_look_shop->getLookShopListCount($conditions,$field);
// $result["list"] = $list;
// $result["total"] = $count;
return $list; return $list;
} }
......
...@@ -942,7 +942,7 @@ Route::group('broker', [ ...@@ -942,7 +942,7 @@ Route::group('broker', [
'getAgentsResidueNumList' => ['api_broker/LookShop/getAgentsResidueNumList', ['method' => 'get']], //经纪人列表 'getAgentsResidueNumList' => ['api_broker/LookShop/getAgentsResidueNumList', ['method' => 'get']], //经纪人列表
'getAgentsResidueNumListV2' => ['api_broker/LookShop/getAgentsResidueNumListV2', ['method' => 'get']], //经纪人列表 'getAgentsResidueNumListV2' => ['api_broker/LookShop/getAgentsResidueNumListV2', ['method' => 'get']], //经纪人列表
'setAgentLookNum' => ['api_broker/LookShop/setAgentLookNum', ['method' => 'post']], //设置经纪人的看铺数量 'setAgentLookNum' => ['api_broker/LookShop/setAgentLookNum', ['method' => 'post']], //设置经纪人的看铺数量
'getLookShopList' => ['api_broker/LookShop/getLookShopList', ['method' => 'POST|GET']], //设置经纪人的看铺数量 'getLookShopList' => ['api_broker/LookShop/getLookShopListV2', ['method' => 'POST|GET']], //设置经纪人的看铺数量
'getShopLookList' => ['api_broker/LookShop/getShopLookList', ['method' => 'POST|GET']], //设置经纪人的看铺数量 'getShopLookList' => ['api_broker/LookShop/getShopLookList', ['method' => 'POST|GET']], //设置经纪人的看铺数量
//首页跟进记录 //首页跟进记录
......
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