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
c7abd980
Commit
c7abd980
authored
Aug 31, 2021
by
wanjilong
Browse files
Options
Browse Files
Download
Plain Diff
add: merge master to branch
parents
42722c7a
d03c6b68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
0 deletions
+80
-0
PayOrderClearingItem.php
application/models/order/mysql/PayOrderClearingItem.php
+57
-0
Account.php
application/modules/Pay/controllers/Account.php
+22
-0
php.ini
deploy/start_env/ini/php.ini
+1
-0
No files found.
application/models/order/mysql/PayOrderClearingItem.php
View file @
c7abd980
...
...
@@ -2,9 +2,66 @@
namespace
App\Models\order\mysql
;
use
Api\PhpUtils\Mysql\MysqlBase
;
use
App\Exception\BaseException
;
class
PayOrderClearingItem
extends
MysqlBase
{
const
TABLE_NAME
=
'pay_order_clearing_item'
;
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 "
;
/*
$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
not exists (select 1 from refund_order ro where ro.`order_item_id` = poci.`order_item_id`) and
poci.pay_sub_type = 105 and poci.account_id = ?
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 @
c7abd980
<?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
]);
}
}
deploy/start_env/ini/php.ini
View file @
c7abd980
...
...
@@ -1888,6 +1888,7 @@ opcache.huge_code_pages=1
;openssl.capath=
[apcu]
apc.enable_cli
=
1
apc.shm_size
=
1024M
apc.slam_defense
=
1
apc.serializer
=
igbinary
...
...
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