Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
efda913b
Commit
efda913b
authored
Dec 07, 2017
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询均量
parent
42740e38
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
97 deletions
+58
-97
Index.php
application/api/controller/Index.php
+18
-74
Shop.php
application/api/controller/Shop.php
+5
-4
common.php
application/common.php
+8
-17
config.php
application/config.php
+0
-1
HouseInfos.php
application/model/HouseInfos.php
+27
-1
No files found.
application/api/controller/Index.php
View file @
efda913b
<?php
/**
* Created by PhpStorm.
* User : zw
* Date : 2017/12/7
* Time : 15:16
* Intro: c端首页资源 banner 月均价 上周成交量
*/
namespace
app\api\controller
;
use
app\index\model\Agents
;
use
think\Controller
;
use
think\Request
;
use
app\api\extend\Basic
;
use
app\model\HouseInfos
;
class
Index
extends
Controller
class
Index
extends
Basic
{
/**
* 显示资源列表
*
* @return \think\Response
*/
public
function
index
()
{
}
/**
* 显示创建资源表单页.
*
* @return \think\Response
*/
public
function
create
()
{
//
}
/**
* 保存新建的资源
*
* @param \think\Request $request
* @return \think\Response
*/
public
function
save
(
Request
$request
)
{
//
}
public
function
banner
(){
/**
* 显示指定的资源
*
* @param int $id
* @return \think\Response
*/
public
function
read
(
$id
)
{
//
}
}
/**
* 显示编辑资源表单页.
*
* @param int $id
* @return \think\Response
* 月均价 上周成交量
*/
public
function
edit
(
$id
)
{
//
}
public
function
averagePriceAndTurnover
(){
/**
* 保存更新的资源
*
* @param \think\Request $request
* @param int $id
* @return \think\Response
*/
public
function
update
(
Request
$request
,
$id
)
{
//
}
$HouseInfos
=
new
HouseInfos
();
$result
=
$HouseInfos
->
getAveragePrice
();
return
$result
;
/**
* 删除指定资源
*
* @param int $id
* @return \think\Response
*/
public
function
delete
(
$id
)
{
//
}
}
}
application/api/controller/Shop.php
View file @
efda913b
...
...
@@ -15,11 +15,12 @@ use app\model\HouseInfos;
class
Shop
extends
Basic
{
/**
获取商铺列表
* @
param $params
/**
* @
return \think\Response
*/
public
function
getShopList
()
{
echo
define
(
AAA
);
exit
;
$params
=
array
(
"site_area"
=>
2
,
//来源 1首页 2搜索
"title"
=>
"尚美"
,
...
...
@@ -33,8 +34,8 @@ class Shop extends Basic
);
$field
=
"id,agent_id,title,address,city,disc,disccircles,sales,yetai,room_area2,shangpu_type,is_test,
room_num_left,
shangpu_tags,carefully_chosen,price"
;
$field
=
"id,agent_id,title,address,city,disc,disccircles,sales,yetai,room_area2,shangpu_type,is_test,
room_num_left,
shangpu_tags,carefully_chosen,price"
;
$conditions
=
[];
if
(
empty
(
$params
[
'site_area'
]))
{
...
...
application/common.php
View file @
efda913b
...
...
@@ -7,27 +7,17 @@
*/
if
(
!
function_exists
(
'create_editor'
))
{
function
create_editor
(
$id
,
$value
=
''
,
$config
=
array
()){
// Include the CKEditor class.
if
(
!
function_exists
(
'create_editor'
))
{
function
create_editor
(
$id
,
$value
=
''
,
$config
=
array
())
{
include_once
"../public/resource/lib/Ckeditor/ckeditor.php"
;
// Create a class instance.
$CKEditor
=
new
CKEditor
(
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
'/resource/lib/Ckeditor/'
);
// Path to the CKEditor directory, ideally use an absolute path instead of a relative dir.
// $CKEditor->basePath = '/ckeditor/'
// If not set, CKEditor will try to detect the correct path.
// Replace a textarea element with an id (or name) of "editor1".
$CKEditor
=
new
CKEditor
(
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
'/resource/lib/Ckeditor/'
);
$_config
[
'filebrowserBrowseUrl'
]
=
'/resource/lib/Ckfinder/ckfinder.html'
;
$_config
[
'filebrowserImageBrowseUrl'
]
=
'/resource/lib/Ckfinder/ckfinder.html?Type=Images'
;
//$_config['filebrowserUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
//$_config['filebrowserImageUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images';
if
(
!
empty
(
$config
)){
$_config
=
array_merge
(
$_config
,
$config
);
if
(
!
empty
(
$config
))
{
$_config
=
array_merge
(
$_config
,
$config
);
}
$CKEditor
->
editor
(
"describe"
,
$value
,
$_config
);
//$CKEditor->replace("describe");
$CKEditor
->
editor
(
"describe"
,
$value
,
$_config
);
}
}
\ No newline at end of file
application/config.php
View file @
efda913b
...
...
@@ -8,7 +8,6 @@
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
return
[
// +----------------------------------------------------------------------
// | 应用设置
...
...
application/model/HouseInfos.php
View file @
efda913b
...
...
@@ -15,7 +15,16 @@ class HouseInfos extends Model
$this
->
dbHouseInfo
=
Db
::
table
(
$this
->
table
);
}
function
getHouseInfoList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
)
/**
* 获取商铺列表
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
function
getHouseInfoList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
)
{
return
$data
=
$this
->
dbHouseInfo
->
field
(
$field
)
...
...
@@ -27,4 +36,21 @@ class HouseInfos extends Model
}
function
getAveragePrice
()
{
//price
$params
[
'rent_type'
]
=
array
(
"eq"
,
1
);
//月租金类型
$params
[
'room_num_left'
]
=
array
(
"<>"
,
0
);
//剩余店铺为0的不算
$sumPrice
=
$this
->
dbHouseInfo
->
where
(
$params
)
->
sum
(
"price"
);
$count_
=
$this
->
dbHouseInfo
->
field
(
"id"
)
->
where
(
$params
)
->
count
(
"id"
);
$averagePrice
=
ceil
(
$sumPrice
/
$count_
);
return
$averagePrice
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment