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
ac6d0a26
Commit
ac6d0a26
authored
Mar 19, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计
parent
b73048ac
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
152 additions
and
3 deletions
+152
-3
Shop.php
application/api_broker/controller/Shop.php
+14
-1
GHouses.php
application/model/GHouses.php
+22
-0
OBargainModel.php
application/model/OBargainModel.php
+16
-0
OMarchInModel.php
application/model/OMarchInModel.php
+22
-0
OPayLogModel.php
application/model/OPayLogModel.php
+21
-0
Users.php
application/model/Users.php
+21
-0
ResultsSummaryTask.php
application/task/controller/ResultsSummaryTask.php
+36
-2
No files found.
application/api_broker/controller/Shop.php
View file @
ac6d0a26
...
...
@@ -29,8 +29,12 @@ class Shop extends Basic
$this
->
attentionModel
=
new
AttentionModel
();
}
/**查询商品列表 b c端公用
/**
* 查询商品列表 b c端公用
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getShopList
()
{
...
...
@@ -46,6 +50,7 @@ class Shop extends Basic
"rent_price_start" => 1000,//租金 rent_price
"rent_price_end" => 10000,//租金
"shop_sign" => "临近地铁,临近地铁2",
"agent_id" => 1, //添加经纪人id
"pageNo" => 1,
"pageSize" => 15
);*/
...
...
@@ -100,6 +105,10 @@ class Shop extends Basic
$conditions
[
'shop_type'
]
=
array
(
"eq"
,
$params
[
'shop_type'
]
);
}
if
(
isset
(
$params
[
'agent_id'
])){
$conditions
[
'upload_id'
]
=
array
(
"eq"
,
$params
[
'agent_id'
]
);
}
$area_start
=
isset
(
$params
[
'shop_area_start'
])
?
$params
[
'shop_area_start'
]
:
-
1
;
$area_end
=
isset
(
$params
[
'shop_area_end'
])
?
$params
[
'shop_area_end'
]
:
-
1
;
if
(
$area_start
>=
0
&&
$area_end
>=
0
)
{
//面积
...
...
@@ -157,9 +166,13 @@ class Shop extends Basic
return
$this
->
response
(
"200"
,
'request success'
,
$result
);
}
/**
* 楼盘详情
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getShopDetail
()
{
...
...
application/model/GHouses.php
View file @
ac6d0a26
...
...
@@ -470,5 +470,27 @@ class GHouses extends BaseModel
}
/**
* 获取添加的楼盘的每天数量
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddHouseNumGroupTime
(
$params
){
$field
=
"count(1) as num,DATE(create_time) as day"
;
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
])){
$where_
[
"upload_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
])){
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$where_
)
->
group
(
"day"
)
->
select
();
}
/******zw end ************/
}
application/model/OBargainModel.php
View file @
ac6d0a26
...
...
@@ -282,4 +282,19 @@ class OBargainModel extends Model
->
where
(
$params
)
->
find
();
}
public
function
getAddBargainNumGroupTime
(
$params
){
$field
=
"count(1) as num,DATE(create_time) as day"
;
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
])){
$where_
[
"reception_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
])){
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$where_
)
->
group
(
"day"
)
->
select
();
}
}
\ No newline at end of file
application/model/OMarchInModel.php
View file @
ac6d0a26
...
...
@@ -75,4 +75,25 @@ class OMarchInModel extends Model
->
select
();
}
/**
* 查询经纪人进场数据
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddMarchInNumGroupTime
(
$params
){
$field
=
"count(1) as num,DATE(create_time) as day"
;
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
])){
$where_
[
"reception_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
])){
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$where_
)
->
group
(
"day"
)
->
select
();
}
}
\ No newline at end of file
application/model/OPayLogModel.php
View file @
ac6d0a26
...
...
@@ -73,4 +73,24 @@ class OPayLogModel extends Model
->
where
(
$where_
)
->
select
();
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddPayLogNumGroupTime
(
$params
){
$field
=
"count(1) as num,DATE(create_time) as day"
;
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
])){
$where_
[
"agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
])){
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$where_
)
->
group
(
"day"
)
->
select
();
}
}
\ No newline at end of file
application/model/Users.php
View file @
ac6d0a26
...
...
@@ -303,4 +303,25 @@ class Users extends Model
->
count
();
}
/**
* 按添加时间段分组统计
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddUserNumGroupTime
(
$params
){
$field
=
"count(1) as num,DATE(create_time) as day"
;
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
])){
$where_
[
"referrer_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
])){
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$where_
)
->
group
(
"day"
)
->
select
();
}
}
application/task/controller/ResultsSummaryTask.php
View file @
ac6d0a26
...
...
@@ -2,7 +2,11 @@
namespace
app\task\controller
;
use
app\model\AAgents
;
use
app\model\GHouses
;
use
app\model\OBargainModel
;
use
app\model\OMarchInModel
;
use
app\model\OPayLogModel
;
use
app\model\TAgentTotalModel
;
use
app\model\Users
;
/**
* Created by PhpStorm.
...
...
@@ -60,12 +64,42 @@ class ResultsSummaryTask{
}
}
public
function
test
(){
$this
->
selectTotal
(
1
,
"2018-02-02"
,
"2018-03-15"
);
}
private
function
selectTotal
(
$agent_id
,
$start_total_time
,
$end_total_time
){
//todo 如果查询出这个时间段都为0 则给此经纪人插入条最后一个日期的为空的数据
//房源
$house
Source
Model
=
new
GHouses
();
$houseModel
=
new
GHouses
();
$params
[
"agent_id"
]
=
$agent_id
;
$houseSourceModel
->
getAddHouseNumByAgentId
();
$params
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_total_time
,
$end_total_time
)
);
$addHouseNum
=
$houseModel
->
getAddHouseNumGroupTime
(
$params
);
//dump($addHouseNum);
//客源
$userModel
=
new
Users
();
$addUserNum
=
$userModel
->
getAddUserNumGroupTime
(
$params
);
//dump($addUserNum);
//业绩
//实收
//约带看
//进场
$marchInModel
=
new
OMarchInModel
();
$addMarchInNum
=
$marchInModel
->
getAddMarchInNumGroupTime
(
$params
);
//dump($addMarchInNum);
//收款
$payLogModel
=
new
OPayLogModel
();
$payLogNum
=
$payLogModel
->
getAddPayLogNumGroupTime
(
$params
);
//dump($payLogNum);
//监督
//成交报告
$bargainModel
=
new
OBargainModel
();
$bargainModel
->
getAddBargainNumGroupTime
(
$params
);
}
...
...
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