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
9370ad6d
Commit
9370ad6d
authored
May 29, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
计算实收
parent
adfaf76a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
StatementService.php
application/api_broker/service/StatementService.php
+1
-1
OBargainModel.php
application/model/OBargainModel.php
+30
-1
No files found.
application/api_broker/service/StatementService.php
View file @
9370ad6d
...
...
@@ -178,7 +178,7 @@ class StatementService
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$result
[
"performance_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$real_performanceSum
=
$this
->
bargainModel
->
getReceived
(
$where_
);
$real_performanceSum
=
$this
->
bargainModel
->
getReceived
V2
(
$where_
);
$result
[
"real_performance_month"
]
=
isset
(
$real_performanceSum
[
0
][
"num"
])
?
$real_performanceSum
[
0
][
"num"
]
:
0
;
//本周业绩
...
...
application/model/OBargainModel.php
View file @
9370ad6d
...
...
@@ -851,7 +851,36 @@ class OBargainModel extends Model
->
join
(
"o_partial_commission b"
,
"a.id=b.bargain_id"
,
"right"
)
->
where
(
$where_
)
->
select
();
//echo $this->getLastSql();
return
$date
;
}
/**
* 计算实收
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getReceivedV2
(
$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.confirm_date"
]
=
$params
[
"create_time"
];
}
$where_
[
"b.is_del"
]
=
0
;
$where_
[
"b.confirm_status"
]
=
1
;
$where_
[
"a.status"
]
=
array
(
"in"
,
'10,11,13'
);
$date
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_partial_commission b"
,
"a.id=b.bargain_id"
,
"right"
)
->
where
(
$where_
)
->
select
();
return
$date
;
}
...
...
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