Commit 828cebcc authored by clone's avatar clone

Merge branch 'test' into chat_0818

# Conflicts: # application/route.php
parents 064c9d8f 07dab21b
...@@ -157,8 +157,9 @@ class AppointmentTime extends Basic ...@@ -157,8 +157,9 @@ class AppointmentTime extends Basic
$param["imgtype"] = 1; //默认主图 $param["imgtype"] = 1; //默认主图
$result[$key]["images"] = $this->dbImg->getHouseImages($param, 1); $result[$key]["images"] = $this->dbImg->getHouseImages($param, 1);
$houseInfo = $this->houseInfoModel->getHouseDetail("room_num_left", array( "id" => $val["house_id"] )); $houseInfo = $this->houseInfoModel->getHouseDetails("a.room_num_left,b.foreign_name", array( "a.id" => $val["house_id"] ));
$result[$key]["room_num_left"] = $houseInfo["room_num_left"]; $result[$key]["room_num_left"] = $houseInfo["room_num_left"];
$result[$key]["foreign_name"] = $houseInfo["foreign_name"];
} }
return $result; return $result;
...@@ -174,7 +175,8 @@ class AppointmentTime extends Basic ...@@ -174,7 +175,8 @@ class AppointmentTime extends Basic
*/ */
public function getYetList($pageNo, $pageSize, $params) public function getYetList($pageNo, $pageSize, $params)
{ {
$field = "a.id,a.phpone as phone,a.agent_id as agents_id,a.receptiontime as expect_time,a.house_id,b.title as house_title,b.room_num_left"; $field = "a.id,a.phpone as phone,a.agent_id as agents_id,a.receptiontime as expect_time,a.house_id,
b.title as house_title,b.room_num_left,c.foreign_name";
$where_["a.receptiontime"] = array( "neq", "null" ); $where_["a.receptiontime"] = array( "neq", "null" );
$where_["a.phpone"] = array( "eq", $params["phone"] ); $where_["a.phpone"] = array( "eq", $params["phone"] );
......
...@@ -73,7 +73,7 @@ class AttentionShop extends Basic ...@@ -73,7 +73,7 @@ class AttentionShop extends Basic
$order_ = 'a.create_time desc'; $order_ = 'a.create_time desc';
//b.room_num_left 前端显示已下架,不可点击到详情 //b.room_num_left 前端显示已下架,不可点击到详情
$field = "a.id,a.house_id,b.title,b.area,b.room_area2,b.price,b.shangpu_tags,b.room_num_left"; $field = "a.id,a.house_id,b.title,b.area,b.room_area2,b.price,b.shangpu_tags,b.room_num_left,c.foreign_name";
if (!isset($params["user_id"])) { if (!isset($params["user_id"])) {
return $this->response("101", "用户id不能为空"); return $this->response("101", "用户id不能为空");
...@@ -92,6 +92,7 @@ class AttentionShop extends Basic ...@@ -92,6 +92,7 @@ class AttentionShop extends Basic
$result[$key]["images"] = $imgArr; $result[$key]["images"] = $imgArr;
} }
return $this->response("200", "request success", $result); return $this->response("200", "request success", $result);
} }
......
...@@ -31,7 +31,7 @@ class Banner extends Basic ...@@ -31,7 +31,7 @@ class Banner extends Basic
*/ */
public function getBannerList() public function getBannerList()
{ {
$field = "id,title,CONCAT('".CK_IMG_URL."' , pic_path) as pic_path, url, sort,is_show,create_time,update_time"; $field = "id,title,CONCAT('".CK_IMG_URL."' , pic_path) as pic_path, url, type,sort,is_show,create_time,update_time";
$params['is_show'] = array( "eq", 0 ); $params['is_show'] = array( "eq", 0 );
$result = $this->bannerModel $result = $this->bannerModel
->getBannerList(1, 15, "sort desc", $field, $params); ->getBannerList(1, 15, "sort desc", $field, $params);
......
...@@ -19,7 +19,7 @@ class Index extends Basic ...@@ -19,7 +19,7 @@ class Index extends Basic
} }
/** /**
* 月均价 上周成交量 * 月均价 上周成交量 ==>修改为日均价了
*/ */
public function averagePriceAndTurnover(){ public function averagePriceAndTurnover(){
......
...@@ -37,9 +37,9 @@ class Shop extends Basic ...@@ -37,9 +37,9 @@ class Shop extends Basic
public function getShopList() public function getShopList()
{ {
/* $params = array( /* $params = array(
"site_area" => 1, //来源 1首页 2搜索 "site_area" => 2, //来源 1首页 2搜索
"title" => "尚美", "title" => "尚美",
"carefully_chosen" => 0, //精选商铺--0是1否 "carefully_chosen" => 0, //精选商铺--0是1否
"shangpu_type" => 0, //商铺类型(0商场,1街铺) "shangpu_type" => 0, //商铺类型(0商场,1街铺)
"disc" => "黄浦区", "disc" => "黄浦区",
...@@ -52,9 +52,11 @@ class Shop extends Basic ...@@ -52,9 +52,11 @@ class Shop extends Basic
"pageNo" => "1", "pageNo" => "1",
"pageSize" => 15 "pageSize" => 15
);*/ );*/
$params = $this->params; $params = $this->params;
$field = "id,agent_id,title,address,city,disc,disccircles,sales,yetai,room_area,room_area2,shangpu_type,is_test, $field = "a.id,a.agent_id,a.title,a.address,a.city,disc,a.disccircles,a.sales,a.yetai,a.room_area,a.room_area2,
room_num_left,shangpu_tags,carefully_chosen,price"; a.shangpu_type,a.is_test,a.room_num_left,a.shangpu_tags,a.carefully_chosen,a.price,b.foreign_name,b.address_detail_c,
b.foreign_advantage";
$conditions = []; $conditions = [];
if (empty($params['site_area'])) { if (empty($params['site_area'])) {
...@@ -65,65 +67,65 @@ class Shop extends Basic ...@@ -65,65 +67,65 @@ class Shop extends Basic
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize']; $pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
if (isset($params['title'])) { if (isset($params['title'])) {
$conditions['title'] = array( "like", "%" . trim($params['title']) . "%" ); $conditions['b.foreign_name'] = array( "like", "%" . trim($params['title']) . "%" );
} }
$order_ = ""; $order_ = "";
$spTagArr = array(); $spTagArr = array();
switch ($params['site_area']) { switch ($params['site_area']) {
case 1: case 1:
if (isset($params['carefully_chosen']) && $params['carefully_chosen'] == 0) { if (isset($params['carefully_chosen']) && $params['carefully_chosen'] == 0) {
$conditions['carefully_chosen'] = array( 'eq', $params['carefully_chosen'] ); $conditions['a.carefully_chosen'] = array( 'eq', $params['carefully_chosen'] );
$order_ = "rate1 desc, id desc"; $order_ = "a.rate1 desc, a.id desc";
} }
break; break;
case 2: case 2:
if (isset($params['disc'])) { //区域 if (isset($params['disc'])) { //区域
$conditions['disc'] = array( 'eq', trim($params['disc']) ); $conditions['a.disc'] = array( 'eq', trim($params['disc']) );
} }
if (isset($params['yetai'])) { //业态 if (isset($params['yetai'])) { //业态
$conditions['yetai'] = array( 'like', "%" . trim($params['yetai']) . "%" ); $conditions['a.yetai'] = array( 'like', "%" . trim($params['yetai']) . "%" );
} }
if (isset($params['shangpu_type'])) { //商铺类型 if (isset($params['shangpu_type'])) { //商铺类型
$conditions['shangpu_type'] = array( "eq", $params['shangpu_type'] ); $conditions['a.shangpu_type'] = array( "eq", $params['shangpu_type'] );
} }
//面积 room_area最小面积 room_area2最大面积 参考老版本 //面积 room_area最小面积 room_area2最大面积 参考老版本
if (isset($params['area_start']) && isset($params['area_end'])) { if (isset($params['area_start']) && isset($params['area_end'])) {
$conditions['room_area'] = array( 'between', array( $params['area_start'], $params['area_end'] ) ); $conditions['a.room_area'] = array( 'between', array( $params['area_start'], $params['area_end'] ) );
$conditions['room_area2'] = array( 'between', array( $params['area_start'], $params['area_end'] ) ); $conditions['a.room_area2'] = array( 'between', array( $params['area_start'], $params['area_end'] ) );
} else if (isset($params['area_start']) && !isset($params['area_end'])) { //100米以上不用传结束面积 } else if (isset($params['area_start']) && !isset($params['area_end'])) { //100米以上不用传结束面积
$conditions['room_area'] = array( 'egt', $params['area_start'] ); $conditions['a.room_area'] = array( 'egt', $params['area_start'] );
$conditions['room_area2'] = array( 'egt', $params['area_start'] ); $conditions['a.room_area2'] = array( 'egt', $params['area_start'] );
} }
if (isset($params['money_start']) && isset($params['money_end'])) { //面积 if (isset($params['money_start']) && isset($params['money_end'])) { //面积
$conditions['price'] = array( 'between', array( $params['money_start'], $params['money_end'] ) ); $conditions['a.price'] = array( 'between', array( $params['money_start'], $params['money_end'] ) );
} else if (isset($params['money_start']) && !isset($params['money_end'])) { } else if (isset($params['money_start']) && !isset($params['money_end'])) {
$conditions['price'] = array( 'egt', $params['money_start'] ); $conditions['a.price'] = array( 'egt', $params['money_start'] );
} }
if (isset($params['shangpu_tags']) && $params['shangpu_tags'] != "全部") { //商铺标签 if (isset($params['shangpu_tags']) && $params['shangpu_tags'] != "全部") { //商铺标签
$shangpuTagsArr = array_filter(explode(',', $params['shangpu_tags'])); $shangpuTagsArr = array_filter(explode(',', $params['shangpu_tags']));
if (count($shangpuTagsArr) == 1) { if (count($shangpuTagsArr) == 1) {
$spTagArr['shangpu_tags'] = array( 'like', "%" . trim($shangpuTagsArr[0]) . "%" ); $spTagArr['a.shangpu_tags'] = array( 'like', "%" . trim($shangpuTagsArr[0]) . "%" );
} else { } else {
foreach ($shangpuTagsArr as $key => $val) { foreach ($shangpuTagsArr as $key => $val) {
$spTagArr['shangpu_tags'][] = array( 'like', "%" . trim($val) . "%" ); $spTagArr['a.shangpu_tags'][] = array( 'like', "%" . trim($val) . "%" );
} }
} }
} }
$order_ = "id desc"; $order_ = "a.id desc";
break; break;
default: default:
$this->response("101", "请求数据异常"); $this->response("101", "请求数据异常");
} }
if (!empty($conditions)) { if (!empty($conditions)) {
//todo 测试数据? //todo 测试数据?
$conditions['id'] = array( '<>', 16 ); $conditions['a.id'] = array( '<>', 16 );
//todo sales下架字段并没用处 根据room_num_left剩余铺数来判断 为0 表示下架 //todo sales下架字段并没用处 根据room_num_left剩余铺数来判断 为0 表示下架
$conditions['room_num_left'] = array( '<>', 0 ); $conditions['a.room_num_left'] = array( '<>', 0 );
$conditions['show_all'] = array( 'eq', 0 ); //只显示公开的楼盘 $conditions['a.show_all'] = array( 'eq', 0 ); //只显示公开的楼盘
} }
$result = $this->db->getHouseInfoList($pageNo, $pageSize, $order_, $field, $conditions, $spTagArr); $result = $this->db->getHouseInfoList($pageNo, $pageSize, $order_, $field, $conditions, $spTagArr);
...@@ -150,19 +152,21 @@ class Shop extends Basic ...@@ -150,19 +152,21 @@ class Shop extends Basic
public function getShopDetail() public function getShopDetail()
{ {
$params = $this->params; $params = $this->params;
$field = "id,management_fee,title,address,city,room_area,room_area2,business_area,disc,disccircles,sales,slotting_fee,transfer_fee, $field = "a.id,a.management_fee,a.title,a.address,a.city,a.room_area,a.room_area2,a.business_area,a.disc,a.disccircles,
yetai,room_area2,shangpu_type,is_test,sellingpoint,singn_rule,business_date,start_business_date,opentime,has_gas,traffic,has_moved, a.sales,a.slotting_fee,a.transfer_fee, a.yetai,a.room_area2,a.shangpu_type,a.is_test,a.sellingpoint,a.singn_rule,
room_num_left,room_num_total,shangpu_tags,carefully_chosen,price,dish,file_path"; a.business_date,a.start_business_date,a.opentime,a.has_gas,a.traffic,a.has_moved,a.room_num_left,a.room_num_total,
a.shangpu_tags,a.carefully_chosen,a.price,a.dish,a.file_path,b.foreign_name,b.address_detail_c,
b.foreign_advantage";
$conditions = []; $conditions = [];
if (empty($params['id'])) { if (empty($params['id'])) {
return $this->response("101", "详情id不能为空"); return $this->response("101", "详情id不能为空");
} }
$conditions['id'] = array( "eq", $params["id"] ); $conditions['a.id'] = array( "eq", $params["id"] );
$conditions['show_all'] = array( 'eq', 0 ); //只显示公开楼盘 $conditions['a.show_all'] = array( 'eq', 0 ); //只显示公开楼盘
$result = $this->db->getHouseDetail($field, $conditions); $result = $this->db->getHouseDetails($field, $conditions);
$result["api_path"] = IMG_PATH; $result["api_path"] = IMG_PATH;
$param["house_id"] = $params['id']; $param["house_id"] = $params['id'];
......
...@@ -42,7 +42,7 @@ class TradeLog extends Basic ...@@ -42,7 +42,7 @@ class TradeLog extends Basic
public function getTradeList() public function getTradeList()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"user_id" => "4", "user_id" => "4",
"phone" => "18521095110", "phone" => "18521095110",
"pageNo" => 1, "pageNo" => 1,
...@@ -66,9 +66,9 @@ class TradeLog extends Basic ...@@ -66,9 +66,9 @@ class TradeLog extends Basic
return $this->response("200", "请求数据为空"); return $this->response("200", "请求数据为空");
} }
foreach ($result as $key => $val) { foreach ($result as $key => $val) {
$houseInfo = $this->houseInfoModel->getHouseDetail("room_num_left,title", array( "id" => $val["house_id"] )); $houseInfo = $this->houseInfoModel->getHouseDetails("a.room_num_left,b.foreign_name", array( "a.id" => $val["house_id"] ));
$result[$key]["room_num_left"] = $houseInfo["room_num_left"]; $result[$key]["room_num_left"] = $houseInfo["room_num_left"];
$result[$key]["title"] = $houseInfo["title"]; $result[$key]["title"] = $houseInfo["foreign_name"];
$result[$key]["api_path"] = IMG_PATH; $result[$key]["api_path"] = IMG_PATH;
$imgParam["house_id"] = $val["house_id"]; $imgParam["house_id"] = $val["house_id"];
$imgParam["imgtype"] = 1; //默认主图 $imgParam["imgtype"] = 1; //默认主图
......
...@@ -75,19 +75,20 @@ class Index ...@@ -75,19 +75,20 @@ class Index
{ {
$id = $_POST["id"] ? $_POST["id"] : $_GET["id"]; $id = $_POST["id"] ? $_POST["id"] : $_GET["id"];
$field = "id,management_fee,title,address,city,room_area,room_area2,business_area,disc,disccircles,sales,slotting_fee,transfer_fee, $field = "a.id,a.management_fee,a.title,a.address,a.city,a.room_area,a.room_area2,a.business_area,a.disc,a.disccircles,
yetai,room_area2,shangpu_type,is_test,sellingpoint,singn_rule,business_date,start_business_date,opentime,has_gas,traffic, a.sales,a.slotting_fee,a.transfer_fee, a.yetai,a.room_area2,a.shangpu_type,a.is_test,a.sellingpoint,a.singn_rule,
room_num_left,room_num_total,shangpu_tags,carefully_chosen,price,dish,file_path"; a.business_date,a.start_business_date,a.opentime,a.has_gas,a.traffic,a.has_moved,a.room_num_left,a.room_num_total,
a.shangpu_tags,a.carefully_chosen,a.price,a.dish,a.file_path,b.foreign_name,b.address_detail_c,
b.foreign_advantage";
$conditions = []; $conditions = [];
if (empty($id)) { if (empty($id)) {
return $this->response("101", "详情id不能为空"); return $this->response("101", "详情id不能为空");
} }
$conditions['id'] = array( "eq", $id ); $conditions['a.id'] = array( "eq", $id );
$conditions['show_all'] = array( 'eq', 0 ); //只显示公开楼盘 $conditions['a.show_all'] = array( 'eq', 0 ); //只显示公开楼盘
$result = $this->db->getHouseDetail($field, $conditions); $result = $this->db->getHouseDetails($field, $conditions);
if( count($result) > 0){ if( count($result) > 0){
$result["api_path"] = IMG_PATH; $result["api_path"] = IMG_PATH;
$param["house_id"] = $id; $param["house_id"] = $id;
......
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
<p class="line_hr"></p> <p class="line_hr"></p>
<!--line 7--> <!--line 7-->
<div class="b4_font"> <div class="b4_font">
<p class="b4_font_p"> <p class="b4_font_p" id="planter">
楼盘平面 楼盘平面
<!--<img src="/app/images/tonglian/but_right@2x.png" class="but_right">--> <!--<img src="/app/images/tonglian/but_right@2x.png" class="but_right">-->
</p> </p>
......
...@@ -32,10 +32,43 @@ class Banner extends Basic ...@@ -32,10 +32,43 @@ class Banner extends Basic
return view("banner/banner"); return view("banner/banner");
} }
/**
* 查询banner列表
* @return \think\Response
*/
public function advertising()
{
return view("banner/advertising");
}
/**
* 首页banner
* @return \think\Response
*/
public function getBannerList() public function getBannerList()
{ {
$field = "id,title,pic_path,url,sort,hits,is_show,up_user,create_time,update_time"; $field = "id,title,pic_path,url,sort,hits,is_show,up_user,create_time,update_time";
$params['is_show'] = array( "eq", 0 ); $params['is_show'] = array( "eq", 0 );
$params['type'] = array( "eq", 0 );
$pageNo = empty($_POST['pageNo']) ? 1 : $_POST['pageNo'];
$pageSize = empty($_POST['pageSize']) ? 15 : $_POST['pageSize'];
$result["list"] = $this->bannerModel
->getBannerList($pageNo, $pageSize, "sort desc", $field, $params);
$result["total"] = $this->bannerModel
->getBannerTotal($params);
return $this->response("200", "request success", $result);
}
/**
* 首页弹框
* @return \think\Response
*/
public function getPopList()
{
$field = "id,title,pic_path,url,sort,hits,is_show,up_user,create_time,update_time";
$params['is_show'] = array( "eq", 0 );
$params['type'] = array( "eq", 1 );
$pageNo = empty($_POST['pageNo']) ? 1 : $_POST['pageNo']; $pageNo = empty($_POST['pageNo']) ? 1 : $_POST['pageNo'];
$pageSize = empty($_POST['pageSize']) ? 15 : $_POST['pageSize']; $pageSize = empty($_POST['pageSize']) ? 15 : $_POST['pageSize'];
$result["list"] = $this->bannerModel $result["list"] = $this->bannerModel
...@@ -65,6 +98,9 @@ class Banner extends Basic ...@@ -65,6 +98,9 @@ class Banner extends Basic
if (isset($_POST["url"])) { if (isset($_POST["url"])) {
$params["url"] = $_POST["url"]; $params["url"] = $_POST["url"];
} }
if (isset($_POST["type"])) {
$params["type"] = $_POST["type"];
}
if (isset($_POST["cover_image"])) { if (isset($_POST["cover_image"])) {
$params["cover_image"] = $_POST["cover_image"]; $params["cover_image"] = $_POST["cover_image"];
} }
...@@ -75,7 +111,7 @@ class Banner extends Basic ...@@ -75,7 +111,7 @@ class Banner extends Basic
$params["is_show"] = $_POST["is_show"]; $params["is_show"] = $_POST["is_show"];
} }
if (empty($params["title"]) || empty($params["url"]) || empty($params["cover_image"]) || empty($params["sort"])) { if (empty($params["title"]) || empty($params["type"]) || empty($params["url"]) || empty($params["cover_image"]) || empty($params["sort"])) {
return $this->response("101", "请提交正确的请求参数"); return $this->response("101", "请提交正确的请求参数");
} }
if (isset($params['id'])) { if (isset($params['id'])) {
......
{layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="banner" />
<!--导航star-->
<!-- Sidebar -->
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="col-lg-10 col-lg-offset-0">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li><a href="#">首页弹框广告</a></li>
<li class="active">新增广告</li>
<div class="pull-right">
<ul class="bread_btn">
<li>
<a href="#modal-add-do" data-toggle="modal" id="add_banner" class="btn btn-default"><i class="icon-plus"></i>
新增广告</a>
</li>
</ul>
</div>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>标题</th>
<th>图片</th>
<th>链接</th>
<th>排序</th>
<th>点击</th>
<th>修改人</th>
<th>操作</th>
</tr>
</thead>
<tbody id="banner_list">
</tbody>
</table>
<!-- /#page-content-wrapper -->
<div style="float:right" id="pagediv">
</div>
</div>
</div>
</div>
<input type="hidden" value="1" id="type" />
</div>
</div>
</div>
</div>
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
</div> </div>
</div> </div>
</div> </div>
<input type="hidden" value="0" id="type" />
</div> </div>
</div> </div>
......
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
<li role="presentation" class="active"> <li role="presentation" class="active">
<a href="/admin.php/index/banner"> 首页轮播图</a> <a href="/admin.php/index/banner"> 首页轮播图</a>
</li> </li>
<li role="presentation" class="active">
<a href="/admin.php/index/advertising"> 首页弹窗</a>
</li>
<li role="presentation"> <li role="presentation">
<a href="/admin.php/index/users_list"> 用户列表</a> <a href="/admin.php/index/users_list"> 用户列表</a>
</li> </li>
......
...@@ -14,6 +14,7 @@ class Applies extends Model ...@@ -14,6 +14,7 @@ class Applies extends Model
->field($field) ->field($field)
->alias("a") ->alias("a")
->join('houseinfos b','a.house_id = b.id' ,'LEFT') ->join('houseinfos b','a.house_id = b.id' ,'LEFT')
->join('houseinfo_exts c', 'c.house_id = b.id', 'LEFT')
->where($params) ->where($params)
->order($order_) ->order($order_)
->limit($pageSize) ->limit($pageSize)
......
...@@ -96,6 +96,7 @@ class AttentionModel extends Model ...@@ -96,6 +96,7 @@ class AttentionModel extends Model
return $this->field($field) return $this->field($field)
->alias("a") ->alias("a")
->join('houseinfos b', 'a.house_id = b.id', 'LEFT') ->join('houseinfos b', 'a.house_id = b.id', 'LEFT')
->join('houseinfo_exts c', 'c.house_id = b.id', 'LEFT')
->where($params) ->where($params)
->order($order_) ->order($order_)
->limit($pageSize) ->limit($pageSize)
......
...@@ -45,6 +45,9 @@ class BannerModel extends Model ...@@ -45,6 +45,9 @@ class BannerModel extends Model
if (isset($param['url'])) { if (isset($param['url'])) {
$arr["url"] = $param['url']; $arr["url"] = $param['url'];
} }
if (isset($param['type'])) {
$arr["type"] = $param['type'];
}
if (isset($param['sort'])) { if (isset($param['sort'])) {
$arr["sort"] = $param['sort']; $arr["sort"] = $param['sort'];
} }
......
...@@ -25,10 +25,12 @@ class HouseInfos extends Model ...@@ -25,10 +25,12 @@ class HouseInfos extends Model
* @param $params * @param $params
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
*/ */
function getHouseInfoList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params,$spTagsArr) function getHouseInfoList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params, $spTagsArr)
{ {
return $this->dbHouseInfo return $this->dbHouseInfo
->field($field) ->field($field)
->alias("a")
->join('houseinfo_exts b', 'a.id = b.house_id', 'LEFT')
->where($params) ->where($params)
->where(function ($query) use ($spTagsArr) { ->where(function ($query) use ($spTagsArr) {
$query->whereOr($spTagsArr); $query->whereOr($spTagsArr);
...@@ -46,14 +48,14 @@ class HouseInfos extends Model ...@@ -46,14 +48,14 @@ class HouseInfos extends Model
function getAveragePrice() function getAveragePrice()
{ {
//price //price
$params['rent_type'] = array( "eq", 1 ); //月租金类型 $params['rent_type'] = array( "eq", 3 ); //1.月租金 2.营业额扣点 3.每平方米租金
$params['room_num_left'] = array( "<>", 0 );//剩余店铺为0的不算 $params['room_num_left'] = array( "<>", 0 );//剩余店铺为0的不算
$sumPrice = $this->dbHouseInfo $sumPrice = $this->dbHouseInfo
->where($params) ->where($params)
->sum("price"); ->sum("price");
$count_ = $this->dbHouseInfo $count_ = $this->dbHouseInfo
->field("id") ->field("id")
->where($params) ->where($params)
->count("id"); ->count("id");
...@@ -74,6 +76,21 @@ class HouseInfos extends Model ...@@ -74,6 +76,21 @@ class HouseInfos extends Model
->where($params) ->where($params)
->find($params["id"]); ->find($params["id"]);
} }
/**
* 获取商铺详情 关联表
* @param $field
* @param $params
* @return mixed
*/
function getHouseDetails($field, $params)
{
return $data = $this->dbHouseInfo
->field($field)
->alias("a")
->join('houseinfo_exts b', 'a.id = b.house_id', 'LEFT')
->where($params)
->find($params["a.id"]);
}
function getCityList($field, $params, $group) function getCityList($field, $params, $group)
......
...@@ -36,7 +36,9 @@ Route::group('index', [ ...@@ -36,7 +36,9 @@ Route::group('index', [
//banner模块 //banner模块
'banner' => [ 'index/banner/index', [ 'method' => 'get' ] ], 'banner' => [ 'index/banner/index', [ 'method' => 'get' ] ],
'advertising' => [ 'index/banner/advertising', [ 'method' => 'get' ] ],
'bannerList' => [ 'index/banner/getBannerList', [ 'method' => 'post' ] ], 'bannerList' => [ 'index/banner/getBannerList', [ 'method' => 'post' ] ],
'getPopList' => [ 'index/banner/getPopList', [ 'method' => 'post' ] ],
'addOrSave' => [ 'index/banner/addOrSave', [ 'method' => 'post' ] ], 'addOrSave' => [ 'index/banner/addOrSave', [ 'method' => 'post' ] ],
'upIsShow' => [ 'index/banner/upIsShow', [ 'method' => 'post' ] ], 'upIsShow' => [ 'index/banner/upIsShow', [ 'method' => 'post' ] ],
...@@ -136,11 +138,11 @@ Route::group('api', [ ...@@ -136,11 +138,11 @@ Route::group('api', [
]); ]);
Route::group('chat', [ Route::group('chat', [
'index' => [ 'chat/AppChat/index', [ 'method' => 'get' ] ], 'index' => [ 'chat/AppChat/index', [ 'method' => 'get' ] ],
'userChat' => [ 'chat/AppChat/userChat', [ 'method' => 'get' ] ], 'userChat' => [ 'chat/AppChat/userChat', [ 'method' => 'get' ] ],
]); ]);
//Route::miss('api/index/miss');//处理错误的url Route::group('task',[
\ No newline at end of file 'exclusiveExpirationTime' => [ 'task/exclusive/exclusiveExpirationTime', [ 'method' => 'get' ]] //独家过期时间
]);//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
<?php
//配置文件
return [
];
\ No newline at end of file
<?php
/**
* Description of Autoexec
*
* @author : hujun
* @date : 2018-1-9 14:39:26
* @internal : 自动执行
*/
namespace app\task\controller;
use app\model\HouseInfos;
class Exclusive {
/**
* 独家时间过期下架商铺
*
* @return type
*/
public function exclusiveExpirationTime() {
$house = new HouseInfos();
$house_data = $house->field('id,room_num_left,exclusive_end')->where('exclusive_type', 1)->where('is_delete', 0)->select();
if ($house_data) {
$insert = array();
foreach ($house_data as $k => $v) {
if (strtotime($v['exclusive_end'] . '23:59:59') > time() && $v['exclusive_end'] != NULL) {
continue;
}
$insert[$k]['id'] = $v['id'];
$insert[$k]['room_num_left'] = 0;
}
$result = $house->saveAll($insert);
}
return;
}
}
...@@ -68,13 +68,16 @@ ...@@ -68,13 +68,16 @@
'<p class="b4_font2">招商时间:<span class="b4_span1 gw">'+response.data.opentime+'</span></p>'+ '<p class="b4_font2">招商时间:<span class="b4_span1 gw">'+response.data.opentime+'</span></p>'+
'<p class="b4_font2">开业时间:<span class="b4_span1 gw">'+response.data.start_business_date+'</span></p>'+ '<p class="b4_font2">开业时间:<span class="b4_span1 gw">'+response.data.start_business_date+'</span></p>'+
'<p class="b4_font2">是否有煤气:<span class="b4_span1 gw">'+has_gas+'</span></p>'+ '<p class="b4_font2">是否有煤气:<span class="b4_span1 gw">'+has_gas+'</span></p>'+
'<p class="b4_font2"><span class="b3_font3 lp">地址:</span><span class="b3_span3 gw">'+response.data.address+'</span></p>'+ '<p class="b4_font2"><span class="b3_font3 lp">地址:</span><span class="b3_span3 gw">'+response.data.city+response.data.disc+response.data.address+'</span></p>'+
'<p class="b4_font2"><span class="b3_font3 lp" >交通:</span><span class="b3_span3 gw">'+response.data.traffic+'</span></p>'; '<p class="b4_font2"><span class="b3_font3 lp" >交通:</span><span class="b3_span3 gw">'+response.data.traffic+'</span></p>';
$("#b4_font").html(b4_font); $("#b4_font").html(b4_font);
//var lp_img=response.data.house_button_img; //var lp_img=response.data.house_button_img;
var lp_img=response.data.images; var lp_img=response.data.images;
var lp_img1=response.data.plan_images; var lp_img1=response.data.plan_images;
var img_item_ul=""; var img_item_ul="";
if(lp_img1.length=="0"){
$("#planter").hide();
}
for(var n=0;n<lp_img1.length;n++){ for(var n=0;n<lp_img1.length;n++){
slider3+='<div class="slide"><img src="'+response.data.api_path+response.data.plan_images[n].imagename+'"></div>' slider3+='<div class="slide"><img src="'+response.data.api_path+response.data.plan_images[n].imagename+'"></div>'
$(".slider3").html(slider3); $(".slider3").html(slider3);
......
/** /**
* Created by zw on 2017/12/15. * Created by zw on 2017/12/15.
*/ */
define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart', 'css!style/home.css','blow-up'], function (doT, template) { define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart', 'css!style/home.css', 'blow-up'], function (doT, template) {
var banner = { var banner = {
pageNo: 1, /*第几页*/ pageNo: 1, /*第几页*/
pageSize: 15, /*每页显示多少条*/ pageSize: 15, /*每页显示多少条*/
...@@ -34,6 +34,7 @@ define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart ...@@ -34,6 +34,7 @@ define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart
params.url = $ ("#url").val (); params.url = $ ("#url").val ();
params.cover_image = $ ("#cover_image").val (); params.cover_image = $ ("#cover_image").val ();
params.sort = $ ("#sort").val (); params.sort = $ ("#sort").val ();
params.type = $("#type").val();
if (!params.title || params.title == null) { if (!params.title || params.title == null) {
alert ("banner名称不能为空"); alert ("banner名称不能为空");
...@@ -89,9 +90,15 @@ define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart ...@@ -89,9 +90,15 @@ define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart
var params = {}; var params = {};
params.pageNo = banner.pageNo; params.pageNo = banner.pageNo;
params.pageSize = banner.pageSize; params.pageSize = banner.pageSize;
var url = '';
var requestPath = window.location.pathname;
if(requestPath.indexOf("advertising") > 0 ){
url = '/admin.php/index/getPopList';
}else{
url = '/admin.php/index/bannerList';
}
$.ajax ({ $.ajax ({
url: '/admin.php/index/bannerList', url: url,
type: 'POST', type: 'POST',
async: true, async: true,
data: params, data: params,
...@@ -110,7 +117,7 @@ define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart ...@@ -110,7 +117,7 @@ define (['doT', 'text!temp/banner_template_tpl.html', 'ckfinder', 'ckfinderStart
banner.getBannerList (el.num.current); banner.getBannerList (el.num.current);
} }
}); });
$('.J_preview').preview(); $ ('.J_preview').preview ();
} }
}); });
......
<?php
/**
* Created by PhpStorm.
* User : zw
* Date : 2017/12/14
* Time : 9:36
* Intro:
*/
// [ 应用入口文件 ]
// 定义应用目录
define('APP_PATH', __DIR__ . '/../application/');
// 加载框架引导文件
require __DIR__ . '/../thinkphp/start.php';
/*// 读取自动生成定义文件
$build = include './../build.php';
// 运行自动生成
\think\Build::run($build);*/
\ No newline at end of file
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