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
1d33eaca
Commit
1d33eaca
authored
May 30, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
计算实收
parent
bb386f6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
29 deletions
+34
-29
StatementService.php
application/api_broker/service/StatementService.php
+3
-1
OBargainModel.php
application/model/OBargainModel.php
+0
-28
OPartialCommission.php
application/model/OPartialCommission.php
+31
-0
No files found.
application/api_broker/service/StatementService.php
View file @
1d33eaca
...
@@ -8,6 +8,7 @@ use app\model\GHouses;
...
@@ -8,6 +8,7 @@ use app\model\GHouses;
use
app\model\GHousesToAgents
;
use
app\model\GHousesToAgents
;
use
app\model\OBargainModel
;
use
app\model\OBargainModel
;
use
app\model\OMarchInModel
;
use
app\model\OMarchInModel
;
use
app\model\OPartialCommission
;
use
app\model\OReportModel
;
use
app\model\OReportModel
;
use
app\model\Users
;
use
app\model\Users
;
...
@@ -178,7 +179,8 @@ class StatementService
...
@@ -178,7 +179,8 @@ class StatementService
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$result
[
"performance_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$result
[
"performance_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$real_performanceSum
=
$this
->
bargainModel
->
getReceivedV2
(
$where_
);
$m_partial
=
new
OPartialCommission
();
$real_performanceSum
=
$m_partial
->
getReceived
(
$where_
);
$result
[
"real_performance_month"
]
=
isset
(
$real_performanceSum
[
0
][
"num"
])
?
$real_performanceSum
[
0
][
"num"
]
:
0
;
$result
[
"real_performance_month"
]
=
isset
(
$real_performanceSum
[
0
][
"num"
])
?
$real_performanceSum
[
0
][
"num"
]
:
0
;
//本周业绩
//本周业绩
...
...
application/model/OBargainModel.php
View file @
1d33eaca
...
@@ -855,35 +855,7 @@ class OBargainModel extends Model
...
@@ -855,35 +855,7 @@ class OBargainModel extends Model
}
}
/**
* 计算实收
* @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
;
}
/**
/**
* @param $page_no
* @param $page_no
...
...
application/model/OPartialCommission.php
View file @
1d33eaca
...
@@ -503,4 +503,34 @@ class OPartialCommission extends BaseModel
...
@@ -503,4 +503,34 @@ class OPartialCommission extends BaseModel
->
order
(
$order
)
->
order
(
$order
)
->
select
();
->
select
();
}
}
/**
* 计算实收
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getReceived
(
$params
)
{
$where_
=
[];
$field
=
"sum(a.practical_fee) as num"
;
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"b.income_time "
]
=
$params
[
"create_time"
];
}
$where_
[
"a.is_del"
]
=
0
;
$where_
[
"a.confirm_status"
]
=
1
;
// $where_["a.status"] = array( "in", '10,11,13');
$date
=
$this
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_real_income b"
,
"a.real_income_id = b.id"
,
"left"
)
->
where
(
$where_
)
->
select
();
return
$date
;
}
}
}
\ No newline at end of file
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