Commit f145a24f authored by clone's avatar clone

我的商铺显示

parent a9def140
...@@ -83,7 +83,7 @@ class Shop extends Basic ...@@ -83,7 +83,7 @@ class Shop extends Basic
,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,rent_price"; ,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,rent_price";
} else { } else {
$field = "id,internal_title as title,internal_address as address,city,disc,business_district_id,status,industry_type $field = "id,internal_title as title,internal_address as address,city,disc,business_district_id,status,industry_type
,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,rent_price"; ,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,rent_price";
$conditions["city"] = "上海市"; $conditions["city"] = "上海市";
} }
...@@ -192,6 +192,7 @@ class Shop extends Basic ...@@ -192,6 +192,7 @@ class Shop extends Basic
} }
//如果有传经纪人id则代表我的商铺不区分状态 //如果有传经纪人id则代表我的商铺不区分状态
if (isset($params['agent_id'])) { if (isset($params['agent_id'])) {
unset($conditions["city"]);
//$conditions['status'] = array( 'in', "1,2" ); //只显示上架或下架的 //$conditions['status'] = array( 'in', "1,2" ); //只显示上架或下架的
$conditions['status'] = !empty($params['status']) ? $params['status'] : array( 'in', "1,2" ); //只显示上架或下架的 $conditions['status'] = !empty($params['status']) ? $params['status'] : array( 'in', "1,2" ); //只显示上架或下架的
} }
...@@ -275,7 +276,7 @@ class Shop extends Basic ...@@ -275,7 +276,7 @@ class Shop extends Basic
$conditions['a.id'] = array( "eq", $params["id"] ); $conditions['a.id'] = array( "eq", $params["id"] );
$field .= ',b.age_limit,b.payment_month,b.deposit_month,b.external_slotting_fee'; $field .= ',b.age_limit,b.payment_month,b.deposit_month,b.external_slotting_fee';
$result = $this->gHousesModel->getHouseDetailById($field, $conditions); $result = $this->gHousesModel->getHouseDetailById($field, $conditions);
if (count($result) <= 0) { if (count($result) <= 0) {
return $this->response("101", '此楼盘不存在'); return $this->response("101", '此楼盘不存在');
...@@ -297,8 +298,8 @@ class Shop extends Basic ...@@ -297,8 +298,8 @@ class Shop extends Basic
if ($result["external_slotting_fee"] != '-1') { if ($result["external_slotting_fee"] != '-1') {
$result["external_slotting_fee"] = $result["external_slotting_fee"] * 0.01; $result["external_slotting_fee"] = $result["external_slotting_fee"] * 0.01;
} }
$result["api_path"] = CK_IMG_URL . 'images/'; $result["api_path"] = CK_IMG_URL . 'images/';
$param["house_id"] = $params['id']; $param["house_id"] = $params['id'];
//todo 这里的是否要更改成b端后台上传的类型 //todo 这里的是否要更改成b端后台上传的类型
$param["img_type"] = 2; $param["img_type"] = 2;
$result["images"] = $this->gHousesImgModel->getHouseImages($param, 15); $result["images"] = $this->gHousesImgModel->getHouseImages($param, 15);
...@@ -306,14 +307,14 @@ class Shop extends Basic ...@@ -306,14 +307,14 @@ class Shop extends Basic
$result["plan_images"] = $this->gHousesImgModel->getHouseImages($param, 1); $result["plan_images"] = $this->gHousesImgModel->getHouseImages($param, 1);
if ($params['site_area'] == 3 || $params["site_area"] == 4) { if ($params['site_area'] == 3 || $params["site_area"] == 4) {
$result['landlord_phone'] = json_decode($result['landlord_phone'], true); $result['landlord_phone'] = json_decode($result['landlord_phone'], true);
$result['create_time'] = date('Y-m-d', strtotime($result['create_time'])); $result['create_time'] = date('Y-m-d', strtotime($result['create_time']));
} }
if ($params['site_area'] == 4) { if ($params['site_area'] == 4) {
//封面图 //封面图
$param["img_type"] = 1; $param["img_type"] = 1;
$cover_plan = $this->gHousesImgModel->getHouseImages($param, 15); $cover_plan = $this->gHousesImgModel->getHouseImages($param, 15);
$result["cover_plan"] = $cover_plan[0]; $result["cover_plan"] = $cover_plan[0];
} }
if ($result['status'] == 0) { if ($result['status'] == 0) {
...@@ -340,7 +341,7 @@ class Shop extends Basic ...@@ -340,7 +341,7 @@ class Shop extends Basic
// 计数开始 // 计数开始
if ($params["site_area"] == 3 || $params["site_area"] == 4 && $result) { if ($params["site_area"] == 3 || $params["site_area"] == 4 && $result) {
$lookShopArr = $this->lookShopService_->countLookShopNum((int)$this->agentId, (int)$params["id"]); $lookShopArr = $this->lookShopService_->countLookShopNum((int)$this->agentId, (int)$params["id"]);
//判断看铺数量是否上限 //判断看铺数量是否上限
if ($lookShopArr) { if ($lookShopArr) {
...@@ -353,9 +354,9 @@ class Shop extends Basic ...@@ -353,9 +354,9 @@ class Shop extends Basic
} }
//上传人 //上传人
$m_agent = new AAgents(); $m_agent = new AAgents();
$upload_data = $m_agent->getAgentById('name,phone',['agent_id'=>$result['upload_id']]); $upload_data = $m_agent->getAgentById('name,phone', [ 'agent_id' => $result['upload_id'] ]);
$result['upload_user'] = $upload_data[0]['name'] .'-'. $upload_data[0]['phone']; $result['upload_user'] = $upload_data[0]['name'] . '-' . $upload_data[0]['phone'];
//独家方 //独家方
if ($result['is_exclusive_type'] == 1) { if ($result['is_exclusive_type'] == 1) {
...@@ -363,8 +364,8 @@ class Shop extends Basic ...@@ -363,8 +364,8 @@ class Shop extends Basic
$where_house['is_del'] = 0; $where_house['is_del'] = 0;
$where_house['type'] = 3; $where_house['type'] = 3;
$where_house['houses_id'] = $result['id']; $where_house['houses_id'] = $result['id'];
$house_agent_data = $m_house_agent->getAgentsByHouseId('name,phone', $where_house); $house_agent_data = $m_house_agent->getAgentsByHouseId('name,phone', $where_house);
$result['exclusive_user'] = $house_agent_data[0]['name'] .'-'. $house_agent_data[0]['phone']; $result['exclusive_user'] = $house_agent_data[0]['name'] . '-' . $house_agent_data[0]['phone'];
} }
} }
...@@ -372,12 +373,12 @@ class Shop extends Basic ...@@ -372,12 +373,12 @@ class Shop extends Basic
$result["is_collect"] = 2; $result["is_collect"] = 2;
if ($params['site_area'] == 3) { if ($params['site_area'] == 3) {
//先判断是否已经存在数据 //先判断是否已经存在数据
$field = 'id,status'; $field = 'id,status';
$get_params['agents_id'] = $params["user_id"]; $get_params['agents_id'] = $params["user_id"];
$get_params['house_id'] = $params["id"]; $get_params['house_id'] = $params["id"];
$collect_house = new ACollectHouse(); $collect_house = new ACollectHouse();
$res = $collect_house->getCollectHouse($field,$get_params); $res = $collect_house->getCollectHouse($field, $get_params);
if($res && ($res[0]['status'] == 1)){//如果存在 if ($res && ($res[0]['status'] == 1)) {//如果存在
$result["is_collect"] = 1; $result["is_collect"] = 1;
} }
} }
......
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