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
ab1f0f33
Commit
ab1f0f33
authored
Jun 24, 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
70c2ac6a
a1f4bb89
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
339 additions
and
23 deletions
+339
-23
Statement.php
application/api_broker/controller/Statement.php
+2
-3
StatementService.php
application/api_broker/service/StatementService.php
+21
-18
OfficeFinance.php
application/index/controller/OfficeFinance.php
+139
-0
OfficePerformance.php
application/index/controller/OfficePerformance.php
+167
-0
OfficePerformanceInfo.php
application/index/controller/OfficePerformanceInfo.php
+0
-0
route.php
application/route.php
+10
-2
No files found.
application/api_broker/controller/Statement.php
View file @
ab1f0f33
...
...
@@ -39,7 +39,7 @@ class Statement extends Basic
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
// big_log('日报周报获取新增数据-dayStatement');
// big_log(json_encode($params)
);
big_log
(
$params
);
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"time_start"
])
||
!
isset
(
$params
[
"time_end"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
...
...
@@ -259,8 +259,7 @@ class Statement extends Basic
case
10
:
#业务员
$agent_level
=
0
;
$result
=
$this
->
service_
->
selectStatementForClerk
(
$params
[
"agent_id"
],
$agent_level
,
$store_id
,
$district_id
);
$result
=
$this
->
service_
->
selectStatementForClerk
(
$params
[
"agent_id"
],
$this
->
siteId
);
break
;
case
20
:
#店长
...
...
application/api_broker/service/StatementService.php
View file @
ab1f0f33
...
...
@@ -572,48 +572,51 @@ class StatementService
}
/**
* 查询业务员日报数据
* @param $agent_id
* @param $agent_level
* @param $store_id
* @param $district_id
* @return mixed user 朱伟
* @param $site_id
* @return mixed
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=698
*/
public
function
selectStatementForClerk
(
$agent_id
,
$agent_level
,
$store_id
,
$district_id
)
public
function
selectStatementForClerk
(
$agent_id
,
$site_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
->
getAddUserNumByAgentId
(
$conditions
);
$result
[
"user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentIdV2
(
$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
[
"performance_for_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
// 本月-成交单数
$result
[
"month_performance"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$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
[
"
month_bargain_sum
"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
return
$result
;
}
...
...
application/index/controller/OfficeFinance.php
0 → 100644
View file @
ab1f0f33
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/3/13
* Time: 15:48
*/
namespace
app\index\controller
;
use
app\api\service\ConvertCouponService
;
use
app\api\service\CouponService
;
use
app\api_broker\service\OrderLogService
;
use
app\api_broker\service\PayLogOpenService
;
use
app\api_broker\service\PayLogService
;
use
app\api_broker\service\RedisCacheService
;
use
app\api_broker\service\VipService
;
use
app\index\extend\Basic
;
use
app\index\untils\ExportExcelUntil
;
use
app\model\AAgents
;
use
app\model\AStore
;
use
app\model\GHouses
;
use
app\model\GHousesToAgents
;
use
app\model\OBargainLogModel
;
use
app\model\OBargainModel
;
use
app\model\ODaily
;
use
app\model\OfficeOImg
;
use
app\model\OfficeOPartialCommission
;
use
app\model\OfficeOPayLogModel
;
use
app\model\OImg
;
use
app\model\OMarchInModel
;
use
app\model\OPayLogAdjustment
;
use
app\model\OPayLogOpen
;
use
app\model\OPayLogOpenLog
;
use
app\model\OrderModel
;
use
app\model\ORealIncome
;
use
app\model\ORefundLogModel
;
use
app\model\OReportModel
;
use
app\model\OTaxes
;
use
app\model\OFinancialAudit
;
use
app\model\OPartialCommission
;
use
app\model\OPayLogModel
;
use
app\model\ORefundModel
;
use
app\model\TAgentTotalModel
;
use
app\model\Users
;
use
app\task\controller\ResultsSummaryNewTask
;
use
think\Exception
;
use
think\Request
;
class
OfficeFinance
extends
Basic
{
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
}
/**
* 分佣提成明细表
*
* @return \think\Response|\think\response\View
*/
public
function
partialCommissionList
()
{
$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.is_del'
]
=
$select
=
0
;
$where
[
'b.status'
]
=
[
'in'
,
'10,11,13'
];
if
(
!
empty
(
$this
->
params
[
'create_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$where
[
'f.income_time'
]
=
[
'>= time'
,
$this
->
params
[
'create_time'
]
.
' 00:00:00'
];
$select
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'create_time'
]))
{
$where
[
'f.income_time'
]
=
[
'<= time'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
];
$select
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'create_time'
]))
{
$where
[
'f.income_time'
]
=
[
'between time'
,
[
$this
->
params
[
'create_time'
]
.
' 00:00:00'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
]
];
$select
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'internal_address'
]))
{
$where
[
'd.internal_address'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'internal_address'
]
.
'%'
];
$select
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'partial_id'
]))
{
$where
[
'e.id'
]
=
$this
->
params
[
'partial_id'
];
$select
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'house_number'
]))
{
$where
[
'b.house_number'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'house_number'
]
.
'%'
];
$select
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'bargain_id'
]))
{
$where
[]
=
[
'EXP'
,
'b.id ='
.
$this
->
params
[
'bargain_id'
]
.
' or father_id='
.
$this
->
params
[
'bargain_id'
]
];
$select
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'store_id'
]))
{
$where
[
'e.store_id'
]
=
$this
->
params
[
'store_id'
];
$select
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'district_id'
]))
{
$where
[
'e.district_id'
]
=
$this
->
params
[
'district_id'
];
$select
=
1
;
}
$field
=
'a.id,b.id as bargain_id,f.income_time,a.practical_fee,b.scale_fee,d.internal_address,b.agent_id,'
;
$field
.=
'b.house_number,b.father_id,b.order_id,a.real_income_id,a.role,b.scale'
;
// $m_commission = new OPartialCommission();
$m_Office_commission
=
new
OfficeOPartialCommission
();
try
{
$data
[
'data'
][
'list'
]
=
$m_Office_commission
->
getCommissionBargainList
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$field
,
$where
);
//dump($data['data']['list']);exit;
$data
[
'data'
][
'total'
]
=
$m_Office_commission
->
getCommissionBargainListTotal
(
$where
);
if
(
$select
)
{
$data
[
'data'
][
'total_money'
]
=
$m_Office_commission
->
totalMoney
(
$where
);
//实收总计
}
else
{
$data
[
'data'
][
'total_money'
]
=
''
;
}
}
catch
(
\Exception
$e
)
{
return
$this
->
response
(
101
,
'内部错误,获取分佣提成明细列表失败!请联系运营。'
.
$e
->
getMessage
());
}
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
}
application/index/controller/OfficePerformance.php
0 → 100644
View file @
ab1f0f33
<?php
namespace
app\index\controller
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018/7/31
* Time: 上午10:18
*/
use
app\index\extend\Basic
;
use
app\index\service\PerformanceService
;
use
app\index\untils\ExportExcelUntil
;
use
think\Request
;
use
\think\Session
;
class
OfficePerformance
extends
Basic
{
private
$service_
;
private
$pageSize
;
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
service_
=
new
PerformanceService
();
$this
->
pageSize
=
20
;
}
/**
* 区域业绩排行
*/
public
function
selectDistrictPerformance
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params = array(
"type" => 3, //1表示个人业绩排行 2门店 3区域
"end_day" => "",
"start_day" =>"",
);*/
$checkResult
=
$this
->
validate
(
$params
,
"PerformanceServiceValidate.selectStorePerformance"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
101
,
$checkResult
);
}
$params
[
"type"
]
=
3
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
//默认排序一周 2018-07-18改为本月
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
());
$father_id
=
!
empty
(
$params
[
"father_id"
])
?
$params
[
"father_id"
]
:
''
;
//判断是否是导出EXCEL
$is_excel
=
!
empty
(
$params
[
"is_excel"
])
?
$params
[
"is_excel"
]
:
''
;
if
(
$is_excel
==
1
){
$list
=
$this
->
service_
->
totalAgentExcel
(
$params
[
"type"
],
$end_day
,
$start_day
,
$father_id
,
$params
);
}
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$params
);
//dump($list);
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"total"
]
=
$list
[
'total'
];
$result
[
"performance_total"
]
=
$list
[
'performance_total'
];
$result
[
"start_time"
]
=
$start_day
;
$result
[
"end_time"
]
=
$end_day
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
return
$this
->
response
(
"200"
,
"request null"
);
}
/**
* 门店排行
*/
public
function
selectStorePerformance
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params = array(
"start_day" => '2018-08-08',
"end_day" => '2018-08-08',
);*/
$checkResult
=
$this
->
validate
(
$params
,
"PerformanceServiceValidate.selectStorePerformance"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
101
,
$checkResult
);
}
$params
[
"type"
]
=
2
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
//默认排序一周 2018-07-18改为本月
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
());
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$father_id
=
!
empty
(
$params
[
"father_id"
])
?
$params
[
"father_id"
]
:
''
;
//判断是否是导出EXCEL
$is_excel
=
!
empty
(
$params
[
"is_excel"
])
?
$params
[
"is_excel"
]
:
''
;
if
(
$is_excel
==
1
){
$list
=
$this
->
service_
->
totalAgentExcel
(
$params
[
"type"
],
$end_day
,
$start_day
,
$father_id
,
$params
);
}
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$params
);
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"total"
]
=
$list
[
'total'
];
$result
[
"performance_total"
]
=
$list
[
'performance_total'
];
$result
[
"start_time"
]
=
$start_day
;
$result
[
"end_time"
]
=
$end_day
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
return
$this
->
response
(
"200"
,
"request null"
);
}
/**
* 个人业绩排行
*/
public
function
selectIndividualPerformance
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"type" => 1, //1表示个人业绩排行 2门店 3区域
"end_day" => "",
"start_day" => "",
);*/
$checkResult
=
$this
->
validate
(
$params
,
"PerformanceServiceValidate.selectStorePerformance"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
101
,
$checkResult
);
}
$params
[
"type"
]
=
1
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
//默认排序一周 2018-07-18改为本月
$end_day
=
!
empty
(
$params
[
"end_day"
])
?
$params
[
"end_day"
]
:
date
(
"Y-m-d"
,
time
());
$start_day
=
!
empty
(
$params
[
"start_day"
])
?
$params
[
"start_day"
]
:
date
(
"Y-m-01"
,
time
());
$father_id
=
!
empty
(
$params
[
"father_id"
])
?
$params
[
"father_id"
]
:
''
;
//判断是否是导出EXCEL
$is_excel
=
!
empty
(
$params
[
"is_excel"
])
?
$params
[
"is_excel"
]
:
''
;
if
(
$is_excel
==
1
){
$list
=
$this
->
service_
->
totalAgentExcel
(
$params
[
"type"
],
$end_day
,
$start_day
,
$father_id
,
$params
);
}
$list
=
$this
->
service_
->
totalAgent
(
$params
[
"type"
],
$end_day
,
$start_day
,
$pageNo
,
$pageSize
,
$father_id
,
$params
);
//dump($list);
if
(
count
(
$list
)
>
0
)
{
$result
[
"list"
]
=
$list
[
'list'
];
$result
[
"total"
]
=
$list
[
'total'
];
$result
[
"performance_total"
]
=
$list
[
'performance_total'
];
$result
[
"start_time"
]
=
$start_day
;
$result
[
"end_time"
]
=
$end_day
;
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
return
$this
->
response
(
"200"
,
"request null"
);
}
}
\ No newline at end of file
application/index/controller/OfficePerformanceInfo.php
0 → 100644
View file @
ab1f0f33
This diff is collapsed.
Click to expand it.
application/route.php
View file @
ab1f0f33
...
...
@@ -1103,6 +1103,12 @@ Route::group('office_index', [
'backOutToOne'
=>
[
'index/OfficeBargain/backOutToOne'
,
[
'method'
=>
'POST'
]],
//财务 成交报告-撤销成交报告
'recoveryBargain'
=>
[
'index/OfficeBargain/recoveryBargain'
,
[
'method'
=>
'POST'
]],
//撤销列表-恢复成交报告
'partialCommissionList'
=>
[
'index/OfficeFinance/partialCommissionList'
,
[
'method'
=>
'get'
]],
//分佣提成明细表
'performanceInfo'
=>
[
'index/OfficePerformanceInfo/performanceInfo'
,
[
'method'
=>
'GET|POST'
]
],
//业绩明细办公楼
'selectDistrictPerformance'
=>
[
'index/OfficePerformance/selectDistrictPerformance'
,
[
'method'
=>
'GET|POST'
]
],
//区域业绩排行
'selectStorePerformance'
=>
[
'index/OfficePerformance/selectStorePerformance'
,
[
'method'
=>
'GET|POST'
]
],
//门店排行
'selectIndividualPerformance'
=>
[
'index/OfficePerformance/selectIndividualPerformance'
,
[
'method'
=>
'GET|POST'
]
],
//个人业绩排行
]);
Route
::
group
(
'office_api'
,
[
...
...
@@ -1113,4 +1119,7 @@ Route::group('office_api', [
'getOfficeBuildingInfo'
=>
[
'api/OfficeBuilding/getOfficeBuildingInfo'
,
[
'method'
=>
'GET|POST'
]],
//办公楼详情
]);
//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
//Route::miss('api/index/miss');//处理错误的url
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