Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pay
Project
Project
Details
Activity
Releases
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
bp
pay
Commits
f4803cf1
Commit
f4803cf1
authored
Aug 30, 2021
by
万继龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refund_wanjl_0824' into 'master'
Refund wanjl 0824 See merge request bp/pay!62
parents
d74d4f73
bbb50b3a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
0 deletions
+67
-0
PayOrderClearingItem.php
application/models/order/mysql/PayOrderClearingItem.php
+45
-0
Account.php
application/modules/Pay/controllers/Account.php
+22
-0
No files found.
application/models/order/mysql/PayOrderClearingItem.php
View file @
f4803cf1
...
@@ -7,4 +7,49 @@ class PayOrderClearingItem extends MysqlBase
...
@@ -7,4 +7,49 @@ class PayOrderClearingItem extends MysqlBase
{
{
const
TABLE_NAME
=
'pay_order_clearing_item'
;
const
TABLE_NAME
=
'pay_order_clearing_item'
;
const
CONFIG_INDEX
=
'pay'
;
const
CONFIG_INDEX
=
'pay'
;
public
static
function
marketSaleCount
(
$accountId
)
{
$ret
=
[
'transit_fund'
=>
0
,
'history_fund'
=>
0
,
];
if
(
$accountId
==
0
)
{
return
$ret
;
}
$sql
=
"select sum(poci.`pay_amount`) as 'pay_amount', notify_account_status from pay_order_clearing_item poci
join pay_order_item poi on poi.`order_item_id` = poci.`order_item_id`
where poci.pay_sub_type = 105 and poci.account_id = ? and poi.refund_order_status = 0 group by notify_account_status "
;
/*
type=1: 该团长历史累计分销佣金收入总和
type=2: 该团长当前未结算分销佣金总和
*/
try
{
$medoo
=
self
::
getConnection
(
self
::
READ
);
$medoo
->
pdo
->
setAttribute
(
\PDO
::
ATTR_ERRMODE
,
\PDO
::
ERRMODE_EXCEPTION
);
$sth
=
$medoo
->
pdo
->
prepare
(
$sql
);
$sth
->
execute
([
$accountId
]);
while
(
$row
=
$sth
->
fetch
(
\PDO
::
FETCH_ASSOC
))
{
if
(
$row
[
'notify_account_status'
]
==
2
)
{
$ret
[
'history_fund'
]
+=
$row
[
'pay_amount'
];
}
else
{
$ret
[
'transit_fund'
]
+=
$row
[
'pay_amount'
];
}
}
return
$ret
;
}
catch
(
\PDOException
$e
)
{
throw
new
BaseException
([
'msg'
=>
'数据查询错误:'
.
$e
->
getMessage
(),
'code'
=>
'2401'
]);
}
}
}
}
application/modules/Pay/controllers/Account.php
0 → 100644
View file @
f4803cf1
<?php
use
App\Base\Base
;
use
App\Models\order\mysql\PayOrderClearingItem
;
class
AccountController
extends
Base
{
/**
* @throws \App\Exception\BaseException
* @throws \App\Exception\custom\PayException
*/
public
function
fundAction
()
{
$params
=
$this
->
params
;
$user_id
=
$params
[
'user_id'
];
$payment
=
PayOrderClearingItem
::
marketSaleCount
(
$user_id
);
$this
->
success
([
'result'
=>
$payment
]);
}
}
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