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
b418a909
Commit
b418a909
authored
Dec 26, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整计算
parent
899fd130
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
Finance.php
application/index/controller/Finance.php
+3
-3
OPayLogAdjustment.php
application/model/OPayLogAdjustment.php
+13
-0
No files found.
application/index/controller/Finance.php
View file @
b418a909
...
@@ -3506,13 +3506,13 @@ class Finance extends Basic
...
@@ -3506,13 +3506,13 @@ class Finance extends Basic
* @return float|int|string
* @return float|int|string
*/
*/
private
function
sumPayLogPriceByType
(
int
$type
,
int
$is_adjustment
=
0
)
{
private
function
sumPayLogPriceByType
(
int
$type
,
int
$is_adjustment
=
0
)
{
$m_pay
=
new
OPayLogModel
();
if
(
$is_adjustment
)
{
if
(
$is_adjustment
)
{
$m_pay_adjustment
=
new
OPayLogAdjustment
();
$where
[
'b.type'
]
=
$type
;
$where
[
'b.type'
]
=
$type
;
$where
[
'source'
]
=
2
;
$where
[
'source'
]
=
2
;
$price
=
$m_pay
->
sumAdjustment
(
'b
.money'
,
$where
,
$is_adjustment
);
$price
=
$m_pay
_adjustment
->
sumMoney
(
'a
.money'
,
$where
,
$is_adjustment
);
}
else
{
}
else
{
$m_pay
=
new
OPayLogModel
();
$where
[
'type'
]
=
$type
;
$where
[
'type'
]
=
$type
;
$price
=
$m_pay
->
sumAdjustment
(
'real_money'
,
$where
,
$is_adjustment
);
$price
=
$m_pay
->
sumAdjustment
(
'real_money'
,
$where
,
$is_adjustment
);
}
}
...
...
application/model/OPayLogAdjustment.php
View file @
b418a909
...
@@ -172,4 +172,16 @@ class OPayLogAdjustment extends BaseModel{
...
@@ -172,4 +172,16 @@ class OPayLogAdjustment extends BaseModel{
return
0
;
return
0
;
}
}
}
}
/**
* @param $field
* @param $where
* @return float|int
*/
public
function
sumMoney
(
$field
,
$where
)
{
return
$this
->
db_
->
alias
(
'a'
)
->
join
(
'o_paylog b'
,
'a.new_paylog_id=b.id'
)
->
where
(
$where
)
->
sum
(
$field
);
}
}
}
\ 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