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
2f33d47a
Commit
2f33d47a
authored
Jun 28, 2019
by
clone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0618-v3.3.2' of
https://gitee.com/zwyjjc/tl_estate
into 0618-v3.3.2
parents
4d0b9d32
37a47b62
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
158 additions
and
126 deletions
+158
-126
Statement.php
application/api_broker/controller/Statement.php
+5
-5
User.php
application/api_broker/controller/User.php
+2
-2
StatementService.php
application/api_broker/service/StatementService.php
+66
-64
ChatVerifyValidate.php
application/chat/validate/ChatVerifyValidate.php
+2
-2
Finance.php
application/index/controller/Finance.php
+1
-1
Member.php
application/index/controller/Member.php
+1
-1
OfficeFinance.php
application/index/controller/OfficeFinance.php
+1
-1
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+4
-0
UserLogService.php
application/index/service/UserLogService.php
+1
-1
UserService.php
application/index/service/UserService.php
+22
-17
OBargainModel.php
application/model/OBargainModel.php
+49
-29
OPartialCommission.php
application/model/OPartialCommission.php
+1
-0
ORealIncome.php
application/model/ORealIncome.php
+1
-1
inspectionRecordAllOffice.js
public/resource/js/inspectionRecordAllOffice.js
+2
-2
No files found.
application/api_broker/controller/Statement.php
View file @
2f33d47a
...
...
@@ -39,7 +39,7 @@ class Statement extends Basic
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
// big_log('日报周报获取新增数据-dayStatement');
big_log
(
$params
);
// big_log(json_encode($params)
);
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"time_start"
])
||
!
isset
(
$params
[
"time_end"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
...
...
@@ -248,18 +248,19 @@ class Statement extends Basic
$field
=
"id,store_id,district_id,level,name,phone,sex,status"
;
$agentModel
=
new
AAgents
();
$agent_result
=
$agentModel
->
getAgentById
(
$field
,
[
"agent_id"
=>
$params
[
"agent_id"
]
]);
if
(
!
$agent_result
){
return
$this
->
response
(
"200"
,
"request is null"
);
}
$store_id
=
$agent_result
[
0
][
"store_id"
];
$district_id
=
$agent_result
[
0
][
"district_id"
];
switch
(
$agent_result
[
0
][
"level"
])
{
case
10
:
#业务员
$agent_level
=
0
;
$result
=
$this
->
service_
->
selectStatementForClerk
(
$params
[
"agent_id"
],
$this
->
siteId
);
$result
=
$this
->
service_
->
selectStatementForClerk
(
$params
[
"agent_id"
],
$agent_level
,
$store_id
,
$district_id
);
break
;
case
20
:
#店长
...
...
@@ -276,8 +277,7 @@ class Statement extends Basic
#总监
$agent_level
=
2
;
if
(
$params
[
"type"
]
==
0
){
#日报
$result
=
$this
->
service_
->
selectStatementForDistrictWithDay
(
$params
[
"agent_id"
],
$agent_level
,
$store_id
,
$district_id
);
$result
=
$this
->
service_
->
selectStatementForDistrictWithDay
(
$agent_level
,
$district_id
);
}
else
{
#周报
$result
=
$this
->
service_
->
selectStatementForDistrictWithWeek
(
$params
[
"agent_id"
],
$agent_level
,
$store_id
,
$district_id
);
...
...
application/api_broker/controller/User.php
View file @
2f33d47a
...
...
@@ -275,7 +275,7 @@ class User extends Basic
$return_user_list
[
$k
][
'user_phone'
]
=
substr_replace
(
$return_user_list
[
$k
][
'user_phone'
],
'****'
,
3
,
4
);
$return_user_list
[
$k
][
'site_ids_name'
]
=
$user_service
->
userSiteName
(
$v
[
"site_ids"
]);
$return_user_list
[
$k
][
'user_name'
]
=
$v
[
'user_name'
]
&&
$v
[
'entrust_type'
]
==
0
?
"
[
{
$v
[
'concrete_industry'
]
}
]
{
$v
[
'user_name'
]
}
"
:
$v
[
'user_name'
];
$return_user_list
[
$k
][
'user_name'
]
=
$v
[
'user_name'
]
&&
$v
[
'entrust_type'
]
==
0
?
"
{
$v
[
'concrete_industry'
]
}
,
{
$v
[
'user_name'
]
}
"
:
$v
[
'user_name'
];
}
...
...
@@ -844,7 +844,7 @@ class User extends Basic
}
$s_index_user
=
new
UserService
();
//新增
$add_res
=
$s_index_user
->
addUserBind
(
$this
->
params
[
'user_id'
],
$this
->
params
[
'bind_id'
]);
$add_res
=
$s_index_user
->
addUserBind
(
$this
->
params
[
'user_id'
],
$this
->
params
[
'bind_id'
]
,
$this
->
agentId
);
if
(
$add_res
===
true
)
{
return
$this
->
response
(
"200"
,
"绑定成功"
);
}
else
{
...
...
application/api_broker/service/StatementService.php
View file @
2f33d47a
...
...
@@ -31,6 +31,7 @@ class StatementService
private
$reportModel
;
private
$marchInModel
;
private
$bargainModel
;
private
$partialCommission
;
const
USER_LEVEL_FIST
=
0
;
//经纪人
const
USER_LEVEL_SECOND
=
1
;
//店长
...
...
@@ -46,6 +47,7 @@ class StatementService
$this
->
reportModel
=
new
OReportModel
();
$this
->
marchInModel
=
new
OMarchInModel
();
$this
->
bargainModel
=
new
OBargainModel
();
$this
->
partialCommission
=
new
OPartialCommission
();
}
...
...
@@ -183,8 +185,7 @@ class StatementService
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$result
[
"performance_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$m_partial
=
new
OPartialCommission
();
$real_performanceSum
=
$m_partial
->
getReceived
(
$where_
);
$real_performanceSum
=
$this
->
partialCommission
->
getReceived
(
$where_
);
$result
[
"real_performance_month"
]
=
isset
(
$real_performanceSum
[
0
][
"num"
])
?
$real_performanceSum
[
0
][
"num"
]
:
0
;
//本周业绩
...
...
@@ -247,7 +248,7 @@ class StatementService
$end_time
=
$start_time
;
$where_
[
"agent_id"
]
=
$agent_id
;
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
// dump($where_);
// dump($where_);
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
3
);
//1表示业绩 2表示实收
$result
[
"bargain_sum_store"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
...
...
@@ -259,8 +260,8 @@ class StatementService
$where_
[
"agent_id"
]
=
$agent_id
;
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
//dump($where_);
// $reportNum = $this->reportModel->getAddReportNum($where_);
// $result["look_at_num_day_store"] = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
// $reportNum = $this->reportModel->getAddReportNum($where_);
// $result["look_at_num_day_store"] = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$where_
);
$result
[
"look_at_num_day_store"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
...
...
@@ -293,7 +294,7 @@ class StatementService
$where_
=
[];
$start_time
=
date
(
"Y-m-01"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
time
());
// $where_["district_id"] = $district_id;
// $where_["district_id"] = $district_id;
$where_
[
"agent_id"
]
=
$conditions
[
"agent_id"
];
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
...
...
@@ -337,7 +338,7 @@ class StatementService
$where_
=
[];
$start_time
=
date
(
"Y-m-01"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
time
());
// $where_["district_id"] = $district_id;
// $where_["district_id"] = $district_id;
$where_
[
"agent_id"
]
=
$conditions
[
"agent_id"
];
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
...
...
@@ -404,7 +405,7 @@ class StatementService
$where_
[
'status'
]
=
array
(
"in"
,
'10, 11, 13, 20'
);
$obargain
=
new
OBargainModel
();
// dump($where_);
// dump($where_);
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$store_list
[
"performance_week"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
...
...
@@ -477,7 +478,7 @@ class StatementService
foreach
(
$results
as
$key
=>
$value
)
{
// dump($value);
// dump($value);
$last_week_total
+=
$value
[
"agent_num"
];
$paramArr
[
"store_id"
]
=
$value
[
"store_id"
];
$paramArr
[
"level"
]
=
array
(
"in"
,
[
20
,
40
]
);
...
...
@@ -572,57 +573,54 @@ class StatementService
}
/**
* 查询业务员日报数据
* @param $agent_id
* @param $site_id
* @return mixed
* @param $agent_level
* @param $store_id
* @param $district_id
* @return mixed user 朱伟
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=698
*/
public
function
selectStatementForClerk
(
$agent_id
,
$site_id
)
public
function
selectStatementForClerk
(
$agent_id
,
$agent_level
,
$store_id
,
$district_id
)
{
$time_
=
date
(
"Y-m-d"
,
time
());
$conditions
[
'agent_id'
]
=
$agent_id
;
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$time_
.
" 00:00:00"
,
$time_
.
" 23:59:59"
)
);
/*** 日数据 **/
// 房源
$result
[
"house_num"
]
=
$this
->
housesToAgents
->
getAddHouseNumByAgentId
(
$conditions
);
// 客源
$result
[
"user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentIdV2
(
$conditions
);
$result
[
"user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentId
(
$conditions
);
// 带看 (报备)
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$conditions
);
$result
[
"follow_up_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
//跟进
$m_phone_follow_up
=
new
UPhoneFollowUpTemporary
(
$site_id
);
$result
[
"phone_follow_up_num"
]
=
$m_phone_follow_up
->
getFollowTotal
(
$conditions
);
/*** 月数据 **/
// 业绩
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$conditions
,
1
);
//1表示业绩 2表示实收
$result
[
"performance"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
// 本月-业绩
$start_time
=
date
(
"Y-m-01"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
time
());
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
// 房源
$result
[
"month_house_num"
]
=
$this
->
housesToAgents
->
getAddHouseNumByAgentId
(
$conditions
);
// 客源
$result
[
"month_user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentIdV2
(
$conditions
);
// 带看 (报备)
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$conditions
);
$result
[
"month_follow_up_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
//业绩
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$conditions
,
1
);
//1表示业绩 2表示实收
$result
[
"month_performance"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
//成交单数
$result
[
"performance_for_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
// 本月-成交单数
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNumV2
(
$conditions
,
3
);
//1表示业绩 2表示实收
$result
[
"
month_bargain_sum
"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$result
[
"
bargain_sum_for_month
"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
return
$result
;
}
/**
* 店长日报
6666666
* 店长日报
2019年06月17日 线上
* @param $agent_id
* @param $agent_level
* @param $store_id
...
...
@@ -634,11 +632,10 @@ class StatementService
{
$time_
=
date
(
"Y-m-d"
,
time
());
$agent_res
=
$this
->
getAgentIDsByDistrictId
(
$store_id
,
$agent_level
,
0
);
$agent_res
=
$this
->
getAgentIDsByDistrictId
(
$store_id
,
$agent_level
);
############################## 当日数据 ################################################
$conditions
[
'agent_id'
]
=
array
(
"in"
,
$agent_res
[
'agent_ids'
]
);
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$time_
.
" 00:00:00"
,
$time_
.
" 23:59:59"
)
);
// 房源
$result
[
"team_house_num"
]
=
$this
->
housesToAgents
->
getAddHouseNumByAgentId
(
$conditions
);
...
...
@@ -648,13 +645,13 @@ class StatementService
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$conditions
);
$result
[
"team_follow_up_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
// 业绩
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$conditions
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
V3
(
$conditions
,
1
);
//1表示业绩 2表示实收
$result
[
"team_performance"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
// 实收
$
performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$conditions
,
2
);
//1表示业绩 2表示实收
$result
[
"team_real_performance"
]
=
isset
(
$
performanceSum
[
0
][
"num"
])
?
$
performanceSum
[
0
][
"num"
]
:
0
;
$
real_performanceSum
=
$this
->
partialCommission
->
getReceived
(
$conditions
);
$result
[
"team_real_performance"
]
=
isset
(
$
real_performanceSum
[
0
][
"num"
])
?
$real_
performanceSum
[
0
][
"num"
]
:
0
;
// 本月-业绩
############################## 本月数据 ################################################
$start_time
=
date
(
"Y-m-01"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
time
());
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
...
...
@@ -667,19 +664,16 @@ class StatementService
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$conditions
);
$result
[
"team_month_follow_up_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
// 业绩
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$conditions
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
V3
(
$conditions
,
1
);
//1表示业绩 2表示实收
$result
[
"team_month_performance"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
// 实收666666666666
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$conditions
,
2
);
//1表示业绩 2表示实收
$result
[
"team_month_real_performance"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
// 实收
$real_performanceSum
=
$this
->
partialCommission
->
getReceived
(
$conditions
);
$result
[
"team_month_real_performance"
]
=
isset
(
$real_performanceSum
[
0
][
"num"
])
?
$real_performanceSum
[
0
][
"num"
]
:
0
;
// 本月-成交单数
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNumV2
(
$conditions
,
3
);
//1表示业绩 2表示实收
$result
[
"team_month_bargain_sum"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
/**查询店长个人数据**/
#店长个人
############################## 店长个人数据 ################################################
$time_
=
date
(
"Y-m-d"
,
time
());
$conditions
[
'agent_id'
]
=
$agent_id
;
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$time_
.
" 00:00:00"
,
$time_
.
" 23:59:59"
)
);
...
...
@@ -697,7 +691,7 @@ class StatementService
$result
[
"self_phone_follow_up_num"
]
=
$m_phone_follow_up
->
getFollowTotal
(
$conditions
);
/**查询店长旗下业务员数据**/
$agent_res
=
$this
->
getAgentIDsByDistrictId
(
$store_id
,
$agent_level
,
1
);
foreach
(
$agent_res
[
'store_list'
]
as
$k
=>
$v
)
{
$conditions
[
'agent_id'
]
=
$v
[
"id"
];
// 房源
...
...
@@ -708,7 +702,7 @@ class StatementService
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$conditions
);
$agent_res
[
'store_list'
][
$k
][
"follow_up_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
// 业绩
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$conditions
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
V3
(
$conditions
,
1
);
//1表示业绩 2表示实收
$agent_res
[
'store_list'
][
$k
][
"performance"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
}
$result
[
"store_list"
]
=
$agent_res
[
'store_list'
];
...
...
@@ -806,34 +800,35 @@ class StatementService
}
/**
* 查询总监日报数据
* @param $agent_id
* 总监日报 2019年06月28日 线上
* @param $agent_level
* @param $store_id
* @param $district_id
* @return mixed
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=701
*/
public
function
selectStatementForDistrictWithDay
(
$agent_
id
,
$agent_level
,
$store_id
,
$district_id
)
public
function
selectStatementForDistrictWithDay
(
$agent_
level
,
$district_id
)
{
$agent_res
=
$this
->
getAgentIDsByDistrictId
(
$district_id
,
$agent_level
);
$agent_res
=
$this
->
getAgentIDsByDistrictId
(
$district_id
,
$agent_level
,
0
);
$conditions
[
'agent_id'
]
=
array
(
"in"
,
$agent_res
[
'agent_ids'
]
);
// 本月-业绩
############################## 本月数据 ###############################################
$start_time
=
date
(
"Y-m-01"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
time
());
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$conditions
,
1
);
//1表示业绩 2表示实收
$result
[
"performance_for_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
// 业绩
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNumV3
(
$conditions
,
1
);
//1表示业绩 2表示实收
$result
[
"district_month_performance"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
// 实收
$real_performanceSum
=
$this
->
partialCommission
->
getReceived
(
$conditions
);
$result
[
"district_month_real_performance"
]
=
isset
(
$real_performanceSum
[
0
][
"num"
])
?
$real_performanceSum
[
0
][
"num"
]
:
0
;
// 本月-成交单数
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNumV2
(
$conditions
,
3
);
//1表示业绩 2表示实收
$result
[
"
bargain_sum_for_month
"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$result
[
"
district_month_bargain_sum
"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
//人数
$agent_res
=
$this
->
getAgentIDsByDistrictId
(
$district_id
,
$agent_level
,
1
);
$result
[
"district_team_num"
]
=
$agent_res
[
'store_list_num'
];
return
$result
;
}
...
...
@@ -965,9 +960,10 @@ class StatementService
* 查询门店或者区域下所有经纪人id
* @param $district_or_store_id
* @param $type
* @return string
* @param int $agent_list_type
* @return mixed
*/
public
function
getAgentIDsByDistrictId
(
$district_or_store_id
,
$type
)
public
function
getAgentIDsByDistrictId
(
$district_or_store_id
,
$type
,
$agent_list_type
=
0
)
{
//查询总监下面门店的所有经纪人
$params
=
[];
...
...
@@ -976,12 +972,18 @@ class StatementService
}
else
{
$params
[
"district_id"
]
=
$district_or_store_id
;
}
$params
[
"status"
]
=
0
;
//只查询正常状态的经纪人
if
(
$agent_list_type
==
0
){
//业绩统计 需要包括 0正常 1长假 2离职
$params
[
"status"
]
=
array
(
'in'
,
'0,1,2'
);
}
else
{
//员工列表只显示 0正常
$params
[
"status"
]
=
0
;
}
$agentModel
=
new
AAgents
();
$agentsArr
=
$agentModel
->
getAgentsByStoreId
(
$params
);
$agent_total
=
count
(
$agentsArr
);
if
(
$agent_total
>
0
)
{
$agentIds
=
""
;
if
(
$agent_total
>
0
)
{
foreach
(
$agentsArr
as
$key1
=>
$value1
)
{
$agentIds
.=
$value1
[
"id"
]
.
","
;
}
...
...
application/chat/validate/ChatVerifyValidate.php
View file @
2f33d47a
...
...
@@ -19,7 +19,7 @@ class ChatVerifyValidate extends Validate
* $target = $params['target']; //接受人 if target_type 群 者表示群id
* $source = $params['source']; //消息来源 1c端app 2b端app 3其他
* $is_user = $params['is_user']; //发送人是否是会员 0是1经济人
* $type = $params['type']; //消息类型 1文字 2图片 3楼盘 4
经纪人
* $type = $params['type']; //消息类型 1文字 2图片 3楼盘 4
客户 5 办公楼
* $msg_content = $params['msg_content'];
* $from = $params['from']; //消息发送人
* @var array
...
...
@@ -29,7 +29,7 @@ class ChatVerifyValidate extends Validate
'target'
=>
'require'
,
'source'
=>
'require|in:1,2,3'
,
'is_user'
=>
'require|in:0,1'
,
'type'
=>
'require|in:1,2,3,4'
,
'type'
=>
'require|in:1,2,3,4
,5
'
,
'msg_content'
=>
'require'
,
'from'
=>
'require'
,
];
...
...
application/index/controller/Finance.php
View file @
2f33d47a
...
...
@@ -2791,7 +2791,7 @@ class Finance extends Basic
if
(
!
empty
(
$where
))
{
//获取被修改人信息
$m_agent
=
new
AAgents
();
$agent_data
=
$m_agent
->
agentBargain
Office
All
(
'a.id,a.store_id,a.district_id,d.income_time,b.create_time'
,
$where
);
$agent_data
=
$m_agent
->
agentBargainAll
(
'a.id,a.store_id,a.district_id,d.income_time,b.create_time'
,
$where
);
foreach
(
$agent_data
as
$k
=>
$v
)
{
$income_time
=
date
(
'Y-m-d'
,
strtotime
(
$v
[
'income_time'
]));
$create_time
=
date
(
'Y-m-d'
,
strtotime
(
$v
[
'create_time'
]));
...
...
application/index/controller/Member.php
View file @
2f33d47a
...
...
@@ -615,7 +615,7 @@ class Member extends Basic{
}
$s_index_user
=
new
UserService
();
//新增
$add_res
=
$s_index_user
->
addUserBind
(
$this
->
params
[
'user_id'
],
$this
->
params
[
'bind_id'
]);
$add_res
=
$s_index_user
->
addUserBind
(
$this
->
params
[
'user_id'
],
$this
->
params
[
'bind_id'
]
,
$this
->
userId
);
if
(
$add_res
===
true
)
{
return
$this
->
response
(
"200"
,
"绑定成功"
);
}
else
{
...
...
application/index/controller/OfficeFinance.php
View file @
2f33d47a
...
...
@@ -65,7 +65,7 @@ class OfficeFinance extends Basic
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$where
=
[];
//
$where['a.confirm_status'] = 1;
$where
[
'a.confirm_status'
]
=
1
;
$where
[
'a.is_del'
]
=
$select
=
0
;
$where
[
'b.status'
]
=
[
'in'
,
'10,11,13'
];
...
...
application/index/service/OfficeRoomService.php
View file @
2f33d47a
...
...
@@ -698,6 +698,10 @@ class OfficeRoomService
$result
[
'is_collect'
]
=
$this
->
isCollect
(
$result
[
'id'
],
$agent_id
);
//是否可编辑
$result
[
'is_can_edit'
]
=
$this
->
isCanEdit
(
$result
[
'id'
],
$agent_id
);
//微信分享图 原来的随机图
$external_image
=
$this
->
getCarouselImageByOne
(
$result
[
'id'
],
2
);
$result
[
'external_image'
]
=
$external_image
?
$external_image
[
'image_path'
]
:
null
;
return
[
'status'
=>
200
,
'msg'
=>
'success'
,
'data'
=>
$result
];
}
...
...
application/index/service/UserLogService.php
View file @
2f33d47a
...
...
@@ -240,7 +240,7 @@ class UserLogService
if
(
count
(
$result
)
<=
0
)
{
return
[
"code"
=>
101
,
"msg"
=>
"没找到此条用户信息"
];
}
$result
[
'user_name'
]
=
$result
[
'user_name'
]
&&
$result
[
'entrust_type'
]
==
0
?
"
[
{
$result
[
'concrete_industry'
]
}
]
{
$result
[
'user_name'
]
}
"
:
$result
[
'user_name'
];
$result
[
'user_name'
]
=
$result
[
'user_name'
]
&&
$result
[
'entrust_type'
]
==
0
?
"
{
$result
[
'concrete_industry'
]
}
,
{
$result
[
'user_name'
]
}
"
:
$result
[
'user_name'
];
$result
[
'user_pic'
]
=
!
empty
(
$result
[
"user_pic"
])
?
HEADERIMGURL
.
$result
[
"user_pic"
]
:
$result
[
"other_pic"
];
#判断是否纯房东 0:否 1:是
...
...
application/index/service/UserService.php
View file @
2f33d47a
...
...
@@ -714,7 +714,7 @@ class UserService
* @param $bind_id
* @return int
*/
public
function
addUserBind
(
$user_id
,
$bind_id
){
public
function
addUserBind
(
$user_id
,
$bind_id
,
$agent_id
){
if
(
!
$user_id
or
!
$bind_id
){
return
'参数不全'
;
}
...
...
@@ -752,7 +752,8 @@ class UserService
$params_
[
'bind_id'
]
=
$params_bind_id
;
$res
=
$this
->
user
->
updateUsers
(
$params_user_id
,
$params_
);
if
(
$res
==
1
){
$this
->
userDoLog
(
$user_id
,
$params_user_id
,
$params_bind_id
,
1
);
$this
->
userDoLog
(
$params_user_id
,
$params_bind_id
,
$agent_id
,
1
);
$this
->
userDoLog
(
$params_bind_id
,
$params_user_id
,
$agent_id
,
1
);
$redis_service
=
new
RedisCacheService
();
$redis_service
->
userCache
(
$user_id
);
return
true
;
...
...
@@ -761,6 +762,22 @@ class UserService
}
}
/**
* 记录操作日志
* @param $user_id
* @param $remove_bind_id
* @param $agent_id
* @param int $type
*/
private
function
userDoLog
(
$user_id
,
$remove_bind_id
,
$agent_id
,
$type
=
0
)
{
$records
=
new
GOperatingRecords
();
$remark
=
'与ID: '
.
$remove_bind_id
.
'解除绑定关系'
;
if
(
$type
==
1
){
$remark
=
'与ID: '
.
$remove_bind_id
.
'添加绑定'
;
}
$records
->
record
(
$agent_id
,
8
,
$remark
,
''
,
$user_id
);
}
/**
* 解除绑定关系
* @param $now_user_id //当前详情页客户
...
...
@@ -805,6 +822,9 @@ class UserService
return
0
;
}
/**
* 客户绑定详情
* @param $user_id
...
...
@@ -831,21 +851,6 @@ class UserService
return
$user_info_list
;
}
/**
* 记录操作日志
* @param $id
* @param $remove_bind_id
* @param $agent_id
*/
private
function
userDoLog
(
$id
,
$remove_bind_id
,
$agent_id
,
$type
=
0
)
{
$records
=
new
GOperatingRecords
();
$remark
=
'与ID: '
.
$remove_bind_id
.
'解除绑定关系'
;
if
(
$type
==
1
){
$remark
=
'与ID: '
.
$remove_bind_id
.
'添加绑定'
;
}
$records
->
record
(
$agent_id
,
8
,
$remark
,
''
,
$id
);
}
/**
...
...
application/model/OBargainModel.php
View file @
2f33d47a
...
...
@@ -640,7 +640,7 @@ class OBargainModel extends Model
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"c.income_time"
]
=
$params
[
"create_time"
];
}
$where_
[
"a.status"
]
=
array
(
"in"
,
"10,11,13"
);
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
...
...
@@ -825,6 +825,45 @@ class OBargainModel extends Model
->
select
();
return
$return
;
}
public
function
getAddBargainNumV3
(
$params
,
$type
)
{
$where_
=
[];
$field
=
""
;
$join
=
[];
if
(
$type
==
1
)
{
$field
=
"sum(scale_fee) as num"
;
$where_
[
"a.status"
]
=
array
(
"in"
,
'10,11,13'
);
}
elseif
(
$type
==
2
)
{
$field
=
"sum(practical_fee) as num"
;
}
elseif
(
$type
==
3
)
{
$field
=
"count(1) as num"
;
$where_
[
"a.role"
]
=
3
;
//必须是反签方1
$where_
[
"a.status"
]
=
array
(
"in"
,
'10,11,13'
);
}
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$params
[
"house_ids"
]))
{
$where_
[
"b.house_id"
]
=
array
(
"in"
,
$params
[
"house_ids"
]
);
array_push
(
$join
,
[
' o_order b'
,
'a.order_id = b.id'
,
'left'
]);
}
$return
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
$join
)
->
where
(
$where_
)
->
select
();
return
$return
;
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
...
...
@@ -1367,7 +1406,6 @@ class OBargainModel extends Model
->
field
(
$filed
)
->
alias
(
"a"
)
->
join
(
"o_partial_commission b"
,
"a.id = b.bargain_id"
,
"left"
)
->
join
(
"o_real_income c"
,
"b.real_income_id = c.id"
,
"left"
)
->
where
(
$where_
)
->
whereOr
(
$whereOr_
)
->
order
(
"a.id asc"
)
...
...
@@ -1453,8 +1491,8 @@ class OBargainModel extends Model
->
join
(
"o_order Oorder"
,
"Obargain.order_id = Oorder.id"
,
"left"
)
->
join
(
"g_houses Houses"
,
"Oorder.house_id = Houses.id"
,
"left"
)
->
join
(
"a_agents Agent"
,
"Obargain.agent_id = Agent.id"
,
"left"
)
// ->join('a_store Store', 'Agent.store_id = Store.id', 'left')
// ->join('a_district District', 'Agent.district_id = District.id', 'left')
// ->join('a_store Store', 'Agent.store_id = Store.id', 'left')
// ->join('a_district District', 'Agent.district_id = District.id', 'left')
->
join
(
'o_partial_commission PartialCommission'
,
'PartialCommission.bargain_id = Obargain.id'
,
'left'
)
->
where
(
$where
)
->
order
(
"Obargain.create_time desc"
)
...
...
@@ -1474,8 +1512,8 @@ class OBargainModel extends Model
->
join
(
"o_order Oorder"
,
"Obargain.order_id = Oorder.id"
,
"left"
)
->
join
(
"g_houses Houses"
,
"Oorder.house_id = Houses.id"
,
"left"
)
->
join
(
"a_agents Agent"
,
"Obargain.agent_id = Agent.id"
,
"left"
)
// ->join('a_store Store', 'Agent.store_id = Store.id', 'left')
// ->join('a_district District', 'Agent.district_id = District.id', 'left')
// ->join('a_store Store', 'Agent.store_id = Store.id', 'left')
// ->join('a_district District', 'Agent.district_id = District.id', 'left')
->
join
(
'o_partial_commission PartialCommission'
,
'PartialCommission.bargain_id = Obargain.id'
,
'left'
)
->
where
(
$where
)
->
order
(
"Obargain.create_time desc"
)
...
...
@@ -1493,8 +1531,8 @@ class OBargainModel extends Model
->
join
(
"o_order Oorder"
,
"Obargain.order_id = Oorder.id"
,
"left"
)
->
join
(
"g_houses Houses"
,
"Oorder.house_id = Houses.id"
,
"left"
)
->
join
(
"a_agents Agent"
,
"Obargain.agent_id = Agent.id"
,
"left"
)
// ->join('a_store Store', 'Agent.store_id = Store.id', 'left')
// ->join('a_district District', 'Agent.district_id = District.id', 'left')
// ->join('a_store Store', 'Agent.store_id = Store.id', 'left')
// ->join('a_district District', 'Agent.district_id = District.id', 'left')
->
join
(
'o_partial_commission PartialCommission'
,
'PartialCommission.bargain_id = Obargain.id'
,
'left'
)
->
where
(
$where
)
->
order
(
"Obargain.create_time desc"
)
...
...
@@ -1517,8 +1555,8 @@ class OBargainModel extends Model
->
join
(
"o_order Oorder"
,
"Obargain.order_id = Oorder.id"
,
"left"
)
->
join
(
"g_houses Houses"
,
"Oorder.house_id = Houses.id"
,
"left"
)
->
join
(
"a_agents Agent"
,
"Obargain.agent_id = Agent.id"
,
"left"
)
// ->join('a_store Store', 'Agent.store_id = Store.id', 'left')
// ->join('a_district District', 'Agent.district_id = District.id', 'left')
// ->join('a_store Store', 'Agent.store_id = Store.id', 'left')
// ->join('a_district District', 'Agent.district_id = District.id', 'left')
->
join
(
'o_partial_commission PartialCommission'
,
'PartialCommission.bargain_id = Obargain.id'
,
'left'
)
->
where
(
$where
)
...
...
@@ -1588,7 +1626,7 @@ class OBargainModel extends Model
//$where_["trade_type"] = 10;//产品要求统计数量必须是出租类型的180620
$params
[
"a.role"
]
=
3
;
//必须是反签方
$params
[
'c.shop_type'
]
=
$type
==
0
?
0
:
1
;
// dump($params);
// dump($params);
$return
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
...
...
@@ -1632,24 +1670,6 @@ class OBargainModel extends Model
->
select
();
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
agentBargainIncome
(
$field
,
$where
)
{
return
$this
->
db_
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'a_agents b'
,
'a.agent_id = b.id'
,
'left'
)
->
join
(
'office_o_partial_commission c'
,
'a.id = c.bargain_id'
,
'left'
)
->
join
(
'office_o_real_income d'
,
'c.real_income_id = d.id'
,
'left'
)
->
where
(
$where
)
->
select
();
}
/**
* @param $field
* @param $where
...
...
application/model/OPartialCommission.php
View file @
2f33d47a
...
...
@@ -42,6 +42,7 @@ class OPartialCommission extends BaseModel
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
big_log
(
$this
->
getLastSql
());
$m_agent
=
new
AAgents
();
$fields_str
=
'a.id,a.name,a.phone,b.store_name'
;
foreach
(
$data
as
$k
=>
$v
)
{
...
...
application/model/ORealIncome.php
View file @
2f33d47a
...
...
@@ -147,7 +147,7 @@ class ORealIncome extends BaseModel
$params
[
'a.is_del'
]
=
0
;
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'o
ffice_o
_partial_commission b'
,
'a.id = b.real_income_id'
,
'left'
)
->
join
(
'o_partial_commission b'
,
'a.id = b.real_income_id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agent_id = c.id'
,
'left'
)
->
where
(
$params
)
->
select
();
...
...
public/resource/js/inspectionRecordAllOffice.js
View file @
2f33d47a
...
...
@@ -191,11 +191,11 @@ define(['doT', 'text!temp/inspectionRecordAllOffice_list_template_tpl.html', 'cs
$
(
"#is_show_store"
).
hide
();
}
if
(
!
check_auth
(
'index/inspectionRecordDistrict/2'
))
{
if
(
!
check_auth
(
'
office_
index/inspectionRecordDistrict/2'
))
{
$
(
"#is_show_district"
).
hide
();
}
if
(
!
check_auth
(
'index/inspectionRecordAll/3'
))
{
if
(
!
check_auth
(
'
office_
index/inspectionRecordAll/3'
))
{
$
(
"#is_show_all"
).
hide
();
}
$
(
"#our"
).
click
(
function
()
{
...
...
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