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
6e2c5fcd
Commit
6e2c5fcd
authored
Sep 17, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
891d3674
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
148 additions
and
3 deletions
+148
-3
Broker.php
application/api/controller/Broker.php
+1
-0
ClinchMap.php
application/index/controller/ClinchMap.php
+128
-0
AAgents.php
application/model/AAgents.php
+2
-0
OBargainModel.php
application/model/OBargainModel.php
+15
-3
route.php
application/route.php
+2
-0
No files found.
application/api/controller/Broker.php
View file @
6e2c5fcd
...
...
@@ -509,6 +509,7 @@ class Broker extends Basic
*/
public
function
brokerDetail
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$data
[
'status'
]
=
200
;
$data
[
'data'
]
=
[];
...
...
application/index/controller/ClinchMap.php
0 → 100644
View file @
6e2c5fcd
<?php
namespace
app\index\controller
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019/9/17
* Time: 15:40:20
*/
use
app\index\extend\Basic
;
use
app\model\GHouses
;
use
app\model\OBargainModel
;
use
app\model\OMarchInModel
;
use
app\model\Users
;
class
ClinchMap
extends
Basic
{
private
$gHousesModel
;
private
$userModel
;
private
$marchInModel
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
gHousesModel
=
new
GHouses
();
$this
->
userModel
=
new
Users
();
$this
->
marchInModel
=
new
OMarchInModel
();
}
/**
* 成交地图信息
* @return \think\Response
*/
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
[
'city_bargain_info'
]
=
$this
->
getCityBargainInfo
();
//客户总数
$result
[
"create_user_num"
]
=
$this
->
getUserNum
();
//商铺总量 待租商铺数量
$house_num
=
$this
->
houseNum
();
$result
[
"house_num"
]
=
$house_num
[
'house_num'
];
//商铺总量
$result
[
"have_not_rent_num"
]
=
$house_num
[
'have_not_rent_num'
];
//待租商铺数量
return
$this
->
response
(
200
,
'success'
,
$result
);
}
/**
* 客户总数
* @return int
*/
public
function
getUserNum
()
{
$where
=
[];
$where
[
'status'
]
=
0
;
$addUserNum
=
$this
->
userModel
->
getAddUserNumForOperation
(
$where
);
$user_num
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
return
$user_num
;
}
/**
* 商铺总量 待租商铺数量
* @return mixed
*/
public
function
houseNum
()
{
$where
[
'status'
]
=
array
(
'neq'
,
3
);
//排除删除的商铺
// 商铺总量
$house_res
=
$this
->
gHousesModel
->
getHouseListTotal
(
$where
);
$result
[
"house_num"
]
=
$house_res
;
// 待租商铺数量
$where
[
'status'
]
=
1
;
$house_res
=
$this
->
gHousesModel
->
getHouseListTotal
(
$where
);
$result
[
"have_not_rent_num"
]
=
$house_res
;
return
$result
;
}
/**
* 城市 当月成交 总成交
* @return array
*/
public
function
getCityBargainInfo
()
{
$m_bargain
=
new
OBargainModel
();
$start_time
=
date
(
"Y-m-01"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
time
());
$city_arr
=
[
'上海市'
=>
[
'site_id'
=>
'10001'
],
'杭州市'
=>
[
'site_id'
=>
'10002'
],
'深圳市'
=>
[
'site_id'
=>
'10003'
],
'广州市'
=>
[
'site_id'
=>
'10004'
],
'北京市'
=>
[
'site_id'
=>
'10005'
]];
foreach
(
$city_arr
as
$key
=>
$v
)
{
$conditions
[
'a.create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$conditions
[
'c.city'
]
=
$key
;
$performanceSum
=
$m_bargain
->
getAddBargainNumClinchMap
(
$conditions
);
$month_bargain_num
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$city_arr
[
$key
][
'month_bargain_num'
]
=
$month_bargain_num
;
$conditions
=
[];
$conditions
[
'c.city'
]
=
$key
;
$performanceSum
=
$m_bargain
->
getAddBargainNumClinchMap
(
$conditions
);
$all_bargain_num
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$city_arr
[
$key
][
'all_bargain_num'
]
=
$all_bargain_num
;
}
return
$city_arr
;
}
}
\ No newline at end of file
application/model/AAgents.php
View file @
6e2c5fcd
...
...
@@ -1246,6 +1246,8 @@ class AAgents extends BaseModel
$result
[
'evaluate_grade_attitude'
]
=
$evaluate_grade_attitude
;
//评分等级 态度分
$result
[
'evaluate_grade_clothing'
]
=
$evaluate_grade_clothing
;
//评分等级 着装分
$result
[
'average_evaluate'
]
=
round
((
$grade
+
$evaluate_grade_attitude
+
$evaluate_grade_clothing
)
/
3
,
1
);
//平均分
$result
[
'evaluate_num'
]
=
$evaluate_grade
[
'evaluate_num'
];
//评论数量
$result
[
'watch_shop'
]
=
Db
::
table
(
'u_appoint_watch_shop'
)
->
where
(
'agents_id'
,
$id
)
->
count
();
//看铺
...
...
application/model/OBargainModel.php
View file @
6e2c5fcd
...
...
@@ -1630,7 +1630,6 @@ class OBargainModel extends Model
//$where_["trade_type"] = 10;//产品要求统计数量必须是出租类型的180620
$params
[
"a.role"
]
=
3
;
//必须是反签方
$params
[
'c.shop_type'
]
=
$type
==
0
?
0
:
1
;
// dump($params);
$return
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
...
...
@@ -1638,11 +1637,24 @@ class OBargainModel extends Model
->
join
(
"g_houses c"
,
"b.house_id = c.id"
,
"left"
)
->
where
(
$params
)
->
select
();
/*echo $this->getLastSql();
echo '--------------';*/
// echo $this->getLastSql();
return
$return
;
}
public
function
getAddBargainNumClinchMap
(
$params
)
{
$field
=
"count(1) as num"
;
$params
[
"a.role"
]
=
3
;
//必须是反签方
$return
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"g_houses c"
,
"b.house_id = c.id"
,
"left"
)
->
where
(
$params
)
->
select
();
// echo $this->getLastSql();
return
$return
;
}
/**
* @param $field
* @param $where
...
...
application/route.php
View file @
6e2c5fcd
...
...
@@ -599,6 +599,8 @@ Route::group('index', [
'getShopLookList'
=>
[
'index/LookShop/getShopLookList'
,
[
'method'
=>
'POST|GET'
]],
//客户看了哪些铺记录
'clinchMapInfo'
=>
[
'index/ClinchMap/clinchMapInfo'
,
[
'method'
=>
'get | post'
]
],
]);
...
...
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