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
0104eae5
Commit
0104eae5
authored
Dec 26, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
计算
parent
498360d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
20 deletions
+26
-20
Finance.php
application/index/controller/Finance.php
+10
-6
OPayLogAdjustment.php
application/model/OPayLogAdjustment.php
+1
-1
OPayLogModel.php
application/model/OPayLogModel.php
+15
-13
No files found.
application/index/controller/Finance.php
View file @
0104eae5
...
...
@@ -3443,8 +3443,9 @@ class Finance extends Basic
$custody_fee
=
$this
->
sumPayLogPriceByType
(
6
,
1
);
//保管金转保管金
//保管金调整:保管金转保管金+保管金转中介费+保管金转案场费
$data
[
'custody_adjustment'
]
=
$agent_fee
+
$case_fee
+
$custody_fee
;
//保管金调整
$data
[
'custody_refund'
]
=
0
;
//保管金转定
//意向金入账-意向金调整-意向金退款
$data
[
'custody_refund'
]
=
$this
->
sumPayLogRefundByType
(
3
,
0
,
0
);
//保管金转定
$data
[
'custody_refund'
]
+=
$this
->
sumPayLogRefundByType
(
2
,
0
,
0
);
//保管金转定
//意向金入账-意向金调整-意向金退款
$data
[
'total_custody_recorded'
]
=
$data
[
'custody_recorded'
]
-
$data
[
'custody_adjustment'
]
-
$data
[
'custody_refund'
];
//账上保管金
//待处理款项总计:未开业佣金+账上意向金+账上保管金
...
...
@@ -3508,15 +3509,18 @@ class Finance extends Basic
private
function
sumPayLogPriceByType
(
int
$type
,
int
$is_adjustment
=
0
)
{
if
(
$is_adjustment
)
{
$m_pay_adjustment
=
new
OPayLogAdjustment
();
$where
[
'b.type'
]
=
$type
;
$where
[
'source'
]
=
2
;
$where
[
'a.type'
]
=
$type
;
$where
[
'b.source'
]
=
2
;
$where
[
'a.is_del'
]
=
0
;
$where
[
'b.is_del'
]
=
0
;
$price
=
$m_pay_adjustment
->
sumMoney
(
'a.money'
,
$where
,
$is_adjustment
);
}
else
{
$m_pay
=
new
OPayLogModel
();
$where
[
'type'
]
=
$type
;
$price
=
$m_pay
->
sumAdjustment
(
'real_money'
,
$where
,
$is_adjustment
);
$where
[
'is_del'
]
=
0
;
$price
=
$m_pay
->
sumPayLog
(
'real_money'
,
$where
);
}
return
empty
(
$price
)
?
''
:
$price
;
return
$price
;
}
/**
...
...
application/model/OPayLogAdjustment.php
View file @
0104eae5
...
...
@@ -180,7 +180,7 @@ class OPayLogAdjustment extends BaseModel{
*/
public
function
sumMoney
(
$field
,
$where
)
{
return
$this
->
db_
->
alias
(
'a'
)
->
join
(
'o_paylog b'
,
'a.new_paylog_id=b.id'
)
->
join
(
'o_paylog b'
,
'a.new_paylog_id=b.id'
,
'left'
)
->
where
(
$where
)
->
sum
(
$field
);
}
...
...
application/model/OPayLogModel.php
View file @
0104eae5
...
...
@@ -531,7 +531,7 @@ class OPayLogModel extends Model
*/
public
function
sumBargainPrice
(
$field
,
$where
)
{
return
$this
->
db_
->
alias
(
'a'
)
->
join
(
'o_bargain b'
,
'a.order_id=b.order_id'
)
->
join
(
'o_bargain b'
,
'a.order_id=b.order_id'
,
'left'
)
->
where
(
$where
)
->
sum
(
$field
);
}
...
...
@@ -539,20 +539,21 @@ class OPayLogModel extends Model
/**
* @param string $field
* @param array $where
* @param int $type 1 调整前 0调整后
* @return float|int|string
*/
public
function
sumAdjustment
(
string
$field
,
array
$where
,
int
$type
=
1
)
{
if
(
$type
)
{
$field
=
$this
->
db_
->
alias
(
'a'
)
->
join
(
'o_paylog_adjustment b'
,
'a.id=b.paylog_id'
)
->
where
(
$where
)
->
sum
(
$field
);
}
else
{
$field
=
$this
->
db_
->
where
(
$where
)
->
sum
(
$field
);
}
public
function
sumPayLogAdjustment
(
string
$field
,
array
$where
)
{
return
$this
->
db_
->
alias
(
'a'
)
->
join
(
'o_paylog_adjustment b'
,
'a.id=b.paylog_id'
,
'left'
)
->
where
(
$where
)
->
sum
(
$field
);
}
return
$field
;
/**
* @param string $field
* @param array $where
* @return float|int
*/
public
function
sumPayLog
(
string
$field
,
array
$where
)
{
return
$this
->
db_
->
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