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
ebcef3c2
Commit
ebcef3c2
authored
Jun 21, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
3169c190
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
168 additions
and
23 deletions
+168
-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
route.php
application/route.php
+6
-2
No files found.
application/api_broker/controller/Statement.php
View file @
ebcef3c2
...
...
@@ -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 @
ebcef3c2
...
...
@@ -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 @
ebcef3c2
<?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/route.php
View file @
ebcef3c2
...
...
@@ -1103,6 +1103,8 @@ Route::group('office_index', [
'backOutToOne'
=>
[
'index/OfficeBargain/backOutToOne'
,
[
'method'
=>
'POST'
]],
//财务 成交报告-撤销成交报告
'recoveryBargain'
=>
[
'index/OfficeBargain/recoveryBargain'
,
[
'method'
=>
'POST'
]],
//撤销列表-恢复成交报告
'partialCommissionList'
=>
[
'index/OfficeFinance/partialCommissionList'
,
[
'method'
=>
'get'
]],
//分佣提成明细表
]);
Route
::
group
(
'office_api'
,
[
...
...
@@ -1113,4 +1115,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