Commit 21edf981 authored by zw's avatar zw

看铺数量控制 盘方控制

parent 15be56a5
......@@ -24,13 +24,15 @@ class Shop extends Basic
private $gHousesModel;
private $gHousesImgModel;
private $attentionModel;
private $lookShopService_;
function __construct($request = null)
{
parent::__construct($request);
$this->gHousesModel = new GHouses();
$this->gHousesImgModel = new GHousesImgs();
$this->attentionModel = new AttentionModel();
$this->gHousesModel = new GHouses();
$this->gHousesImgModel = new GHousesImgs();
$this->attentionModel = new AttentionModel();
$this->lookShopService_ = new LookShopService();
}
/**
......@@ -173,6 +175,10 @@ class Shop extends Basic
$param["house_id"] = $val["id"];
$param["img_type"] = 1; //默认主图
$result[$key]["images"] = $this->gHousesImgModel->getHouseImages($param, 1);
if ($params["site_area"] == 3) {
$isLook = $this->lookShopService_->isLooked($this->agentId,$val["id"]);
$result[$key]["is_look"] = $isLook;
}
}
......@@ -210,7 +216,6 @@ class Shop extends Basic
}
if ($params['site_area'] == 1) {
$field = "a.id,a.external_title as title,a.external_address as address,a.city,a.disc,a.business_district_id,a.status,
a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type,
......@@ -231,7 +236,7 @@ class Shop extends Basic
$result = $this->gHousesModel->getHouseDetailById($field, $conditions);
if(count($result) <= 0){
if (count($result) <= 0) {
return $this->response("101", '此楼盘不存在');
}
......@@ -272,13 +277,12 @@ class Shop extends Basic
$agentId = $verify->getPanpartyAgentsByHouseId($params["id"]);
$result["panParty"] = $agentId;
$lookShopService_ = new LookShopService();
// 计数开始
if($params["site_area"] == 3 && $result){
$lookShopArr = $lookShopService_->countLookShopNum((int)$this->agentId,(int)$params["id"]);
if ($params["site_area"] == 3 && $result) {
$lookShopArr = $this->lookShopService_->countLookShopNum((int)$this->agentId, (int)$params["id"]);
//判断看铺数量是否上限
if($lookShopArr["residue_num"] == 0 && !$lookShopArr["isExist"] && !$lookShopArr["isPanParty"] ){
if ($lookShopArr["residue_num"] == 0 && !$lookShopArr["isExist"] && !$lookShopArr["isPanParty"]) {
return $this->response("102", "您今天的看铺数量已达上限!");
}
$result["lookShopArr"] = $lookShopArr;
......@@ -382,8 +386,8 @@ class Shop extends Basic
$img = new GHousesImgs();
$id = $img->getHouseImagesInfo('id', [
'house_id' => $this->params['house_id'],
'img_name' => $this->params['save_path'],
'house_id' => $this->params['house_id'],
'img_name' => $this->params['save_path'],
'img_status' => 0
]);
......@@ -435,26 +439,27 @@ class Shop extends Basic
* 新增店铺跟进
* @return \think\Response
*/
public function addShopFollowUp(){
public function addShopFollowUp()
{
$params = $this->params;
/* $params = array(
"house_id" => 1,
"follow_up_info"=>"123123131",
"agent_id"=>1,
"agent_name"=>"2324",
"agent_phone"=>"13766166616",
);*/
if(!isset($params["house_id"]) || !isset($params["follow_up_info"])|| !isset($params["agent_id"])
|| !isset($params["agent_name"])|| !isset($params["agent_phone"])){
/* $params = array(
"house_id" => 1,
"follow_up_info"=>"123123131",
"agent_id"=>1,
"agent_name"=>"2324",
"agent_phone"=>"13766166616",
);*/
if (!isset($params["house_id"]) || !isset($params["follow_up_info"]) || !isset($params["agent_id"])
|| !isset($params["agent_name"]) || !isset($params["agent_phone"])) {
return $this->response("101", "请求参数错误");
}
$follow_up_model = new GHousesFollowUp();
$id = $follow_up_model->addHousesFollowUp($params);
if($id > 0 ){
return $this->response("200","request success",["id"=>$id]);
}else{
return $this->response("200","request error");
$id = $follow_up_model->addHousesFollowUp($params);
if ($id > 0) {
return $this->response("200", "request success", [ "id" => $id ]);
} else {
return $this->response("200", "request error");
}
......
......@@ -40,7 +40,6 @@ class Basic extends Controller
protected $filterVerify = array(
'broker/login',
'broker/token',
'broker/getShopList',
'broker/getRegions',
'broker/getAddress',
'broker/getBroker',
......
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