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
505bf9a2
Commit
505bf9a2
authored
Sep 17, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
e10fd5a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
15 deletions
+62
-15
ClinchMap.php
application/index/controller/ClinchMap.php
+62
-15
No files found.
application/index/controller/ClinchMap.php
View file @
505bf9a2
...
@@ -12,6 +12,7 @@ use app\index\extend\Basic;
...
@@ -12,6 +12,7 @@ use app\index\extend\Basic;
use
app\model\GHouses
;
use
app\model\GHouses
;
use
app\model\OBargainModel
;
use
app\model\OBargainModel
;
use
app\model\OMarchInModel
;
use
app\model\OMarchInModel
;
use
app\model\OPartialCommission
;
use
app\model\Users
;
use
app\model\Users
;
class
ClinchMap
extends
Basic
class
ClinchMap
extends
Basic
...
@@ -20,6 +21,8 @@ class ClinchMap extends Basic
...
@@ -20,6 +21,8 @@ class ClinchMap extends Basic
private
$gHousesModel
;
private
$gHousesModel
;
private
$userModel
;
private
$userModel
;
private
$marchInModel
;
private
$marchInModel
;
private
$bargainModel
;
private
$partialCommission
;
public
function
__construct
(
$request
=
null
)
public
function
__construct
(
$request
=
null
)
...
@@ -28,6 +31,9 @@ class ClinchMap extends Basic
...
@@ -28,6 +31,9 @@ class ClinchMap extends Basic
$this
->
gHousesModel
=
new
GHouses
();
$this
->
gHousesModel
=
new
GHouses
();
$this
->
userModel
=
new
Users
();
$this
->
userModel
=
new
Users
();
$this
->
marchInModel
=
new
OMarchInModel
();
$this
->
marchInModel
=
new
OMarchInModel
();
$this
->
bargainModel
=
new
OBargainModel
();
$this
->
partialCommission
=
new
OPartialCommission
();
}
}
...
@@ -37,13 +43,8 @@ class ClinchMap extends Basic
...
@@ -37,13 +43,8 @@ class ClinchMap extends Basic
*/
*/
public
function
clinchMapInfo
()
public
function
clinchMapInfo
()
{
{
$m_bargain
=
new
OBargainModel
();
$where_
=
[];
$performanceSum
=
$m_bargain
->
getAddBargainNumClinchMap
(
$where_
);
$shop_bargain_num
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
//成交数
//成交数
$result
[
'bargain_num'
]
=
$
shop_bargain_num
;
$result
[
'bargain_num'
]
=
$
this
->
getCityBargainInfo
()
;
//城市 当月成交 总成交
//城市 当月成交 总成交
$result
[
'city_bargain_info'
]
=
$this
->
getCityBargainInfo
();
$result
[
'city_bargain_info'
]
=
$this
->
getCityBargainInfo
();
...
@@ -56,21 +57,33 @@ class ClinchMap extends Basic
...
@@ -56,21 +57,33 @@ class ClinchMap extends Basic
$result
[
"house_num"
]
=
$house_num
[
'house_num'
];
//商铺总量
$result
[
"house_num"
]
=
$house_num
[
'house_num'
];
//商铺总量
$result
[
"have_not_rent_num"
]
=
$house_num
[
'have_not_rent_num'
];
//待租商铺数量
$result
[
"have_not_rent_num"
]
=
$house_num
[
'have_not_rent_num'
];
//待租商铺数量
$result
[
"performance_info"
]
=
$this
->
getPerformanceInfo
();
return
$this
->
response
(
200
,
'success'
,
$result
);
return
$this
->
response
(
200
,
'success'
,
$result
);
}
}
/**
* 成交数
* @return int
*/
public
function
getShopBargainNum
()
{
$m_bargain
=
new
OBargainModel
();
$conditions
=
[];
$performanceSum
=
$m_bargain
->
getAddBargainNumClinchMap
(
$conditions
);
$shop_bargain_num
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
return
$shop_bargain_num
;
}
/**
/**
* 客户总数
* 客户总数
* @return int
* @return int
*/
*/
public
function
getUserNum
()
public
function
getUserNum
()
{
{
$
where
=
[];
$
conditions
=
[];
$
where
[
'status'
]
=
0
;
$
conditions
[
'status'
]
=
0
;
$addUserNum
=
$this
->
userModel
->
getAddUserNumForOperation
(
$
where
);
$addUserNum
=
$this
->
userModel
->
getAddUserNumForOperation
(
$
conditions
);
$user_num
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
$user_num
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
return
$user_num
;
return
$user_num
;
}
}
...
@@ -81,13 +94,13 @@ class ClinchMap extends Basic
...
@@ -81,13 +94,13 @@ class ClinchMap extends Basic
*/
*/
public
function
houseNum
()
public
function
houseNum
()
{
{
$
where
[
'status'
]
=
array
(
'neq'
,
3
);
//排除删除的商铺
$
conditions
[
'status'
]
=
array
(
'neq'
,
3
);
//排除删除的商铺
// 商铺总量
// 商铺总量
$house_res
=
$this
->
gHousesModel
->
getHouseListTotal
(
$
where
);
$house_res
=
$this
->
gHousesModel
->
getHouseListTotal
(
$
conditions
);
$result
[
"house_num"
]
=
$house_res
;
$result
[
"house_num"
]
=
$house_res
;
// 待租商铺数量
// 待租商铺数量
$
where
[
'status'
]
=
1
;
$
conditions
[
'status'
]
=
1
;
$house_res
=
$this
->
gHousesModel
->
getHouseListTotal
(
$
where
);
$house_res
=
$this
->
gHousesModel
->
getHouseListTotal
(
$
conditions
);
$result
[
"have_not_rent_num"
]
=
$house_res
;
$result
[
"have_not_rent_num"
]
=
$house_res
;
return
$result
;
return
$result
;
}
}
...
@@ -122,6 +135,39 @@ class ClinchMap extends Basic
...
@@ -122,6 +135,39 @@ class ClinchMap extends Basic
return
$city_arr
;
return
$city_arr
;
}
}
/**
* 业绩
* @return array
*/
public
function
getPerformanceInfo
()
{
$time_arr
=
[
date
(
'Y-m'
,
strtotime
(
'-1 month'
))
=>
[
'type'
=>
'1'
],
date
(
'Y-m'
,
strtotime
(
'-2 month'
))
=>
[
'type'
=>
'2'
],
date
(
'Y-m'
,
strtotime
(
'-3 month'
))
=>
[
'type'
=>
'3'
],
date
(
'Y-m'
,
strtotime
(
'-4 month'
))
=>
[
'type'
=>
'4'
],
date
(
'Y-m'
,
strtotime
(
'-5 month'
))
=>
[
'type'
=>
'5'
],
date
(
'Y-m'
,
strtotime
(
'-6 month'
))
=>
[
'type'
=>
'6'
],
date
(
'Y-m'
,
strtotime
(
'-7 month'
))
=>
[
'type'
=>
'7'
],
date
(
'Y-m'
,
strtotime
(
'-8 month'
))
=>
[
'type'
=>
'8'
],
date
(
'Y-m'
,
strtotime
(
'-9 month'
))
=>
[
'type'
=>
'9'
],
date
(
'Y-m'
,
strtotime
(
'-10 month'
))
=>
[
'type'
=>
'10'
]];
foreach
(
$time_arr
as
$key
=>
$v
)
{
$start_time
=
date
(
'Y-m-d'
,
strtotime
(
date
(
'Y-m-01'
)
.
"-
{
$v
[
'type'
]
}
month"
));
// 计算出本月第一天再减一个月
$last_num
=
$v
[
'type'
]
-
1
;
$last_time
=
date
(
'Y-m-d'
,
strtotime
(
date
(
'Y-m-01'
)
.
"-
{
$last_num
}
month"
));
//计算出本月
$end_time
=
date
(
'Y-m-d'
,
strtotime
(
$last_time
.
' -1 day'
));
//本月第一天再减一天
// $conditions['agent_id'] = array( "in", $agent_res['agent_ids'] );
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
// 业绩
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNumV3
(
$conditions
,
1
);
//1表示业绩 2表示实收
$time_arr
[
$key
][
"performance"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
// 实收
$real_performanceSum
=
$this
->
partialCommission
->
getReceived
(
$conditions
);
$time_arr
[
$key
][
"real_performance"
]
=
isset
(
$real_performanceSum
[
0
][
"num"
])
?
$real_performanceSum
[
0
][
"num"
]
:
0
;
}
return
$time_arr
;
}
}
}
\ No newline at end of file
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