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
c7cb00c9
Commit
c7cb00c9
authored
Jan 30, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整
parent
be3c7da5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
3 deletions
+46
-3
PayLogService.php
application/api_broker/service/PayLogService.php
+22
-3
Finance.php
application/index/controller/Finance.php
+5
-0
OPayLogModel.php
application/model/OPayLogModel.php
+19
-0
No files found.
application/api_broker/service/PayLogService.php
View file @
c7cb00c9
...
...
@@ -323,18 +323,36 @@ class PayLogService
return
false
;
}
$pay_id
=
$this
->
payLogModel
->
getField
Value
(
'id'
,
[
'bargain_id'
=>
$bargain_id
]);
$pay_id
=
$this
->
payLogModel
->
getField
Column
(
'id'
,
[
'bargain_id'
=>
$bargain_id
]);
if
(
empty
(
$pay_id
))
{
return
false
;
}
$money
=
$this
->
payLogModel
->
getSum
(
'money'
,
[
'id'
=>
$pay_id
]);
$money
=
$this
->
payLogModel
->
getSum
(
'money'
,
[
'id'
=>
[
'in'
,
$pay_id
]
]);
if
(
$money
>
0
)
{
$refund_money
=
$this
->
oRefundModel
->
getRefundSum
(
'refund_money'
,
[
'pay_log_id'
=>
$pay_id
]);
$refund_money
=
$this
->
oRefundModel
->
getRefundSum
(
'refund_money'
,
[
'pay_log_id'
=>
[
'in'
,
$pay_id
]
]);
$result
=
$money
-
$refund_money
;
}
else
{
$result
=
0
;
}
return
$result
;
}
/**
* @param $bargain_id
* @return bool
*/
public
function
checkPayLogAdjustment
(
$bargain_id
)
{
if
(
empty
(
$bargain_id
))
{
return
false
;
}
$result
=
false
;
$pay_id
=
$this
->
payLogModel
->
getFieldColumn
(
'id'
,
[
'bargain_id'
=>
$bargain_id
]);
$id
=
$this
->
payLogAdjustmentModel
->
getFieldValue
(
'id'
,
[
'paylog_id'
=>
[
'in'
,
$pay_id
]]);
if
(
$id
>
0
)
{
$result
=
true
;
}
return
$result
;
}
}
\ No newline at end of file
application/index/controller/Finance.php
View file @
c7cb00c9
...
...
@@ -2288,6 +2288,11 @@ class Finance extends Basic
return
$this
->
response
(
101
,
'存在收款或退款,不能撤销!'
);
}
$is_adjustment
=
$service_pay
->
checkPayLogAdjustment
(
$this
->
params
[
'bargain_id'
]);
if
(
$is_adjustment
)
{
return
$this
->
response
(
101
,
'收款存在调整,不能撤销!'
);
}
$check
=
$this
->
updatePerformanceAll
(
$this
->
params
[
'bargain_id'
]);
if
(
$check
[
'status'
]
==
'fail'
)
{
return
$this
->
response
(
101
,
'更新个人业绩失败,请重试!'
);
...
...
application/model/OPayLogModel.php
View file @
c7cb00c9
...
...
@@ -563,9 +563,28 @@ class OPayLogModel extends Model
}
public
function
getCount
(
$where
)
{
if
(
!
isset
(
$params
[
'is_del'
]))
{
$params
[
'is_del'
]
=
0
;
}
return
$this
->
db_
->
where
(
$where
)
->
count
(
'id'
);
}
/**
* @param $where
* @return array
*/
public
function
getFieldColumn
(
$field
,
$where
)
{
if
(
!
isset
(
$params
[
'is_del'
]))
{
$params
[
'is_del'
]
=
0
;
}
return
$this
->
db_
->
where
(
$where
)
->
column
(
$field
);
}
/**
* @param $field
* @param $where
* @return mixed
*/
public
function
getFieldValue
(
$field
,
$where
)
{
if
(
!
isset
(
$params
[
'is_del'
]))
{
$params
[
'is_del'
]
=
0
;
...
...
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