Commit 2d0864df authored by zhuwei's avatar zhuwei

客户的看铺记录

parent 622e4bf3
......@@ -186,6 +186,28 @@ class LookShop extends Basic
}
}
/**
* 我的看铺记录
* @return \think\Response
*/
public function getShopLookList()
{
$params = $this->params;
$checkResult = $this->validate($params, "UserLookShopValidate.getShopLookList");
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();
$result = $s_look_Shop->getShopLookList($params['user_id'],$pageNo,$pageSize);
if($result){
return $this->response("200", "success", $result);
}else{
return $this->response("101", "暂无数据", []);
}
}
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ use app\model\AAgents;
use app\model\GHousesToAgents;
use app\model\SystemConfig;
use app\model\TLookShopUser;
use app\model\Users;
use RedisException;
use think\Exception;
use think\Log;
......@@ -258,6 +259,37 @@ class LookShopService
}
/**
* 我的看铺记录
* @param $user_id
* @param $pageNo
* @param $pageSize
* @return bool|false|\PDOStatement|string|\think\Collection
*/
public function getShopLookList($user_id,$pageNo,$pageSize)
{
$m_user = new Users();
$fields = "b.id,b.buyer_nick";
$result = $m_user->getUserInfoById(['user_id'=>$user_id], $fields);
if (!$result) {
return false;
}
$field = 'a.type,a.create_time,a.house_id';
$conditions['a.source'] = 1;
$conditions['a.user_id'] = $result[0]["id"];
$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;
}
......
......@@ -15,15 +15,20 @@ class UserLookShopValidate extends Validate
{
protected $rule = [
'house_id' => 'require|number|gt:0',
'user_id' => 'require|number|gt:0',
];
protected $message = [
'house_id.require' => 'house_id必传字段',
'house_id.number' => 'house_id必须为数字',
'house_id.gt' => 'house_id必须大于0',
'user_id.require' => 'user_id必传字段',
'user_id.number' => 'user_id必须为数字',
'user_id.gt' => 'user_id必须大于0',
];
protected $scene = [
'getLookShopList' => ['house_id'],
'getShopLookList' => ['user_id'],
];
}
\ No newline at end of file
......@@ -935,6 +935,7 @@ Route::group('broker', [
'getAgentsResidueNumListV2' => ['api_broker/LookShop/getAgentsResidueNumListV2', ['method' => 'get']], //经纪人列表
'setAgentLookNum' => ['api_broker/LookShop/setAgentLookNum', ['method' => 'post']], //设置经纪人的看铺数量
'getLookShopList' => ['api_broker/LookShop/getLookShopList', ['method' => 'POST|GET']], //设置经纪人的看铺数量
'getShopLookList' => ['api_broker/LookShop/getShopLookList', ['method' => 'POST|GET']], //设置经纪人的看铺数量
//首页跟进记录
'userFollowUpList' => ['api_broker/HomePageLog/userFollowUpList', ['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