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
14c2778b
Commit
14c2778b
authored
Aug 15, 2018
by
clone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test-0814-bug' into test
# Conflicts: # application/index/service/PerformanceService.php
parents
de010fbf
2c2e42a5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
1026 additions
and
316 deletions
+1026
-316
Broker.php
application/api_broker/controller/Broker.php
+13
-5
HomePageLog.php
application/api_broker/controller/HomePageLog.php
+86
-34
Performance.php
application/api_broker/controller/Performance.php
+4
-4
Shop.php
application/api_broker/controller/Shop.php
+8
-0
CallPhoneService.php
application/api_broker/service/CallPhoneService.php
+7
-2
PerformanceService.php
application/api_broker/service/PerformanceService.php
+7
-123
shop_detail_pc.html
application/app_broker/view/index/shop_detail_pc.html
+7
-7
Finance.php
application/index/controller/Finance.php
+19
-1
HouseFollowUp.php
application/index/controller/HouseFollowUp.php
+32
-6
Houses.php
application/index/controller/Houses.php
+0
-0
Remark.php
application/index/controller/Remark.php
+37
-22
PerformanceService.php
application/index/service/PerformanceService.php
+0
-0
users_list.html
application/index/view/member/users_list.html
+4
-3
realtimePerformance.html
application/index/view/realtime/realtimePerformance.html
+14
-0
remark_follow_index.html
application/index/view/remark/remark_follow_index.html
+2
-2
AAgents.php
application/model/AAgents.php
+56
-13
ASuperviseModel.php
application/model/ASuperviseModel.php
+21
-0
GHouses.php
application/model/GHouses.php
+85
-15
GHousesFollowUp.php
application/model/GHousesFollowUp.php
+28
-4
GHousesToAgents.php
application/model/GHousesToAgents.php
+18
-3
GOperatingRecords.php
application/model/GOperatingRecords.php
+11
-4
OBargainModel.php
application/model/OBargainModel.php
+75
-5
OMarchInModel.php
application/model/OMarchInModel.php
+21
-0
OPayLogModel.php
application/model/OPayLogModel.php
+21
-0
OReportModel.php
application/model/OReportModel.php
+24
-0
TAgentTotalModel.php
application/model/TAgentTotalModel.php
+18
-0
UPhoneFollowPp.php
application/model/UPhoneFollowPp.php
+44
-12
Users.php
application/model/Users.php
+33
-0
route.php
application/route.php
+3
-0
ResultsSummaryNewTask.php
application/task/controller/ResultsSummaryNewTask.php
+235
-0
RemarkFollowIndex.js
public/resource/js/RemarkFollowIndex.js
+18
-0
houseFollowUp.js
public/resource/js/houseFollowUp.js
+6
-0
realtimePerformance.js
public/resource/js/realtimePerformance.js
+21
-1
reportList.js
public/resource/js/reportList.js
+5
-4
real_time_performance_template_tpl.html
...resource/template/real_time_performance_template_tpl.html
+43
-46
No files found.
application/api_broker/controller/Broker.php
View file @
14c2778b
...
...
@@ -271,13 +271,14 @@ class Broker extends Basic
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*
$params['content']='跟进内容';//跟进内容
/*
$params['content']='跟进内容';//跟进内容
$params['labels_id']=1;//g_labels表主键
$params['user_id']=
1
;//u_users ID用户表id
$params['user_id']=
59072
;//u_users ID用户表id
$params['agent_id']=1;//agent表id-当前登录用户id
$params['type']='1';//0电话跟进 1普通跟进
*/
$params['user_status']='1';//0电话跟进 1普通跟进*/
$checkResult
=
$this
->
validate
(
$params
,
"BrokerValidate.verifyStatus"
);
if
(
true
!==
$checkResult
)
{
...
...
@@ -287,11 +288,18 @@ class Broker extends Basic
$user_id
=
$params
[
'user_id'
];
$user_status
=
$params
[
'user_status'
];
$Users
=
new
Users
();
$result
=
$Users
->
getUserCityInfo
(
$user_id
);
if
(
$result
){
$params
[
'province'
]
=
$result
[
0
][
'province'
]
?
$result
[
0
][
'province'
]
:
'上海市'
;
$params
[
'city'
]
=
$result
[
0
][
'city'
]
?
$result
[
0
][
'city'
]
:
'上海市'
;
$params
[
'disc'
]
=
$result
[
0
][
'disc'
]
?
$result
[
0
][
'disc'
]
:
'黄浦区'
;
}
//主表查询商铺详细信息
$UPhoneFollowPp
=
new
UPhoneFollowPp
();
$result
=
$UPhoneFollowPp
->
savePhoneFollow
(
$params
);
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
$Users
=
new
Users
();
$Users
->
update_user_status
([
'id'
=>
$user_id
,
'user_status'
=>
$user_status
]);
if
(
$result
==
1
)
{
...
...
application/api_broker/controller/HomePageLog.php
View file @
14c2778b
...
...
@@ -3,6 +3,8 @@
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\model\AAgents
;
use
app\model\GHouses
;
use
app\model\GHousesFollowUp
;
use
app\model\UPhoneFollowPp
;
use
think\Request
;
...
...
@@ -37,11 +39,11 @@ class HomePageLog extends Basic
public
function
userFollowUpList
()
{
$params
=
$this
->
params
;
/*
$params = array(
"start_time" => time(
), //开始时间
"end_time" => time() . " 23:59:59"
, //结束时间
"name_or_phone" => "li
",//用户姓名或电话 经纪人
"search_content" => "111
",// 搜索跟进内容
/*$params = array(
"start_time" => strtotime('2016-08-14 15:47:36'
), //开始时间
"end_time" => strtotime('2018-08-14 15:47:36')
, //结束时间
"name_or_phone" => "18112347151
",//用户姓名或电话 经纪人
"search_content" => "
",// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
...
...
@@ -53,7 +55,7 @@ class HomePageLog extends Basic
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$field
=
"f.id,f.user_id,f.agent_id,f.type,f.content,f.create_time,f.user_status
,a.name,a.img,b.store_name
"
;
$field
=
"f.id,f.user_id,f.agent_id,f.type,f.content,f.create_time,f.user_status"
;
$where_
=
[];
if
(
!
empty
(
$params
[
"search_content"
]))
{
$where_
[
"f.content"
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'search_content'
])
.
"%"
);
...
...
@@ -63,25 +65,44 @@ class HomePageLog extends Basic
$end_time
=
date
(
"Y-m-d H:i:s"
,
$params
[
"end_time"
]);
$where_
[
"f.create_time"
]
=
array
(
'between'
,
array
(
$start_time
,
$end_time
)
);
}
if
(
!
empty
(
$params
[
"name_or_phone"
]))
{
$where_
[
"a.name|a.phone"
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
"name_or_phone"
])
.
"%"
);
if
((
preg_match
(
"/^1\d
{
10
}
$/"
,
$params
[
'name_or_phone'
])
!=
1
)
or
(
strlen
(
$params
[
'name_or_phone'
])
<
6
))
{
return
$this
->
response
(
"300"
,
'手机号有误或者姓名不满两位汉字'
);
}
$agent_params
[
"phone|name"
]
=
$params
[
"name_or_phone"
];
$agent_field
=
"id"
;
$model
=
new
AAgents
();
$res_a
=
$model
->
getAgentsIdsArray
(
$agent_field
,
$agent_params
);
if
(
$res_a
)
{
$where_
[
"f.agent_id"
]
=
[
'in'
,
$res_a
];
}
}
$where_
[
"
u.city"
]
=
trim
(
$this
->
city
)
;
$where_
[
"
f.city"
]
=
trim
(
$this
->
city
)
?
trim
(
$this
->
city
)
:
'上海市'
;
$join
=
[
[
'a_agents a'
,
'a.id=f.agent_id'
,
'left'
],
[
'u_users u'
,
'u.id=f.user_id'
,
'left'
],
[
'a_store b'
,
'b.id=a.store_id'
,
'left'
],
];
$order
=
"f.id desc"
;
$result
=
$this
->
uPhoneFollowUpModel
->
getSearch
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where_
,
""
);
//$count = $this->uPhoneFollowUpModel->getSearchCount($join, $where_);
$result
=
$this
->
uPhoneFollowUpModel
->
getSearch
(
$pageNo
,
$pageSize
,
$order
,
$field
,
[],
$where_
,
""
);
foreach
(
$result
as
$key
=>
$value
)
{
$agent_params
=
[];
$agent_params
[
"a.id"
]
=
$value
[
'agent_id'
];
$agent_field
=
"a.name,a.img,b.store_name"
;
$model
=
new
AAgents
();
$res_a
=
$model
->
getAgentsInfo
(
$agent_field
,
$agent_params
);
$result
[
$key
][
'name'
]
=
$res_a
[
0
][
'name'
];
$result
[
$key
][
'img'
]
=
$res_a
[
0
][
'img'
];
$result
[
$key
][
'store_name'
]
=
$res_a
[
0
][
'store_name'
];
}
$count
=
$this
->
uPhoneFollowUpModel
->
getSearchCount
(
$where_
);
if
(
count
(
$result
)
>
0
)
{
$list
[
"result"
]
=
$result
;
$list
[
"img_path"
]
=
AGENTHEADERIMGURL
;
//暂时处理
$list
[
"total"
]
=
0
;
$list
[
"total"
]
=
$count
;
return
$this
->
response
(
"200"
,
"request success"
,
$list
);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
...
...
@@ -100,16 +121,16 @@ class HomePageLog extends Basic
public
function
houseFollowUpList
()
{
$params
=
$this
->
params
;
/* $params = array(
"start_time" => time(), //开始时间
"end_time" => time() . " 23:59:59", //结束时间
"name_or_phone" => "li",//用户姓名或电话
"search_content" => "111",// 搜索跟进内容
/*$params = array(
"start_time" => strtotime('2016-08-14 11:02:36'), //开始时间
"end_time" => strtotime('2018-08-14 11:07:10'), //结束时间
"name_or_phone" => "18112347151",//用户姓名或电话
"search_content" => "1",// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
if
(
empty
(
$params
[
'start_time'
])
||
empty
(
$params
[
'end_time'
]))
{
return
$this
->
response
(
"101"
,
'请选择时间'
);
}
...
...
@@ -119,37 +140,68 @@ class HomePageLog extends Basic
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$field
=
"f.id,f.house_id,f.agent_id,f.follow_up_info,f.create_time,
a.name,a.img,b.store_name,c.internal_titl
e"
;
$field
=
"f.id,f.house_id,f.agent_id,f.follow_up_info,f.create_time,
f.agent_name as nam
e"
;
if
(
!
empty
(
$params
[
"search_content"
]))
{
$where_
[
"f.follow_up_info"
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'search_content'
])
.
"%"
);
}
if
(
!
empty
(
$params
[
"start_time"
])
&&
!
empty
(
$params
[
"end_time"
]))
{
$start_time
=
date
(
"Y-m-d H:i:s"
,
$params
[
"start_time"
]);
$end_time
=
date
(
"Y-m-d H:i:s"
,
$params
[
"end_time"
]);
$where_
[
"f.create_time"
]
=
array
(
'between'
,
array
(
$start_time
,
$end_time
)
);
}
if
(
!
empty
(
$params
[
"name_or_phone"
]))
{
$where_
[
"a.phone|a.name"
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
"name_or_phone"
])
.
"%"
);
}
if
(
empty
(
$params
[
'city'
]))
{
$where_
[
"
c.city"
]
=
trim
(
$this
->
city
)
;
$where_
[
"
f.city"
]
=
trim
(
$this
->
city
)
?
trim
(
$this
->
city
)
:
'上海市'
;
}
else
{
$where_
[
"
c.city"
]
=
$params
[
'city'
]
;
$where_
[
"
f.city"
]
=
$params
[
'city'
]
?
$params
[
'city'
]
:
'上海市'
;
}
if
(
!
empty
(
$params
[
'disc'
]))
{
$where_
[
"c.disc"
]
=
$params
[
'disc'
];
$where_
[
"f.disc"
]
=
$params
[
'disc'
];
}
if
(
!
empty
(
$params
[
"province"
])
&&
!
empty
(
$params
[
"province"
]))
{
$where_
[
"f.province"
]
=
$params
[
"province"
];
}
if
(
!
empty
(
$params
[
"name_or_phone"
]))
{
if
((
preg_match
(
"/^1\d
{
10
}
$/"
,
$params
[
'name_or_phone'
])
!=
1
)
or
(
strlen
(
$params
[
'name_or_phone'
])
<
6
))
{
return
$this
->
response
(
"300"
,
'手机号有误或者姓名不满两位汉字'
);
}
//$agent_params["phone|name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
$agent_params
[
"phone|name"
]
=
$params
[
"name_or_phone"
];
$agent_field
=
"id"
;
$model
=
new
AAgents
();
$res_a
=
$model
->
getAgentsIdsArray
(
$agent_field
,
$agent_params
);
if
(
$res_a
)
{
$where_
[
"f.agent_id"
]
=
[
'in'
,
$res_a
];
}
}
$join
=
[
[
'a_agents a'
,
'a.id=f.agent_id'
,
'left'
],
[
'a_store b'
,
'b.id=a.store_id'
,
'left'
],
[
'g_houses c'
,
'f.house_id=c.id'
,
'left'
]
];
$join
=
[];
$order
=
"f.id desc"
;
$result
=
$this
->
gHouseFollowUpModel
->
getSearch
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where_
,
""
);
foreach
(
$result
as
$key
=>
$value
)
{
$agent_params
=
[];
$agent_params
[
"a.id"
]
=
$value
[
'agent_id'
];
$agent_field
=
"a.name,a.img,b.store_name"
;
$model
=
new
AAgents
();
$res_a
=
$model
->
getAgentsInfo
(
$agent_field
,
$agent_params
);
$result
[
$key
][
'name'
]
=
$res_a
[
0
][
'name'
];
$result
[
$key
][
'img'
]
=
$res_a
[
0
][
'img'
];
$result
[
$key
][
'store_name'
]
=
$res_a
[
0
][
'store_name'
];
$house_params
=
[];
$house_params
[
"id"
]
=
$value
[
'house_id'
];
$house_field
=
"internal_title"
;
$model
=
new
GHouses
();
$res_a
=
$model
->
getHouseInfo
(
$house_field
,
$house_params
);
$result
[
$key
][
'internal_title'
]
=
$res_a
[
0
][
'internal_title'
];
}
$count
=
$this
->
gHouseFollowUpModel
->
getSearchCount
(
$join
,
$where_
);
if
(
count
(
$result
)
>
0
)
{
$list
[
"result"
]
=
$result
;
...
...
application/api_broker/controller/Performance.php
View file @
14c2778b
...
...
@@ -85,7 +85,7 @@ class Performance extends Basic
$house_id
=
$params
[
"house_id"
];
}
try
{
$result
=
$this
->
service_
->
personagePerformance
(
$params
[
"agent_id"
],
$params
[
"start_time"
],
$params
[
"end_time"
],
$result
=
$this
->
service_
->
personagePerformance
(
$params
[
"agent_id"
],
$params
[
"start_time"
],
$params
[
"end_time"
]
.
" 23:59:59"
,
$params
[
"is_case"
],
$house_id
);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
catch
(
Exception
$exception
)
{
...
...
@@ -108,7 +108,7 @@ class Performance extends Basic
"end_time" => "2018-06-25",
);*/
try
{
$result
=
$this
->
service_
->
storePerformance
(
$params
[
"agent_id"
],
$params
[
"start_time"
],
$params
[
"end_time"
]);
$result
=
$this
->
service_
->
storePerformance
(
$params
[
"agent_id"
],
$params
[
"start_time"
],
$params
[
"end_time"
]
.
" 23:59:59"
);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
catch
(
Exception
$exception
)
{
return
$this
->
response
(
"101"
,
"request error,msg:"
.
$exception
);
...
...
@@ -164,11 +164,11 @@ class Performance extends Basic
"end_time" => "2018-04-12",
);*/
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"start_time"
])
||
!
isset
(
$params
[
"end_time"
]))
{
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"start_time"
])
||
!
isset
(
$params
[
"end_time"
]
))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
try
{
$result
=
$this
->
service_
->
storeSortByDistrictId
(
$params
[
"agent_id"
],
$params
[
"is_store"
],
$params
[
"start_time"
],
$params
[
"end_time"
]);
$result
=
$this
->
service_
->
storeSortByDistrictId
(
$params
[
"agent_id"
],
$params
[
"is_store"
],
$params
[
"start_time"
],
$params
[
"end_time"
]
.
" 23:59:59"
);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
catch
(
Exception
$exception
)
{
...
...
application/api_broker/controller/Shop.php
View file @
14c2778b
...
...
@@ -577,6 +577,14 @@ class Shop extends Basic
||
!
isset
(
$params
[
"agent_name"
])
||
!
isset
(
$params
[
"agent_phone"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$result
=
$this
->
gHousesModel
->
getHouseInfo
(
'province,city,disc'
,
[
'id'
=>
$params
[
"house_id"
]]);
if
(
$result
){
$params
[
'province'
]
=
$result
[
0
][
'province'
]
?
$result
[
0
][
'province'
]
:
'上海市'
;
$params
[
'city'
]
=
$result
[
0
][
'city'
]
?
$result
[
0
][
'city'
]
:
'上海市'
;
$params
[
'disc'
]
=
$result
[
0
][
'disc'
]
?
$result
[
0
][
'disc'
]
:
'黄浦区'
;
}
$follow_up_model
=
new
GHousesFollowUp
();
$id
=
$follow_up_model
->
addHousesFollowUp
(
$params
);
if
(
$id
>
0
)
{
...
...
application/api_broker/service/CallPhoneService.php
View file @
14c2778b
...
...
@@ -48,8 +48,13 @@ class CallPhoneService
return
$result
;
}
if
((
strlen
(
$phone_a
)
!=
11
)
||
(
strlen
(
$phone_b
)
!=
11
))
{
$result
[
'msg'
]
=
'号码格式错误,请重新填写!'
;
if
(
strlen
(
$phone_a
)
!=
11
)
{
$result
[
'msg'
]
=
'本机号码格式错误!'
;
return
$result
;
}
if
(
strlen
(
$phone_b
)
!=
11
)
{
$result
[
'msg'
]
=
'客户手机号码格式错误,请与客方沟通!'
;
return
$result
;
}
...
...
application/api_broker/service/PerformanceService.php
View file @
14c2778b
...
...
@@ -66,11 +66,11 @@ class PerformanceService
}
$where_
=
[];
$where_
[
'
a.create_time'
]
=
array
(
'between'
,
array
(
$yesterday
.
" 00:00:00"
,
$end_day
.
" 23:59:59"
)
);
$where_
[
'
total_time'
]
=
array
(
'between'
,
array
(
$yesterday
,
$end_day
)
);
$field
=
"
b.id as agent_id,b.store_id,b.district_id,sum(a.scale_fe
e) as performance_total"
;
$field
=
"
agent_id,store_id,district_id,sum(performanc
e) as performance_total"
;
$order
=
"performance_total desc"
;
$result
=
$this
->
bargain
Model
->
getTotalByAgentId
(
$field
,
$where_
,
$type
,
$order
);
$result
=
$this
->
total
Model
->
getTotalByAgentId
(
$field
,
$where_
,
$type
,
$order
);
//dump($result);
$arr
=
[];
$field
=
"a.name,a.img,b.store_name,c.district_name"
;
...
...
@@ -140,12 +140,6 @@ class PerformanceService
$result
=
[];
switch
(
$is_case
)
{
case
1
:
/* $now_date = date("Y-m-d", time());
if ($start_time == $now_date && $end_time == $now_date) {*/
$params
[
"agent_id"
]
=
$agent_id
;
$params
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$result
=
$this
->
nowTimeSum
(
$params
,
1
);
/*} else {
$field
=
"agent_id,sum(add_house_num) as add_house_num,sum(add_user_num) as add_user_num,
sum(performance) as performance,sum(official_receipts) as official_receipts,sum(look_at_num) as look_at_num,
sum(march_in_num) as march_in_num , sum(paylog) as paylog , sum(bargain_sum) as bargain_sum"
;
...
...
@@ -157,7 +151,6 @@ class PerformanceService
if
(
count
(
$list
)
>
0
)
{
$result
=
$list
[
0
];
}
}*/
break
;
case
2
:
//案场
$house_id_arr
=
[];
...
...
@@ -232,7 +225,7 @@ class PerformanceService
break
;
}
$result
=
$this
->
getOrderList
(
$params
,
$type
,
$is_case
);
$result
=
$this
->
getOrderList
(
$params
,
$type
,
$is_case
);
if
(
count
(
$result
)
>
0
)
{
return
$result
;
}
else
{
...
...
@@ -241,7 +234,7 @@ class PerformanceService
}
public
function
getOrderList
(
$params
,
$type
,
$is_case
)
public
function
getOrderList
(
$params
,
$type
,
$is_case
)
{
$result
=
[];
//1带看 2进场 3收款 4成交报告
...
...
@@ -261,7 +254,7 @@ class PerformanceService
break
;
case
4
:
$field
=
"DATE(a.create_time) as create_time ,b.house_id,b.house_title,c.user_phone,c.user_name,c.user_id,d.internal_title,d.internal_address"
;
$result
=
$this
->
bargainModel
->
getAddBargainOrderList
(
$field
,
$params
,
$is_case
);
$result
=
$this
->
bargainModel
->
getAddBargainOrderList
(
$field
,
$params
,
$is_case
);
break
;
default
:
...
...
@@ -335,21 +328,6 @@ class PerformanceService
$params
[
"district_id"
]
=
$result
[
0
][
"district_id"
];
}
//$list = [];
//$now_date = date("Y-m-d", time());
// if ($start_time == $now_date && $end_time == $now_date) {
$verify
=
new
VerifyService
();
$agent_ids
=
$verify
->
getAgentsByAgentId
(
$agent_id
);
$where_
[
"agent_id"
]
=
array
(
"in"
,
$agent_ids
);
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$list
=
$this
->
sumDistrictPerformance
(
$where_
);
// dump($list);exit;
/* } else {
$field
=
"sum(add_house_num) as add_house_num,sum(add_user_num) as add_user_num,
sum(performance) as performance,sum(official_receipts) as official_receipts,sum(look_at_num) as look_at_num,
sum(march_in_num) as march_in_num,sum(paylog) as paylog,sum(supervision_num) as supervision_num"
;
...
...
@@ -361,7 +339,6 @@ class PerformanceService
if
(
count
(
$list
)
>
0
)
{
$list
=
$list
[
0
];
}
}*/
if
(
count
(
$list
)
>
0
)
{
return
$list
;
...
...
@@ -390,54 +367,6 @@ class PerformanceService
$verify
=
new
VerifyService
();
$agent_ids
=
$verify
->
getAgentsByAgentId
(
$agent_id
);
$params
[
"agent_id"
]
=
array
(
"in"
,
$agent_ids
);
$list
=
[];
/* $now_date = date("Y-m-d", time());
if ($start_time == $now_date && $end_time == $now_date) {*/
$param
[
"id"
]
=
array
(
"in"
,
$agent_ids
);
// 1.获取所有经纪人
$field
=
"id as agent_id,store_id"
;
$group
=
""
;
if
(
$is_store
==
2
)
{
$group
=
"store_id"
;
}
$list
=
$this
->
agentModel
->
getAgentsList
(
$field
,
$param
,
$group
);
//dump($list);
foreach
(
$list
as
$key
=>
$item
)
{
$totalParams
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$totalParams
[
'agent_id'
]
=
$item
[
"agent_id"
];
if
(
$is_store
==
2
)
{
$agent_ids
=
$verify
->
getAgentsByAgentId
(
$item
[
"agent_id"
]);
$totalParams
[
'agent_id'
]
=
array
(
"in"
,
$agent_ids
);
}
//房源
$addHouseNum
=
$this
->
houseModel
->
getAddHouseNum
(
$totalParams
);
$list
[
$key
][
"add_house_num"
]
=
isset
(
$addHouseNum
[
0
][
"num"
])
?
$addHouseNum
[
0
][
"num"
]
:
0
;
//客源
$addUserNum
=
$this
->
userModel
->
getAddUserNum
(
$totalParams
);
$list
[
$key
][
"add_user_num"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
//进场
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$totalParams
);
$list
[
$key
][
"march_in_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
//业绩
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$totalParams
,
1
);
//1表示业绩 2表示实收
$list
[
$key
][
"performance"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
//实收
$receivedSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$totalParams
,
2
);
//1表示业绩 2表示实收
$list
[
$key
][
"official_receipts"
]
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
$sum
=
$list
[
$key
][
"add_house_num"
]
+
$list
[
$key
][
"add_user_num"
]
+
$list
[
$key
][
"march_in_num"
]
+
$list
[
$key
][
"performance"
]
+
$list
[
$key
][
"official_receipts"
];
if
(
$sum
<=
0
)
{
unset
(
$list
[
$key
]);
}
}
/* } else {
$field
=
"store_id,agent_id,sum(add_house_num) as add_house_num,sum(add_user_num) as add_user_num,sum(march_in_num) as march_in_num,
sum(performance) as performance,sum(official_receipts) as official_receipts"
;
...
...
@@ -446,7 +375,7 @@ class PerformanceService
$order
=
"total_time desc"
;
$list
=
$this
->
totalModel
->
getTotalByAgentId
(
$field
,
$params
,
$is_store
,
$order
);
}*/
if
(
count
(
$list
)
>
0
)
{
foreach
(
$list
as
$key
=>
$item
)
{
...
...
@@ -471,51 +400,6 @@ class PerformanceService
return
$list
;
}
private
function
sumDistrictPerformance
(
$params
)
{
$result
=
[];
//房源
$addHouseNum
=
$this
->
houseModel
->
getAddHouseNum
(
$params
);
$result
[
"add_house_num"
]
=
isset
(
$addHouseNum
[
0
][
"num"
])
?
$addHouseNum
[
0
][
"num"
]
:
0
;
//dump($addHouseNum);
//客源
$addUserNum
=
$this
->
userModel
->
getAddUserNum
(
$params
);
$result
[
"add_user_num"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
//dump($addUserNum);
//业绩
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$params
,
1
);
//1表示业绩 2表示实收
$result
[
"performance"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
//实收
$receivedSum
=
$this
->
bargainModel
->
getReceived
(
$params
);
$result
[
"official_receipts"
]
=
isset
(
$receivedSum
[
0
][
"num"
])
?
$receivedSum
[
0
][
"num"
]
:
0
;
//dump($receivedSum);
//约带看
$reportNum
=
$this
->
reportModel
->
getAddReportNum
(
$params
);
$result
[
"look_at_num"
]
=
isset
(
$reportNum
[
0
][
"num"
])
?
$reportNum
[
0
][
"num"
]
:
0
;
//dump($reportNum);
//进场
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$params
);
$result
[
"march_in_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
//dump($addMarchInNum);
//收款
$payLogNum
=
$this
->
payLogModel
->
getAddPayLogNum
(
$params
);
$result
[
"paylog"
]
=
isset
(
$payLogNum
[
0
][
"num"
])
?
$payLogNum
[
0
][
"num"
]
:
0
;
//dump($payLogNum);
// 监督
$result
[
"supervision_num"
]
=
$this
->
superviseModel
->
getSuperviseListCount
(
$params
);
return
$result
;
}
/**
* 组装请求参数
...
...
application/app_broker/view/index/shop_detail_pc.html
View file @
14c2778b
...
...
@@ -19,8 +19,8 @@
<tr>
<td>
商铺编号:{{d.id}}
</td>
<td>
商铺类型:{{(d.shop_type==1)?'街铺':'商场'}}
</td>
<td>
是否对客户展示:{{
d.is_show
?'否':'是'}}
</td>
<td>
是否独家:{{
d.is_exclusive_type
?'是':'否'}}
</td>
<td>
是否对客户展示:{{
(d.is_show==1)
?'否':'是'}}
</td>
<td>
是否独家:{{
(d.is_exclusive_type==1)
?'是':'否'}}
</td>
</tr>
<tr>
<td>
{{dealPrice}}
</td>
...
...
@@ -74,16 +74,16 @@
<tr
class=
"tr-seat"
>
<td
colspan=
"4"
></td>
</tr>
<tr
v-if=
"!
d.is_show
"
>
<tr
v-if=
"!
(d.is_show==1)
"
>
<td
colspan=
"2"
>
对外商铺名称:{{d.external_title}}
</td>
<td
colspan=
"2"
>
对外商铺地址:{{d.province}}{{d.city+d.disc+d.external_address}}
</td>
</tr>
<tr
v-if=
"!
d.is_show
"
>
<tr
v-if=
"!
(d.is_show==1)
"
>
<td
colspan=
"2"
>
对外项目优势:{{d.external_item_advantage}}
</td>
<td
v-if=
"d.shop_type"
colspan=
"2"
>
对外转让费:{{(d.external_slotting_fee == '-1')?'面议':(d.external_slotting_fee+'元')}}
</td>
<td
v-else
colspan=
"2"
></td>
</tr>
<tr
v-if=
"!
d.is_show
&& d.cover_plan"
>
<tr
v-if=
"!
(d.is_show==1)
&& d.cover_plan"
>
<td
colspan=
"4"
class=
"oh"
>
<div
class=
"fl"
>
对外封面图:
</div>
<div
class=
"fl"
>
...
...
@@ -132,8 +132,8 @@
<tr>
<td>
上传时间:{{d.create_time}}
</td>
<td>
最后编辑时间:{{d.update_time}}
</td>
<td
v-if=
"
d.is_exclusive_type
"
>
独家有效期:{{d.agent_start_time+'至'+d.agent_end_time}}
</td>
<td
v-if=
"
d.is_exclusive_type
"
>
<!--独家方:{{d.exclusive_name}}-->
</td>
<td
v-if=
"
(d.is_exclusive_type==1)
"
>
独家有效期:{{d.agent_start_time+'至'+d.agent_end_time}}
</td>
<td
v-if=
"
(d.is_exclusive_type==1)
"
>
<!--独家方:{{d.exclusive_name}}-->
</td>
</tr>
</tbody>
</table>
...
...
application/index/controller/Finance.php
View file @
14c2778b
...
...
@@ -21,6 +21,7 @@ use app\model\OFinancialAudit;
use
app\model\OPartialCommission
;
use
app\model\OPayLogModel
;
use
app\model\ORefundModel
;
use
app\task\controller\ResultsSummaryNewTask
;
class
Finance
extends
Basic
{
...
...
@@ -1434,12 +1435,29 @@ class Finance extends Basic
return
$this
->
response
(
101
,
'分佣比例为空'
);
}
//检查成交报告是否存在
$data
=
$m_bargain
->
getBargainPartialDetail
(
'a.id,a.agent_id,a.create_time'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]]);
if
(
empty
(
$data
[
'id'
]))
{
return
$this
->
response
(
101
,
'没有成交报告信息'
);
}
$update
[
'agent_id'
]
=
$this
->
params
[
'agent_id'
];
$update
[
'scale'
]
=
$this
->
params
[
'scale'
];
$update
[
'role'
]
=
$this
->
params
[
'role'
];
$update
[
'scale_fee'
]
=
$this
->
params
[
'scale_fee'
];
$data
=
$m_bargain
->
updateBargainById
(
$this
->
params
[
'bargain_id'
],
$update
);
$data
=
$m_bargain
->
updateBargainById
(
$this
->
params
[
'bargain_id'
],
$update
);
//更改分佣方
//获取被修改人信息
$m_agent
=
new
AAgents
();
$agent_data
=
$m_agent
->
verifyUser
(
'id,store_id,district_id'
,
''
,[
'id'
=>
$this
->
params
[
'agent_id'
]]);
//更新业绩统计
$sum
=
new
ResultsSummaryNewTask
();
$date
=
date
(
'Y-m-d'
,
strtotime
(
$data
[
'create_time'
]));
$sum
->
updateTotalByAgentId
(
$agent_data
[
'id'
],
$agent_data
[
'store_id'
],
$agent_data
[
'district_id'
],
$date
);
//被修改的人
$sum
->
updateTotalByAgentId
(
$data
[
'agent_id'
],
$data
[
'store_id'
],
$data
[
'district_id'
],
$date
);
//修改为最新的分佣方
/*记录日志 start*/
$bargain_data
=
$m_bargain
->
selectBargainByOrderNo
(
'agent_id,father_id'
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]]);
...
...
application/index/controller/HouseFollowUp.php
View file @
14c2778b
...
...
@@ -9,16 +9,41 @@
namespace
app\index\controller
;
use
app\index\extend\Basic
;
class
HouseFollowUp
extends
Basic
{
//在controller里新增的php文件名
public
function
followUpList
(){
//followUpList 方法
use
app\model\GHouses
;
use
app\model\GHousesFollowUp
;
class
HouseFollowUp
extends
Basic
{
public
function
followUpList
()
{
if
(
!
$this
->
request
->
isAjax
())
{
return
view
(
'houses/HouseFollowUp'
);
//找到view下的 houses 文件夹下的 HouseFollowUp的html 文件
}
}
/**
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
transformFollowUp
()
{
$time
=
time
();
$m_house
=
new
GHouses
();
$m_follow
=
new
GHousesFollowUp
();
$total
=
$m_follow
->
getTotal
();
$page
=
ceil
(
$total
/
5000
);
for
(
$i
=
1
;
$i
<=
$page
;
$i
++
)
{
$data
=
$m_house
->
getList
(
$i
,
5000
,
'id asc'
,
'id,province,city,disc'
);
foreach
(
$data
as
$k
=>
$v
)
{
$insert
[
'province'
]
=
$v
[
'province'
];
$insert
[
'city'
]
=
$v
[
'city'
];
$insert
[
'disc'
]
=
$v
[
'disc'
];
$m_follow
->
where
(
'house_id'
,
$v
[
'id'
])
->
update
(
$insert
);
}
}
echo
time
()
-
$time
.
'秒'
;
}
}
\ No newline at end of file
application/index/controller/Houses.php
View file @
14c2778b
This diff is collapsed.
Click to expand it.
application/index/controller/Remark.php
View file @
14c2778b
...
...
@@ -35,73 +35,88 @@ class Remark extends Basic
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$where_user
=
$agent_where
=
[];
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$u_phone_follow
=
new
UPhoneFollowPp
();
$last_month
=
date
(
"Y-m-d"
,
strtotime
(
"-1 month"
));
if
(
!
empty
(
$this
->
params
[
'start_date'
])
&&
empty
(
$this
->
params
[
'end_date'
]))
{
$where
[
'a.create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_date'
]
.
' 00:00:00'
];
if
(
strtotime
(
$last_month
)
>
strtotime
(
$this
->
params
[
'start_date'
]))
{
$where
[
'create_time'
]
=
[
'> time'
,
$last_month
.
' 00:00:00'
];
}
else
{
$where
[
'create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_date'
]
.
' 00:00:00'
];
}
}
else
{
$where
[
'create_time'
]
=
[
'> time'
,
$last_month
.
' 00:00:00'
];
}
if
(
!
empty
(
$this
->
params
[
'end_date'
])
&&
empty
(
$this
->
params
[
'start_date'
]))
{
$where
[
'
a.
create_time'
]
=
[
'< time'
,
$this
->
params
[
'end_date'
]
.
' 23:59:59'
];;
$where
[
'create_time'
]
=
[
'< time'
,
$this
->
params
[
'end_date'
]
.
' 23:59:59'
];;
}
if
(
!
empty
(
$this
->
params
[
'end_date'
])
&&
!
empty
(
$this
->
params
[
'start_date'
]))
{
$where
[
'a.create_time'
]
=
[
'between'
,[
$this
->
params
[
'start_date'
]
.
' 00:00:00'
,
$this
->
params
[
'end_date'
]
.
' 23:59:59'
]];
if
(
strtotime
(
$last_month
)
>
strtotime
(
$this
->
params
[
'start_date'
]))
{
$start_date
=
$last_month
;
}
else
{
$start_date
=
$this
->
params
[
'start_date'
];
}
if
(
!
empty
(
$this
->
params
[
'customer'
]))
{
$where
[
'c.user_name'
]
=
$this
->
params
[
'customer'
];
}
if
(
!
empty
(
$this
->
params
[
'phone'
]))
{
$where
[
'c.user_phone'
]
=
$this
->
params
[
'phone'
];
$where
[
'create_time'
]
=
[
'between'
,[
$start_date
.
' 00:00:00'
,
$this
->
params
[
'end_date'
]
.
' 23:59:59'
]];
}
if
(
!
empty
(
$this
->
params
[
'content'
]))
{
$where
[
'
a.content'
]
=
[
'like
'
,
"%
{
$this
->
params
[
'content'
]
}
%"
];
$where
[
'
content'
]
=
[
'LIKE
'
,
"%
{
$this
->
params
[
'content'
]
}
%"
];
}
//跟进人名字
if
(
!
empty
(
$this
->
params
[
'remark_name'
]))
{
$
where
[
'b.name'
]
=
[
'like'
,
"%
{
$this
->
params
[
'remark_name'
]
}
%"
];
$
agent_where
[
'name'
]
=
$this
->
params
[
'remark_name'
];
}
//跟进人手机号
if
(
!
empty
(
$this
->
params
[
'remark_phone'
]))
{
$
where
[
'b.phone'
]
=
[
'like'
,
"%
{
$this
->
params
[
'remark_phone'
]
}
%"
];
$
agent_where
[
'phone'
]
=
$this
->
params
[
'remark_phone'
];
}
//跟进人门店
if
(
!
empty
(
$this
->
params
[
'remark_store_id'
]))
{
$
where
[
'b.
store_id'
]
=
$this
->
params
[
'remark_store_id'
];
$
agent_where
[
'
store_id'
]
=
$this
->
params
[
'remark_store_id'
];
}
//跟进人部门
if
(
!
empty
(
$this
->
params
[
'remark_district_id'
]))
{
$
where
[
'b.
district_id'
]
=
$this
->
params
[
'remark_district_id'
];
$
agent_where
[
'
district_id'
]
=
$this
->
params
[
'remark_district_id'
];
}
if
(
!
empty
(
$this
->
params
[
'province'
]))
{
$where
[
'
c.
province'
]
=
$this
->
params
[
'province'
];
$where
[
'province'
]
=
$this
->
params
[
'province'
];
}
if
(
!
empty
(
$this
->
params
[
'city'
]))
{
$where
[
'c
.c
ity'
]
=
$this
->
params
[
'city'
];
$where
[
'city'
]
=
$this
->
params
[
'city'
];
}
if
(
!
empty
(
$this
->
params
[
'disc'
]))
{
$where
[
'
c.
disc'
]
=
$this
->
params
[
'disc'
];
$where
[
'disc'
]
=
$this
->
params
[
'disc'
];
}
$field
=
'c.id,a.create_time,a.content,b.name as admin,d.name as label_name,c.user_name,c.user_phone,a.user_status,c.vip,c.agent_id'
;
$data
[
'data'
][
'list'
]
=
$u_phone_follow
->
getFollowList
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$where
);
if
(
!
empty
(
$this
->
params
[
'id'
]))
{
$where
[
'user_id'
]
=
$this
->
params
[
'id'
];
}
if
(
!
empty
(
$where_user
))
{
$m_agent
=
new
AAgents
();
$agent_id_arr
=
$m_agent
->
getAgentById
(
'id'
,
$agent_where
);
if
(
!
empty
(
$agent_id_arr
))
{
$where
[
'agent_id'
]
=
[
'in'
,
$agent_id_arr
];
}
}
$field
=
'user_id,create_time,content,user_status,labels_id,agent_id as f_agent_id'
;
$data
[
'data'
][
'list'
]
=
$u_phone_follow
->
getFollowList
(
$pageNo
,
$pageSize
,
$order_
=
'id desc'
,
$field
,
$where
);
foreach
(
$data
[
'data'
][
'list'
]
as
$k
=>
$v
)
{
$data
[
'data'
][
'list'
][
$k
][
'user_phone'
]
=
hide_customer_phone
(
$data
[
'data'
][
'list'
][
$k
][
'user_phone'
]
);
$data
[
'data'
][
'list'
][
$k
][
'user_phone'
]
=
substr_replace
(
$data
[
'data'
][
'list'
][
$k
][
'user_phone'
],
'****'
,
3
,
4
);
}
$data
[
'data'
][
'total'
]
=
$u_phone_follow
->
getFollowTotal
(
$where
);
...
...
application/index/service/PerformanceService.php
View file @
14c2778b
This diff is collapsed.
Click to expand it.
application/index/view/member/users_list.html
View file @
14c2778b
...
...
@@ -338,10 +338,10 @@
<tr>
<td
colspan=
"11"
>
<form
action=
""
method=
"get"
id=
"form_search"
>
<
!--<
span class="fore-span ld-Marheight">创建时间:</span>
<span
class=
"fore-span ld-Marheight"
>
创建时间:
</span>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"start_date"
name=
"start_date"
type=
"date"
>
<span
class=
"fore-span ld-Marheight"
>
-
</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date">
-->
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"end_date"
name=
"end_date"
type=
"date"
>
<span
class=
"fore-span ld-Marheight"
>
注册时间:
</span>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"registration_start"
name=
"registration_start"
type=
"date"
>
...
...
@@ -446,6 +446,7 @@
<input
class=
"form-control btn2 margin-top-ld input"
data-rule-phoneus=
"false"
data-rule-required=
"false"
name=
"invite_agent_phone"
placeholder=
"邀请人(经纪人)手机号"
type=
"text"
value=
""
>
<!--<div class="clear"></div>-->
<!--<span class='left bottom'>(注:客方所属部门,客方所属门店与邀请人所属部门,邀请人所属门店不作为并列筛选项)</span>-->
<div
class=
"clear"
></div>
<span
class=
"fore-span ld-Marheight"
>
首次登录时间:
</span>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"first_login_start"
type=
"date"
>
<span
class=
"fore-span ld-Marheight"
>
-
</span>
...
...
@@ -459,7 +460,7 @@
<select
class=
"form-control btn2 ld-Marheight"
id=
"user_area_choose"
>
<option
value=
""
selected=
"selected"
>
区域筛选
</option>
</select>
<div
class=
"clear"
></div>
<span
class=
"btn btn-info btn3 margin-top-ld"
id=
"search"
>
搜索
</span>
<span
class=
"btn btn-info btn3 margin-top-ld"
id=
"reset"
>
重置
</span>
<!--<a class="btn btn-info btn3 margin-top-ld user-favorites"> 收藏夹 </a>-->
...
...
application/index/view/realtime/realtimePerformance.html
View file @
14c2778b
...
...
@@ -18,7 +18,21 @@
#rank_start_day
,
#rank_end_day
,
#performance_ranking
{
font-size
:
16px
;
}
/*倒序 正序 样式*/
.positive-sequence-yeji
,
.reverse-order-yeji
{
position
:
relative
;
margin-left
:
5px
;
cursor
:
pointer
;
font-size
:
20px
;
}
.positive-sequence-yeji
{
top
:
11px
;
}
.reverse-order-yeji
{
top
:
-5px
;
left
:
-25px
;
}
</style>
<div
id=
"page-content-wrapper"
>
...
...
application/index/view/remark/remark_follow_index.html
View file @
14c2778b
...
...
@@ -310,8 +310,8 @@
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"start_date"
name=
"start_date"
type=
"date"
>
<span
class=
"fore-span ld-Marheight"
>
-
</span>
<input
class=
"form-control btn4 ld-Marheight"
value=
""
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"end_date"
name=
"end_date"
type=
"date"
>
<input
class=
"form-control btn2 ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"customer_name
"
placeholder=
"客户姓名
"
type=
"text"
value=
""
>
<
input
class=
"form-control btn2 ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"customer_phone"
placeholder=
"客户手机号"
type=
"tel"
value=
""
>
<input
class=
"form-control btn2 ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"customer_name
_id"
placeholder=
"客户编号
"
type=
"text"
value=
""
>
<
!--<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="customer_phone" placeholder="客户手机号" type="tel" value="">--
>
<input
class=
"form-control btn2 ld-Marheight"
data-rule-phoneus=
"false"
data-rule-required=
"false"
id=
"follow_content"
placeholder=
"跟进内容"
type=
"text"
value=
""
>
...
...
application/model/AAgents.php
View file @
14c2778b
...
...
@@ -273,7 +273,7 @@ class AAgents extends BaseModel
$where_
[
"level"
]
=
$params
[
"level"
];
}
if
(
isset
(
$params
[
'in_id'
]))
{
$where_
[
'id'
]
=
[
'in'
,
$params
[
'in_id'
]
];
$where_
[
'id'
]
=
[
'in'
,
$params
[
'in_id'
]
];
}
$result
=
$this
->
field
(
$field
)
->
where
(
$where_
)
...
...
@@ -352,8 +352,10 @@ class AAgents extends BaseModel
*/
public
function
getAgentsListByTask
(
$pageNo
=
1
,
$pageSize
=
15
,
$field
=
"id"
)
{
$params
[
"district_id"
]
=
array
(
'not in'
,
array
(
'13'
,
'14'
,
'15'
)
);
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
...
...
@@ -387,7 +389,9 @@ class AAgents extends BaseModel
*/
public
function
getAgentsCountByTask
()
{
$params
[
"district_id"
]
=
array
(
'not in'
,
array
(
'13'
,
'14'
,
'15'
)
);
return
Db
::
table
(
$this
->
table
)
->
where
(
$params
)
->
count
();
}
...
...
@@ -489,7 +493,8 @@ class AAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getStoreOrDistrict
(
$params
){
public
function
getStoreOrDistrict
(
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
"id,name,img"
)
->
where
(
$params
)
...
...
@@ -798,7 +803,8 @@ class AAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
searchAgentShop
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
public
function
searchAgentShop
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'a_store b'
,
'a.store_id = b.id'
,
'left'
)
...
...
@@ -818,10 +824,11 @@ class AAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentsList
(
$field
,
$params
,
$group
){
public
function
getAgentsList
(
$field
,
$params
,
$group
)
{
$where_
=
[];
if
(
$group
==
"store_id"
)
{
$where_
[
'level'
]
=
array
(
"in"
,[
20
,
40
]
);
if
(
$group
==
"store_id"
)
{
$where_
[
'level'
]
=
array
(
"in"
,
[
20
,
40
]
);
}
$result
=
Db
::
name
(
$this
->
table
)
->
field
(
$field
)
...
...
@@ -844,11 +851,12 @@ class AAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getUserAgent
(
$field
=
''
,
$params
=
[],
$house_id
=
0
)
{
public
function
getUserAgent
(
$field
=
''
,
$params
=
[],
$house_id
=
0
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_evaluate b'
,
'a.id = b.agents_id'
,
'left'
)
->
join
(
'g_houses_to_agents c'
,
'a.id=c.agents_id'
,
'left'
)
->
join
(
'u_users d'
,
'a.id = d.agent_id'
,
'left'
)
->
join
(
'u_users d'
,
'a.id = d.agent_id'
,
'left'
)
->
where
(
'c.houses_id'
,
$house_id
)
->
where
(
'c.type'
,
1
)
->
where
(
$params
)
...
...
@@ -866,10 +874,11 @@ class AAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentClient
(
string
$field
=
'*'
,
array
$params
=
[])
{
public
function
getAgentClient
(
string
$field
=
'*'
,
array
$params
=
[])
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_evaluate b'
,
'a.id = b.agents_id'
,
'left'
)
->
join
(
'u_users c'
,
'a.id = c.agent_id'
,
'left'
)
->
join
(
'u_users c'
,
'a.id = c.agent_id'
,
'left'
)
->
where
(
$params
)
->
find
();
}
...
...
@@ -912,7 +921,7 @@ class AAgents extends BaseModel
->
where
(
'agents_id'
,
$id
)
->
where
(
'is_show'
,
0
)
->
find
();
$m_store
=
new
AStore
();
$result
[
'sub_shopname'
]
=
$m_store
->
getStoreKeyById
(
'store_name'
,
[
'id'
=>
$result
[
'store_id'
]
]);
$result
[
'sub_shopname'
]
=
$m_store
->
getStoreKeyById
(
'store_name'
,
[
'id'
=>
$result
[
'store_id'
]
]);
if
(
$evaluate_grade
[
'evaluate_grade'
])
{
$grade
=
floor
((
$evaluate_grade
[
'evaluate_grade'
]
/
2
)
/
$evaluate_grade
[
'evaluate_num'
]);
}
else
{
...
...
@@ -924,7 +933,7 @@ class AAgents extends BaseModel
$result
[
'watch_shop'
]
=
Db
::
table
(
'u_appoint_watch_shop'
)
->
where
(
'agents_id'
,
$id
)
->
count
();
//看铺
$result
[
'head_portrait'
]
=
AGENTHEADERIMGURL
.
$result
[
'img'
];
$result
[
'head_portrait'
]
=
AGENTHEADERIMGURL
.
$result
[
'img'
];
$bargain
=
new
OBargainModel
();
$result
[
'JournalAccounts'
]
=
$bargain
->
ifBargainNumByOrderId
([
'agent_id'
=>
$id
]);
//成交记录
...
...
@@ -956,7 +965,8 @@ class AAgents extends BaseModel
* @param $data
* @return AAgents|bool
*/
public
function
updateData
(
$id
,
$data
)
{
public
function
updateData
(
$id
,
$data
)
{
if
(
$id
)
{
$result
=
$this
->
where
(
'id'
,
$id
)
->
update
(
$data
);
}
else
{
...
...
@@ -985,4 +995,36 @@ class AAgents extends BaseModel
//dump($this->getLastSql());
return
$result
;
}
public
function
getAgentsIdsArray
(
$field
,
$params
)
{
$params
[
"status"
]
=
0
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
select
();
if
(
$result
){
$agentIds
=
""
;
foreach
(
$result
as
$key1
=>
$value1
)
{
$agentIds
.=
$value1
[
"id"
]
.
','
;
}
$agentIds
=
rtrim
(
$agentIds
,
","
);
//经纪人ID集合
}
return
$agentIds
;
}
public
function
getAgentsInfo
(
$field
,
$params
)
{
$params
[
"a.status"
]
=
0
;
$result
=
Db
::
table
(
$this
->
table
)
->
alias
(
'a'
)
->
join
(
'a_store b'
,
'b.id=a.store_id'
,
'left'
)
->
field
(
$field
)
->
where
(
$params
)
->
select
();
return
$result
;
}
}
\ No newline at end of file
application/model/ASuperviseModel.php
View file @
14c2778b
...
...
@@ -92,5 +92,25 @@ class ASuperviseModel extends Model
->
select
();
}
/**
* 统计监督执行数量分时间
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddPayLogNumGroupTimeNew
(
$params
){
$field
=
"count(1) as num"
;
$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_
)
->
select
();
}
}
\ No newline at end of file
application/model/GHouses.php
View file @
14c2778b
...
...
@@ -272,19 +272,28 @@ class GHouses extends BaseModel
*/
public
function
getHouseListDish
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
,
$agents_id
=
''
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'g_houses_to_agents b'
,
'a.id=b.houses_id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agents_id=c.id'
,
'left'
)
->
join
(
'g_houses_ext d'
,
'a.id=d.house_id'
,
'left'
)
// $data = $this->field($field)->alias('a')
// ->join('g_houses_to_agents b', 'a.id=b.houses_id', 'left')
// ->join('a_agents c', 'b.agents_id=c.id', 'left')
// ->join('g_houses_ext d', 'a.id=d.house_id', 'left')
// ->where($params)
// ->order($order_)
// ->limit($pageSize)
// ->page($pageNo)
// ->group('a.id')
// ->select();
$data
=
$this
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
group
(
'a.id'
)
->
select
();
$house_id
=
array
();
$house_id
=
[];
$house_follow_up
=
new
GHousesFollowUp
();
foreach
(
$data
as
$k
=>
$v
)
{
$house_id
[
$k
]
=
$v
[
'id'
];
$v
->
create_time
=
date
(
'Y-m-d'
,
strtotime
(
$v
->
create_time
));
...
...
@@ -340,14 +349,15 @@ class GHouses extends BaseModel
*/
public
function
getHouseListDishTotal
(
$params
=
''
)
{
$data
=
$this
->
alias
(
'a'
)
->
join
(
'g_houses_to_agents b'
,
'a.id=b.houses_id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agents_id=c.id'
,
'left'
)
->
join
(
'g_houses_ext d'
,
'a.id=d.house_id'
,
'left'
)
->
where
(
$params
)
->
group
(
'a.id'
)
->
count
();
return
$data
;
// $data = $this->alias('a')
// ->join('g_houses_to_agents b', 'a.id=b.houses_id', 'left')
// ->join('a_agents c', 'b.agents_id=c.id', 'left')
// ->join('g_houses_ext d', 'a.id=d.house_id', 'left')
// ->where($params)
// ->group('a.id')
// ->count();
// return $data;
return
$this
->
where
(
$params
)
->
count
();
}
/**
...
...
@@ -728,6 +738,27 @@ class GHouses extends BaseModel
->
select
();
}
/**
* 获取添加的楼盘的每天数量
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddHouseNumGroupTimeNew
(
$params
)
{
$field
=
"count(1) as num"
;
$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_
)
->
select
();
}
/**
* 获取新增楼盘数量
* @param $params
...
...
@@ -743,6 +774,9 @@ class GHouses extends BaseModel
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$params
[
'landlord_phone'
]))
{
$where_
[
"landlord_phone"
]
=
$params
[
'landlord_phone'
];
}
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$where_
)
...
...
@@ -751,11 +785,17 @@ class GHouses extends BaseModel
return
$result
;
}
/**
* 获取新增楼盘数据
*
* @param $params
* @param $field
* @param $page_no
* @param $page_size
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAddHouseList
(
$params
,
$field
,
$page_no
,
$page_size
)
{
...
...
@@ -1112,4 +1152,34 @@ class GHouses extends BaseModel
return
$result
;
}
public
function
getHouseIdsArray
(
$field
,
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
select
();
if
(
$result
){
$houseids
=
""
;
foreach
(
$result
as
$key1
=>
$value1
)
{
$houseids
.=
$value1
[
"id"
]
.
','
;
}
$houseids
=
rtrim
(
$houseids
,
","
);
//经纪人ID集合
}
return
$houseids
;
}
public
function
getHouseInfo
(
$field
,
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
select
();
return
$result
;
}
}
application/model/GHousesFollowUp.php
View file @
14c2778b
...
...
@@ -3,7 +3,6 @@
namespace
app\model
;
use
think\Db
;
use
think\Model
;
/**
* Created by PhpStorm.
...
...
@@ -12,7 +11,7 @@ use think\Model;
* Time : 下午4:31
* Intro:
*/
class
GHousesFollowUp
extends
Model
class
GHousesFollowUp
extends
Base
Model
{
protected
$table
=
"g_houses_follow_up"
;
protected
$db_
;
...
...
@@ -51,6 +50,19 @@ class GHousesFollowUp extends Model
$where_
[
'landlord_name'
]
=
$params
[
'landlord_name'
];
}
if
(
isset
(
$params
[
"province"
]))
{
$where_
[
"province"
]
=
$params
[
"province"
];
}
if
(
isset
(
$params
[
"city"
]))
{
$where_
[
"city"
]
=
$params
[
"city"
];
}
if
(
isset
(
$params
[
"disc"
]))
{
$where_
[
"disc"
]
=
$params
[
"disc"
];
}
$where_
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$where_
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
Db
::
startTrans
();
...
...
@@ -68,6 +80,9 @@ class GHousesFollowUp extends Model
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getShopFollowUpList
(
$field
,
$params
)
{
...
...
@@ -84,7 +99,6 @@ class GHousesFollowUp extends Model
}
/**
* 首页商铺跟进搜索
* @param int $p
* @param int $pageSize
* @param string $order_
...
...
@@ -93,6 +107,9 @@ class GHousesFollowUp extends Model
* @param $where
* @param $group
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getSearch
(
$p
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$join
,
$where
,
$group
)
{
...
...
@@ -106,7 +123,7 @@ class GHousesFollowUp extends Model
->
limit
(
$pageSize
)
->
page
(
$p
)
->
select
();
//
echo $this->getLastSql();
//
echo $this->getLastSql();
return
$data
;
}
...
...
@@ -126,6 +143,13 @@ class GHousesFollowUp extends Model
return
$data
;
}
/**
* @param array $params
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getFollowUpByHouseId
(
array
$params
)
:
bool
{
$where_
=
[];
...
...
application/model/GHousesToAgents.php
View file @
14c2778b
...
...
@@ -200,6 +200,20 @@ class GHousesToAgents extends BaseModel
return
$result
;
}
/**
* @param $field
* @param $params
* @return array
*/
public
function
getAgentsHouseField
(
$field
,
$params
)
{
return
$this
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_agents b"
,
"a.agents_id = b.id"
,
"left"
)
->
where
(
$params
)
->
column
(
$field
);
}
/**
* 楼盘对应的经纪人信息
*
...
...
@@ -250,14 +264,15 @@ class GHousesToAgents extends BaseModel
*
* @param $house_id
* @param int $type
* @return array|\PDOStatement|string|\think\Model
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentList
(
$house_id
,
$type
=
1
)
public
function
getAgentList
(
$house_id
,
$type
=
1
,
$field
=
'b.id,device_id,b.name,b.phone'
)
{
return
$this
->
field
(
'b.id,device_id,b.name,b.phone'
)
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.agents_id = b.id'
,
'left'
)
->
where
(
'houses_id'
,
$house_id
)
...
...
application/model/GOperatingRecords.php
View file @
14c2778b
...
...
@@ -51,14 +51,20 @@ class GOperatingRecords extends BaseModel
return
$result
;
}
/**
* @param $user_id
* @return array|false|\PDOStatement|string|\think\Collection
*/
public
function
user_history
(
$user_id
)
{
return
db
(
'g_operating_records'
)
try
{
$data
=
$this
->
field
(
'name,remark,create_time'
)
->
where
(
'user_id'
,
$user_id
)
->
field
(
'name,remark,create_time'
)
->
order
(
'create_time'
,
'desc'
)
->
select
();
}
catch
(
\Exception
$e
)
{
$data
=
[];
}
return
$data
;
}
}
\ No newline at end of file
application/model/OBargainModel.php
View file @
14c2778b
...
...
@@ -626,6 +626,34 @@ class OBargainModel extends Model
->
select
();
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getReceivedGroupTimeNew
(
$params
)
{
$where_
=
[];
$field
=
"sum(b.practical_fee) as num"
;
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"b.create_time"
]
=
$params
[
"create_time"
];
}
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_partial_commission b"
,
"a.id=b.bargain_id"
,
"right"
)
->
where
(
$where_
)
->
select
();
}
/**
* @param $params
* @param $type
...
...
@@ -655,6 +683,7 @@ class OBargainModel extends Model
if
(
isset
(
$params
[
"agent_id"
])
&&
$type
==
3
)
{
unset
(
$where_
[
"agent_id"
]);
$where_
[
"submit_agent_id"
]
=
$params
[
"agent_id"
];
$where_
[
"father_id"
]
=
0
;
}
if
(
isset
(
$params
[
"create_time"
]))
{
...
...
@@ -668,6 +697,44 @@ class OBargainModel extends Model
->
select
();
}
/**
* @param $params
* @param $type
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAddBargainNumGroupTimeNew
(
$params
,
$type
)
{
$field
=
""
;
$where_
=
[];
if
(
$type
==
1
)
{
$field
=
"sum(scale_fee) as num"
;
}
elseif
(
$type
==
2
)
{
$field
=
"sum(practical_fee) as num"
;
}
elseif
(
$type
==
3
)
{
$field
=
"count(1) as num"
;
$where_
[
"trade_type"
]
=
10
;
//产品要求统计数量必须是出租类型的180620
$where_
[
"role"
]
=
3
;
//必须是反签方
}
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
$data
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$where_
)
->
select
();
//echo $this->getLastSql();
return
$data
;
}
public
function
getAddBargainNum
(
$params
,
$type
)
{
$where_
=
[];
...
...
@@ -794,8 +861,8 @@ class OBargainModel extends Model
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"c.report_agent_id"
]
=
$params
[
"agent_id"
];
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
$where_
[
"a.role"
]
=
3
;
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
...
...
@@ -1180,12 +1247,14 @@ class OBargainModel extends Model
->
find
();
$m_agent
=
new
AAgents
();
$filed_agent
=
'a.id,a.name,a.phone,b.store_name,c.district_name'
;
$filed_agent
=
'a.id,a.name,a.phone,b.store_name,c.district_name
,a.store_id,a.district_id
'
;
$agent_info
=
$m_agent
->
getAgentsInfoByAgentId
(
$filed_agent
,
[
'agent_id'
=>
$result
[
'agent_id'
]
]);
$result
[
'district_name'
]
=
$agent_info
[
0
][
'district_name'
];
$result
[
'store_name'
]
=
$agent_info
[
0
][
'store_name'
];
$result
[
'name'
]
=
$agent_info
[
0
][
'name'
];
$result
[
'phone'
]
=
$agent_info
[
0
][
'phone'
];
$result
[
'store_id'
]
=
$agent_info
[
0
][
'store_id'
];
$result
[
'district_id'
]
=
$agent_info
[
0
][
'district_id'
];
}
catch
(
\Exception
$ex
)
{
$result
=
false
;
...
...
@@ -1233,8 +1302,8 @@ class OBargainModel extends Model
}
public
function
performancelInfo
(
$where
,
$filed
,
$pageSize
,
$pageNo
)
{
public
function
performancelInfo
(
$where
,
$filed
,
$pageSize
,
$pageNo
)
{
$result
=
$this
->
db_
->
field
(
$filed
)
->
alias
(
"Obargain"
)
...
...
@@ -1253,7 +1322,8 @@ class OBargainModel extends Model
return
$result
;
}
public
function
performancelInfoTotal
(
$where
,
$filed
){
public
function
performancelInfoTotal
(
$where
,
$filed
)
{
$result
=
$this
->
db_
->
field
(
$filed
)
->
alias
(
"Obargain"
)
...
...
application/model/OMarchInModel.php
View file @
14c2778b
...
...
@@ -115,6 +115,27 @@ class OMarchInModel extends Model
->
select
();
}
/**
* 查询经纪人进场数据 todo 产品定义同一天带看同一个客户去多个铺子算一个带看,下个方法同样
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddMarchInNumGroupTimeNew
(
$params
)
{
$field
=
"count(DISTINCT report_id) as num"
;
$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_
)
->
select
();
}
/**
* 统计房源进场数据 过滤重负
* @param $params
...
...
application/model/OPayLogModel.php
View file @
14c2778b
...
...
@@ -160,6 +160,27 @@ class OPayLogModel extends Model
->
group
(
"day"
)
->
select
();
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAddPayLogNumGroupTimeNew
(
$params
){
$field
=
"count(1) as num"
;
$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_
)
->
select
();
}
/**
* @param $params
...
...
application/model/OReportModel.php
View file @
14c2778b
...
...
@@ -546,6 +546,30 @@ class OReportModel extends Model
->
select
();
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAddReportNumGroupTimeNew
(
$params
)
{
$field
=
"count(1) as num"
;
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"report_agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"create_time"
]
=
$params
[
"create_time"
];
}
$where_
[
"status"
]
=
0
;
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$where_
)
->
select
();
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
...
...
application/model/TAgentTotalModel.php
View file @
14c2778b
...
...
@@ -40,6 +40,24 @@ class TAgentTotalModel extends Model
return
0
;
}
}
/**
* @param $params
* @return int
*/
public
function
saveTotal
(
$params
)
{
Db
::
startTrans
();
try
{
$this
->
saveAll
(
$params
);
Db
::
commit
();
return
1
;
}
catch
(
\Exception
$e
)
{
print_r
(
$e
);
Db
::
rollback
();
return
0
;
}
}
/**
* 获取最后统计的时间
...
...
application/model/UPhoneFollowPp.php
View file @
14c2778b
...
...
@@ -41,6 +41,16 @@ class UPhoneFollowPp extends BaseModel
if
(
isset
(
$params
[
"user_status"
]))
{
$arr
[
"user_status"
]
=
$params
[
"user_status"
];
}
if
(
isset
(
$params
[
"province"
]))
{
$arr
[
"province"
]
=
$params
[
"province"
];
}
if
(
isset
(
$params
[
"city"
]))
{
$arr
[
"city"
]
=
$params
[
"city"
];
}
if
(
isset
(
$params
[
"disc"
]))
{
$arr
[
"disc"
]
=
$params
[
"disc"
];
}
$result
=
$this
->
UPhoneFollowPp
->
insert
(
$arr
);
return
$result
;
}
...
...
@@ -92,15 +102,13 @@ class UPhoneFollowPp extends BaseModel
}
/**
* @param $join
* @param $where
* @return int
*/
public
function
getSearchCount
(
$
join
,
$
where
)
public
function
getSearchCount
(
$where
)
{
$r
=
$this
->
alias
(
'f'
)
->
join
(
$join
)
->
where
(
$where
)
->
count
();
return
$r
;
...
...
@@ -254,16 +262,43 @@ class UPhoneFollowPp extends BaseModel
* @throws \think\exception\DbException
*/
public
function
getFollowList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.agent_id = b.id'
,
'left'
)
->
join
(
'u_users c'
,
'a.user_id = c.id'
,
'left'
)
->
join
(
'u_labels d'
,
'd.id = a.labels_id'
,
'left'
)
$data
=
$this
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
$m_label
=
new
ULabels
();
$m_user
=
new
Users
();
$m_agent
=
new
AAgents
();
$label_data
=
$m_label
->
field
(
'id,name'
)
->
where
(
'type'
,
1
)
->
select
();
foreach
(
$data
as
$k
=>
$v
)
{
if
(
!
empty
(
$v
[
'f_agent_id'
]))
{
$data
[
$k
][
'admin'
]
=
$m_agent
->
getAgentsById
(
$v
[
'f_agent_id'
],
'name'
);
}
if
(
!
empty
(
$v
[
'user_id'
]))
{
$user_data
=
$m_user
->
getUserById
(
'user_name,user_phone,vip,agent_id'
,
$v
[
'user_id'
]);
$data
[
$k
][
'user_name'
]
=
$user_data
[
'user_name'
];
$data
[
$k
][
'user_phone'
]
=
$user_data
[
'user_phone'
];
$data
[
$k
][
'vip'
]
=
$user_data
[
'vip'
];
$data
[
$k
][
'agent_id'
]
=
$user_data
[
'agent_id'
];
//客户客方
}
if
(
!
isset
(
$v
[
'labels_id'
]))
{
continue
;
}
foreach
(
$label_data
as
$k2
=>
$v2
)
{
if
(
$v2
[
'id'
]
==
$v
[
'labels_id'
])
{
$data
[
$k
][
'label_name'
]
=
$v2
[
'name'
];
}
}
}
return
$data
;
}
/**
...
...
@@ -274,10 +309,7 @@ class UPhoneFollowPp extends BaseModel
*/
public
function
getFollowTotal
(
$params
)
{
return
$this
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.agent_id = b.id'
,
'left'
)
->
join
(
'u_users c'
,
'a.user_id = c.id'
,
'left'
)
->
where
(
$params
)
return
$this
->
where
(
$params
)
->
count
();
}
...
...
application/model/Users.php
View file @
14c2778b
...
...
@@ -494,6 +494,27 @@ class Users extends Model
->
select
();
}
/**
* 按添加时间段分组统计
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getAddUserNumGroupTimeNew
(
$params
)
{
$field
=
"count(1) as num"
;
$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_
)
->
select
();
}
public
function
getAddUserNum
(
$params
)
{
$field
=
"count(1) as num"
;
...
...
@@ -769,5 +790,17 @@ class Users extends Model
return
$return
;
}
public
function
getUserCityInfo
(
$id
)
{
$field
=
'province,city,disc'
;
$params
=
[
'id'
=>
$id
];
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
select
();
return
$result
;
}
}
application/route.php
View file @
14c2778b
...
...
@@ -280,6 +280,7 @@ Route::group('index', [
'selectDistrictPerformance'
=>
[
'index/Performance/selectDistrictPerformance'
,
[
'method'
=>
'POST|GET'
]
],
//区域业绩排行 朱伟 2018-07-31
'selectStorePerformance'
=>
[
'index/Performance/selectStorePerformance'
,
[
'method'
=>
'POST|GET'
]
],
//门店业绩排行 朱伟 2018-07-31
'selectIndividualPerformance'
=>
[
'index/Performance/selectIndividualPerformance'
,
[
'method'
=>
'POST|GET'
]
],
//个人业绩排行 朱伟 2018-07-31
'transformFollowUp'
=>
[
'index/HouseFollowUp/transformFollowUp'
,
[
'method'
=>
'GET'
]
],
//个人业绩排行 朱伟 2018-07-31
...
...
@@ -395,6 +396,8 @@ Route::group('task', [
'totalAgentResults_new'
=>
[
'task/ResultsSummaryTask/totalAgentResults'
,
[
'method'
=>
'get'
]
],
//业绩统计
'totalAgentResults'
=>
[
'task/ResultsSummaryNewTask/totalAgentResults'
,
[
'method'
=>
'get'
]
],
//业绩统计
'updateTotalByAgentId'
=>
[
'task/ResultsSummaryNewTask/updateTotalByAgentId'
,
[
'method'
=>
'get'
]
],
//业绩统计
'rongBilledInformUrl'
=>
[
'task/PrivacyNumber/rongBilledInformUrl'
,
[
'method'
=>
'post | get'
]
],
//隐私号码回调[话单通知]
...
...
application/task/controller/ResultsSummaryNewTask.php
0 → 100644
View file @
14c2778b
<?php
namespace
app\task\controller
;
use
app\extra\RedisExt
;
use
app\model\AAgents
;
use
app\model\ASuperviseModel
;
use
app\model\GHouses
;
use
app\model\OBargainModel
;
use
app\model\OMarchInModel
;
use
app\model\OPayLogModel
;
use
app\model\OReportModel
;
use
app\model\TAgentTotalModel
;
use
app\model\Users
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/3/15
* Time : 上午10:07
* Intro:
*/
class
ResultsSummaryNewTask
{
private
$agentsModel
;
private
$tAgentTotalModel
;
private
$houseModel
;
private
$userModel
;
private
$bargainModel
;
private
$reportModel
;
private
$marchInModel
;
private
$payLogModel
;
private
$superviseModel
;
private
$redis_
;
function
__construct
()
{
$this
->
agentsModel
=
new
AAgents
();
$this
->
tAgentTotalModel
=
new
TAgentTotalModel
();
$this
->
houseModel
=
new
GHouses
();
$this
->
userModel
=
new
Users
();
$this
->
bargainModel
=
new
OBargainModel
();
$this
->
reportModel
=
new
OReportModel
();
$this
->
marchInModel
=
new
OMarchInModel
();
$this
->
payLogModel
=
new
OPayLogModel
();
$this
->
redis_
=
RedisExt
::
getRedis
();
$this
->
superviseModel
=
new
ASuperviseModel
();
}
public
function
totalAgentResults
()
{
set_time_limit
(
0
);
// 取消脚本运行时间的超时上限
//todo 按小时统计
//todo 1.分页查询经纪人, 2遍历执行,判断一个经纪人在统计表最后一条统计数据的日期
//TODO 3.日期加一天并判断是否大于等于当前时间大于return 4.执行此日期的统计,5.当次日期小于当前日期,递归日期加一。继续统计
$total
=
$this
->
agentsModel
->
getAgentsCountByTask
();
$pageSize
=
100
;
$pageTotal
=
ceil
(
$total
/
$pageSize
);
for
(
$pageNo
=
1
;
$pageNo
<=
$pageTotal
;
$pageNo
++
)
{
$resultArr
=
$this
->
agentsModel
->
getAgentsListByTask
(
$pageNo
,
$pageSize
,
"id,store_id,district_id"
);
$this
->
executeTotal
(
$resultArr
,
null
);
unset
(
$resultArr
);
}
unset
(
$this
->
agentsModel
);
unset
(
$this
->
tAgentTotalModel
);
unset
(
$this
->
houseModel
);
unset
(
$this
->
userModel
);
unset
(
$this
->
bargainModel
);
unset
(
$this
->
reportModel
);
unset
(
$this
->
marchInModel
);
unset
(
$this
->
payLogModel
);
}
/**
* @param $agent_id
* @param $store_id
* @param $district_id
* @param $total_time 比如修改了数据如成交报告,成交报告提交时间是昨天那么这里的时间就是昨天
*/
public
function
updateTotalByAgentId
(
$agent_id
,
$store_id
,
$district_id
,
$total_time
)
{
$params
[
0
][
"id"
]
=
$agent_id
;
$params
[
0
][
"store_id"
]
=
$store_id
;
$params
[
0
][
"district_id"
]
=
$district_id
;
/* $params[0]["id"] = 5439;
$params[0]["store_id"] = 92;
$params[0]["district_id"] = 2;
$total_time = '2018-08-15';*/
$this
->
executeTotal
(
$params
,
$total_time
);
}
private
function
executeTotal
(
$resultArr
,
$total_time
)
{
$start_total_time
=
date
(
"Y-m-d 00:00:00"
,
time
());
$end_total_time
=
date
(
"Y-m-d H:i:s"
,
time
());
if
(
!
empty
(
$total_time
))
{
$start_total_time
=
$total_time
.
" 00:00:00"
;
$end_total_time
=
$total_time
.
" 23:59:59"
;
}
else
{
$total_time
=
date
(
"Y-m-d"
,
time
());
}
$insertArr
=
$updateArr
=
[];
foreach
(
$resultArr
as
$key
=>
$value
)
{
$param
[
"agent_id"
]
=
$value
[
"id"
];
$param
[
"is_del"
]
=
0
;
$param
[
"total_time"
]
=
$total_time
;
$total_time_arr
=
$this
->
tAgentTotalModel
->
getTotalEndTimeByAgentId
(
"id,total_time"
,
$param
);
$id
=
0
;
if
(
count
(
$total_time_arr
)
>
0
)
{
$id
=
$total_time_arr
[
0
][
"id"
];
}
$agent_id
=
empty
(
$value
[
"id"
])
?
0
:
$value
[
"id"
];
$district_id
=
empty
(
$value
[
"district_id"
])
?
0
:
$value
[
"district_id"
];
$store_id
=
empty
(
$value
[
"store_id"
])
?
0
:
$value
[
"store_id"
];
//todo 查询时间段的数据
$result
=
$this
->
selectTotal
(
$agent_id
,
$district_id
,
$store_id
,
$start_total_time
,
$end_total_time
);
if
(
empty
(
$result
))
continue
;
if
(
$id
>
0
)
{
$result
[
"id"
]
=
$id
;
unset
(
$result
[
"create_time"
]);
array_push
(
$updateArr
,
$result
);
}
else
{
array_push
(
$insertArr
,
$result
);
}
unset
(
$result
);
}
if
(
count
(
$insertArr
)
>
0
)
{
$this
->
tAgentTotalModel
->
addTotal
(
$insertArr
);
}
if
(
count
(
$updateArr
)
>
0
)
{
$this
->
tAgentTotalModel
->
saveTotal
(
$updateArr
);
}
}
/* public function test()
{
$params = $this->selectTotal(1, 1, 1, "2018-02-02", "2018-03-15");
$this->tAgentTotalModel->addTotal($params);
// dump($params);
}*/
private
function
selectTotal
(
$agent_id
,
$district_id
,
$store_id
,
$start_total_time
,
$end_total_time
)
{
//todo 如果查询出这个时间段都为0 则给此经纪人插入条最后一个日期的为空的数据
$result_arr
=
[];
//房源
$params
[
"agent_id"
]
=
$agent_id
;
$params
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_total_time
,
$end_total_time
)
);
$addHouseNum
=
$this
->
houseModel
->
getAddHouseNumGroupTimeNew
(
$params
);
$result_arr
[
"house_num"
]
=
$addHouseNum
[
0
][
"num"
];
//dump($addHouseNum);
//客源
$addUserNum
=
$this
->
userModel
->
getAddUserNumGroupTimeNew
(
$params
);
$result_arr
[
"user_num"
]
=
$addUserNum
[
0
][
"num"
];
//dump($addUserNum);
//业绩
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNumGroupTimeNew
(
$params
,
1
);
//1表示业绩 2表示实收
// dump($performanceSum);
$result_arr
[
"performance_sum"
]
=
$performanceSum
[
0
][
"num"
];
//实收
$receivedSum
=
$this
->
bargainModel
->
getReceivedGroupTimeNew
(
$params
);
$result_arr
[
"received_sum"
]
=
$receivedSum
[
0
][
"num"
];
//dump($receivedSum);
//约带看
$reportNum
=
$this
->
reportModel
->
getAddReportNumGroupTimeNew
(
$params
);
$result_arr
[
"report_num"
]
=
$reportNum
[
0
][
"num"
];
//dump($reportNum);
//进场
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNumGroupTimeNew
(
$params
);
$result_arr
[
"addMarch_in_num"
]
=
$addMarchInNum
[
0
][
"num"
];
//dump($addMarchInNum);
//收款
$payLogNum
=
$this
->
payLogModel
->
getAddPayLogNumGroupTimeNew
(
$params
);
$result_arr
[
"pay_log_num"
]
=
$payLogNum
[
0
][
"num"
];
//dump($payLogNum);
// 监督
$supervision_num
=
$this
->
superviseModel
->
getAddPayLogNumGroupTimeNew
(
$params
);
$result_arr
[
"supervision_num"
]
=
$supervision_num
[
0
][
"num"
];
//成交报告
$bargainSum
=
$this
->
bargainModel
->
getAddBargainNumGroupTimeNew
(
$params
,
3
);
//表示统计
$result_arr
[
"bargain_sum"
]
=
$bargainSum
[
0
][
"num"
];
return
$this
->
binAgentModel
(
$agent_id
,
$district_id
,
$store_id
,
$result_arr
,
$start_total_time
);
}
private
function
binAgentModel
(
$agent_id
,
$district_id
,
$store_id
,
$result_arr
,
$start_total_time
)
{
$params
=
[];
if
(
!
empty
(
$result_arr
[
"house_num"
])
||
!
empty
(
$result_arr
[
"user_num"
])
||
!
empty
(
$result_arr
[
"performance_sum"
])
||
!
empty
(
$result_arr
[
"received_sum"
])
||
!
empty
(
$result_arr
[
"report_num"
])
||
!
empty
(
$result_arr
[
"addMarch_in_num"
])
||
!
empty
(
$result_arr
[
"pay_log_num"
])
||
!
empty
(
$result_arr
[
"supervision_num"
])
||
!
empty
(
$result_arr
[
"bargain_sum"
]))
{
$params
[
"district_id"
]
=
$district_id
;
$params
[
"store_id"
]
=
$store_id
;
$params
[
"agent_id"
]
=
$agent_id
;
$params
[
"total_time"
]
=
$start_total_time
;
$params
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$params
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$params
[
"add_house_num"
]
=
!
empty
(
$result_arr
[
"house_num"
])
?
$result_arr
[
"house_num"
]
:
0
;
$params
[
"add_user_num"
]
=
!
empty
(
$result_arr
[
"user_num"
])
?
$result_arr
[
"user_num"
]
:
0
;
$params
[
"performance"
]
=
!
empty
(
$result_arr
[
"performance_sum"
])
?
$result_arr
[
"performance_sum"
]
:
0
;
$params
[
"official_receipts"
]
=
!
empty
(
$result_arr
[
"received_sum"
])
?
$result_arr
[
"received_sum"
]
:
0
;
$params
[
"look_at_num"
]
=
!
empty
(
$result_arr
[
"report_num"
])
?
$result_arr
[
"report_num"
]
:
0
;
$params
[
"march_in_num"
]
=
!
empty
(
$result_arr
[
"addMarch_in_num"
])
?
$result_arr
[
"addMarch_in_num"
]
:
0
;
$params
[
"paylog"
]
=
!
empty
(
$result_arr
[
"pay_log_num"
])
?
$result_arr
[
"pay_log_num"
]
:
0
;
$params
[
"supervision_num"
]
=
!
empty
(
$result_arr
[
"supervision_num"
])
?
$result_arr
[
"supervision_num"
]
:
0
;
$params
[
"bargain_sum"
]
=
!
empty
(
$result_arr
[
"bargain_sum"
])
?
$result_arr
[
"bargain_sum"
]
:
0
;
}
unset
(
$result_arr
);
return
$params
;
}
}
\ No newline at end of file
public/resource/js/RemarkFollowIndex.js
View file @
14c2778b
...
...
@@ -827,18 +827,36 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'ckfinder', 'ckfinde
params
.
remark_phone
=
$
.
trim
(
$
(
"#remark_phone"
).
val
());
params
.
remark_store_id
=
$
.
trim
(
$
(
"#guest_stores"
).
val
());
params
.
remark_district_id
=
$
.
trim
(
$
(
"#district_id"
).
val
());
if
(
params
.
remark_name
.
length
==
1
){
alert
(
'跟进人姓名的搜索必须2字及2字以上'
);
return
;
}
if
(
$
(
'#user_city_choose'
).
val
()
==
310100
){
//城市
params
.
city
=
'上海市'
;
}
if
(
$
(
'#user_city_choose'
).
val
()
==
330100
){
params
.
city
=
'杭州市'
;
}
params
.
user_id
=
$
.
trim
(
$
(
"#customer_name_id"
).
val
());
//区域
params
.
disc
=
$
.
trim
(
$
(
"#user_area_choose"
).
val
());
//区域
_startDateObj
.
val
()
!=
''
&&
(
params
.
start_date
=
_startDateObj
.
val
());
_endDateObj
.
val
()
!=
''
&&
(
params
.
end_date
=
_endDateObj
.
val
());
$
.
trim
(
_customerNameObj
.
val
())
!=
''
&&
(
params
.
customer
=
$
.
trim
(
_customerNameObj
.
val
()));
$
.
trim
(
_customerPhoneObj
.
val
())
!=
''
&&
(
params
.
phone
=
$
.
trim
(
_customerPhoneObj
.
val
()));
$
.
trim
(
_followContentObj
.
val
())
!=
''
&&
(
params
.
content
=
$
.
trim
(
_followContentObj
.
val
()));
//
var
start_
=
params
.
start_date
+
" 00:00:00"
;
date_start
=
new
Date
(
Date
.
parse
(
start_
.
replace
(
/-/g
,
"/"
)));
var
start_time
=
date_start
.
getTime
();
var
end_
=
params
.
end_date
+
" 00:00:00"
;
date_end
=
new
Date
(
Date
.
parse
(
end_
.
replace
(
/-/g
,
"/"
)));
var
end_time
=
date_end
.
getTime
();
var
cha_time
=
end_time
-
start_time
;
if
(
cha_time
>
2678400000
){
alert
(
"跟进时间搜索控制在30天以内"
);
return
;
}
$
.
ajax
({
type
:
'GET'
,
...
...
public/resource/js/houseFollowUp.js
View file @
14c2778b
...
...
@@ -207,6 +207,12 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css'
return
;
}
var
cha_time
=
params
.
end_time
*
1000
-
params
.
start_time
*
1000
;
if
(
cha_time
>
2764800000
){
alert
(
"跟进时间搜索控制在30天以内"
);
return
;
}
$
.
ajax
({
type
:
'POST'
,
url
:
'/broker/houseFollowUpList'
,
//商铺跟进 对接接口
...
...
public/resource/js/realtimePerformance.js
View file @
14c2778b
...
...
@@ -11,6 +11,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
store_id_Two
:
0
,
//二级门店id
is_today_yeji
:
0
,
//默认搜索的不是今天 传参数0
panfangData
:
null
,
orderList
:
0
,
init
:
function
()
{
//初始化dot
$
(
document
.
body
).
append
(
template
);
...
...
@@ -81,6 +82,20 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
realtime
.
is_today_yeji
=
0
;
realtime
.
getList
(
1
);
//一级审核搜索
});
//正序
_doc
.
on
(
'click'
,
'.positive-sequence-yeji'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
realtime
.
orderList
=
1
;
realtime
.
getList
(
1
);
});
//倒序
_doc
.
on
(
'click'
,
'.reverse-order-yeji'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
realtime
.
orderList
=
0
;
realtime
.
getList
(
1
);
});
//搜索的重置
$
(
"#maintable_reset"
).
click
(
function
()
{
...
...
@@ -140,7 +155,12 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
var
tpl
=
realtime
.
switchTpl
();
console
.
log
(
tpl
);
var
doTtmpl
=
doT
.
template
(
document
.
getElementById
(
tpl
).
innerHTML
);
$
(
"#maintable_list"
).
html
(
doTtmpl
(
data
.
data
));
if
(
realtime
.
orderList
==
0
){
$
(
"#maintable_list"
).
html
(
doTtmpl
(
data
.
data
.
list
.
slice
(
0
,
19
)));
}
if
(
realtime
.
orderList
==
1
){
$
(
"#maintable_list"
).
html
(
doTtmpl
(
data
.
data
.
list
.
reverse
().
slice
(
0
,
19
)));
}
//获取统计时间
$
(
'#rank_start_day'
).
html
(
data
.
data
.
start_time
);
$
(
'#rank_end_day'
).
html
(
data
.
data
.
end_time
);
...
...
public/resource/js/reportList.js
View file @
14c2778b
...
...
@@ -279,11 +279,12 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
_doc
.
on
(
'click'
,
'#maid_ok_btn'
,
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
if
(
bargain
.
mainTabIndex
===
2
){
bargain
.
maidConfirmOk
(
1
);
}
else
{
alert
(
'财务第三级审核人员才能确认分佣!'
);
}
// if(bargain.mainTabIndex === 2){
// bargain.maidConfirmOk(1);
// }else{
// alert('财务第三级审核人员才能确认分佣!');
// }
});
//详情弹出框,分佣提成里,点击保存触发的事件
...
...
public/resource/template/real_time_performance_template_tpl.html
View file @
14c2778b
<!--部门业绩排行-->
<script
id=
"realtimePerformance_list_tpl_one"
type=
"text/template"
>
[
%
if
(
it
[
"list"
]
&&
it
[
"list"
].
length
&&
it
[
"list"
]
.
length
>
0
)
{
%
]
[
%
if
(
it
&&
it
.
length
&&
it
.
length
>
0
)
{
%
]
<
tr
class
=
"maintable-tr-bar"
>
<
th
class
=
"text-center"
>
排名
<
/th
>
<
th
class
=
"text-center"
>
部门
<
/th
>
<
th
class
=
"text-center"
>
业绩(元)
<
/th
>
<
th
class
=
"text-center"
>
业绩(元)
<
span
class
=
"glyphicon glyphicon-triangle-bottom positive-sequence-yeji"
><
/span><span class="glyphicon glyphicon-triangle-top reverse-order-yeji"></
span
><
/th
>
<
th
class
=
"text-center"
>
成交单数
<
/th
>
<!--<
th
class
=
"text-center"
>
成交报告(其他)
<
/th>--
>
<
th
class
=
"text-center"
>
收款数
<
/th
>
<
th
class
=
"text-center"
>
进场数
<
/th
>
<
th
class
=
"text-center"
>
报备数
<
/th
>
...
...
@@ -14,21 +13,20 @@
<
th
class
=
"text-center"
>
新增客户
<
/th
>
<
th
class
=
"text-center"
>
团队人数
<
/th
>
<
/tr
>
[
%
for
(
var
item
in
it
[
"list"
]
){
%
]
<
tr
data
-
id
=
"[%= it[
'list'][
item]['district_id'] %]"
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'index_'
]
%
]
<
/td
>
[
%
for
(
var
item
in
it
){
%
]
<
tr
data
-
id
=
"[%= it[item]['district_id'] %]"
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'index_'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
<
a
class
=
"store-ranking"
href
=
"#modal-store"
data
-
toggle
=
"modal"
data
-
id
=
"[%= it[
'list'][item]['district_id'] %]"
>
[
%=
it
[
"list"
][
item
][
'district_name'
]
+
'-'
+
it
[
"list"
]
[
item
][
'name'
]
%
]
<
/a
>
<
a
class
=
"store-ranking"
href
=
"#modal-store"
data
-
toggle
=
"modal"
data
-
id
=
"[%= it[
item]['district_id'] %]"
>
[
%=
it
[
item
][
'district_name'
]
+
'-'
+
it
[
item
][
'name'
]
%
]
<
/a
>
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'performance_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'bargain_sum_total'
]
%
]
<
/td
>
<!--<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'bargain_sum'
]
%
]
<
/td>--
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'paylog_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'march_in_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'look_at_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'add_house_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'add_user_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'team_num'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'performance_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'bargain_sum_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'paylog_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'march_in_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'look_at_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'add_house_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'add_user_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'team_num'
]
%
]
<
/td
>
<
/tr
>
[
%
}
%
]
...
...
@@ -41,13 +39,12 @@
<!--门店业绩排行-->
<script
id=
"realtimePerformance_list_tpl_two"
type=
"text/template"
>
[
%
if
(
it
[
"list"
]
&&
it
[
"list"
].
length
&&
it
[
"list"
]
.
length
>
0
)
{
%
]
[
%
if
(
it
&&
it
.
length
&&
it
.
length
>
0
)
{
%
]
<
tr
class
=
"maintable-tr-bar"
>
<
th
class
=
"text-center"
>
排名
<
/th
>
<
td
class
=
"text-center"
>
门店
<
/td
>
<
th
class
=
"text-center"
>
业绩(元)
<
/th
>
<
th
class
=
"text-center"
>
业绩(元)
<
span
class
=
"glyphicon glyphicon-triangle-bottom positive-sequence-yeji"
><
/span><span class="glyphicon glyphicon-triangle-top reverse-order-yeji"></
span
><
/th
>
<
th
class
=
"text-center"
>
成交单数
<
/th
>
<!--<
th
class
=
"text-center"
>
成交报告(其他)
<
/th>--
>
<
th
class
=
"text-center"
>
收款数
<
/th
>
<
th
class
=
"text-center"
>
进场数
<
/th
>
<
th
class
=
"text-center"
>
报备数
<
/th
>
...
...
@@ -55,21 +52,20 @@
<
th
class
=
"text-center"
>
新增客户
<
/th
>
<
th
class
=
"text-center"
>
团队人数
<
/th
>
<
/tr
>
[
%
for
(
var
item
in
it
[
"list"
]
){
%
]
[
%
for
(
var
item
in
it
){
%
]
<
tr
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'index_'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'index_'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
<
a
class
=
"agent-ranking"
href
=
"#modal-agent"
data
-
toggle
=
"modal"
data
-
id
=
"[%= it[
'list'][item]['store_id'] %]"
>
[
%=
it
[
"list"
][
item
][
'district_name'
]
+
'-'
+
it
[
"list"
][
item
][
'store_name'
]
+
'-'
+
it
[
"list"
]
[
item
][
'name'
]
%
]
<
/a
>
<
a
class
=
"agent-ranking"
href
=
"#modal-agent"
data
-
toggle
=
"modal"
data
-
id
=
"[%= it[
item]['store_id'] %]"
>
[
%=
it
[
item
][
'district_name'
]
+
'-'
+
it
[
item
][
'store_name'
]
+
'-'
+
it
[
item
][
'name'
]
%
]
<
/a
>
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'performance_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'bargain_sum_total'
]
%
]
<
/td
>
<!--<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'bargain_sum'
]
%
]
<
/td>--
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'paylog_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'march_in_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'look_at_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'add_house_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'add_user_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'team_num'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'performance_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'bargain_sum_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'paylog_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'march_in_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'look_at_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'add_house_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'add_user_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'team_num'
]
%
]
<
/td
>
<
/tr
>
[
%
}
%
]
[
%
}
else
{
%
]
...
...
@@ -81,31 +77,29 @@
<!--个人业绩排行-->
<script
id=
"realtimePerformance_list_tpl_three"
type=
"text/template"
>
[
%
if
(
it
[
"list"
]
&&
it
[
"list"
].
length
&&
it
[
"list"
]
.
length
>
0
)
{
%
]
[
%
if
(
it
&&
it
.
length
&&
it
.
length
>
0
)
{
%
]
<
tr
class
=
"maintable-tr-bar"
>
<
th
class
=
"text-center"
>
排名
<
/th
>
<
th
class
=
"text-center"
>
经纪人
<
/th
>
<
th
class
=
"text-center"
>
业绩(元)
<
/th
>
<
th
class
=
"text-center"
>
业绩(元)
<
span
class
=
"glyphicon glyphicon-triangle-bottom positive-sequence-yeji"
><
/span><span class="glyphicon glyphicon-triangle-top reverse-order-yeji"></
span
><
/th
>
<
th
class
=
"text-center"
>
成交单数
<
/th
>
<!--<
th
class
=
"text-center"
>
成交报告(其他)
<
/th>--
>
<
th
class
=
"text-center"
>
收款数
<
/th
>
<
th
class
=
"text-center"
>
进场数
<
/th
>
<
th
class
=
"text-center"
>
报备数
<
/th
>
<
th
class
=
"text-center"
>
新增商铺
<
/th
>
<
th
class
=
"text-center"
>
新增客户
<
/th
>
<
/tr
>
[
%
for
(
var
item
in
it
[
"list"
]){
%
]
<
tr
data
-
id
=
"[%= it['list'][item]['id'] %]"
data
-
orderid
=
"[%= it['list'][item]['order_id'] %]"
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'index_'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'district_name'
]
+
'-'
+
it
[
"list"
][
item
][
'store_name'
]
+
'-'
+
it
[
"list"
][
item
][
'name'
]
%
]
<
/a></
td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'performance_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'bargain_sum_total'
]
%
]
<
/td
>
<!--<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'bargain_sum'
]
%
]
<
/td>--
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'paylog_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'march_in_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'look_at_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'add_house_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
"list"
][
item
][
'add_user_num_total'
]
%
]
<
/td
>
[
%
for
(
var
item
in
it
){
%
]
<
tr
data
-
id
=
"[%= it[item]['id'] %]"
data
-
orderid
=
"[%= it[item]['order_id'] %]"
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'index_'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'district_name'
]
+
'-'
+
it
[
item
][
'store_name'
]
+
'-'
+
it
[
item
][
'name'
]
%
]
<
/a></
td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'performance_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'bargain_sum_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'paylog_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'march_in_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'look_at_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'add_house_num_total'
]
%
]
<
/td
>
<
td
class
=
"text-center"
>
[
%=
it
[
item
][
'add_user_num_total'
]
%
]
<
/td
>
<
/tr
>
[
%
}
%
]
[
%
}
else
{
%
]
...
...
@@ -115,6 +109,9 @@
[
%
}
%
]
</script>
<!--门店业绩 详情-->
<script
id=
"store_list_tpl"
type=
"text/template"
>
[
%
if
(
it
[
"list"
]
&&
it
[
"list"
].
length
&&
it
[
"list"
].
length
>
0
)
{
%
]
...
...
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