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
61a8ef93
Commit
61a8ef93
authored
Jul 15, 2021
by
万继龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'test'
add: 修复守护程序,增加处理工具 See merge request bp/pay!16
parents
98d04de9
744c36fd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
4 deletions
+35
-4
Callback.php
application/modules/Pay/controllers/Callback.php
+29
-0
PayService.php
application/services/pay/PayService.php
+3
-2
Wallet.php
daemon/Wallet.php
+3
-2
No files found.
application/modules/Pay/controllers/Callback.php
View file @
61a8ef93
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
use
App\Base\Base
;
use
App\Base\Base
;
use
App\Models\order\mysql\PayOrderItem
;
use
App\Services\pay\PayService
;
use
App\Services\pay\PayService
;
use
App\Services\refund\RefundService
;
use
App\Services\refund\RefundService
;
use
App\Models\order\mysql\CallbackLog
;
use
App\Models\order\mysql\CallbackLog
;
...
@@ -64,4 +65,32 @@ class CallbackController extends Base
...
@@ -64,4 +65,32 @@ class CallbackController extends Base
$ret
=
$refundSrv
->
call_back
(
$data
);
$ret
=
$refundSrv
->
call_back
(
$data
);
$this
->
success
([
'result'
=>
$ret
]);
$this
->
success
([
'result'
=>
$ret
]);
}
}
public
function
daemonAction
()
{
$params
=
$this
->
params
;
$date
=
$params
[
'date'
]
??
date
(
'Y-m-d'
);
$timestamp
=
strtotime
(
$date
);
$start
=
date
(
'Y-m-d'
,
$timestamp
);
$end
=
date
(
'Y-m-d'
,
$timestamp
+
86400
);
$where
[
'can_notify_account'
]
=
1
;
$where
[
'notify_account_times[<]'
]
=
5
;
$where
[
'can_notify_account_time[<>]'
]
=
[
$start
,
$end
];
$where
[
'ORDER'
]
=
[
'can_notify_account_time'
=>
'ASC'
];
$where
[
'LIMIT'
]
=
[
0
,
100
];
$list
=
PayOrderItem
::
selectMaster
(
'*'
,
$where
);
$payService
=
new
PayService
();
foreach
(
$list
as
$row
)
{
$payService
->
sync_account_wallet
(
$row
[
'order_item_id'
]);
}
$step
=
empty
(
$list
)
?
120
:
5
;
$this
->
success
([
'result'
=>
$list
,
'step'
=>
$step
]);
}
}
}
application/services/pay/PayService.php
View file @
61a8ef93
...
@@ -53,11 +53,12 @@ class PayService
...
@@ -53,11 +53,12 @@ class PayService
'app_id'
=>
'merchant-c'
,
'app_id'
=>
'merchant-c'
,
'environ'
=>
Application
::
app
()
->
environ
(),
'environ'
=>
Application
::
app
()
->
environ
(),
'order_id'
=>
$order_id
,
'order_id'
=>
$order_id
,
'goods
_sku_id
'
=>
[],
'goods'
=>
[],
'order_item_id'
=>
[],
'order_item_id'
=>
[],
];
];
foreach
(
$data
[
'result'
][
'order_item_list'
]
as
$item
)
{
foreach
(
$data
[
'result'
][
'order_item_list'
]
as
$item
)
{
array_push
(
$metadata
[
'goods_sku_id'
],
$item
[
'goods_sku_id'
]);
$metadata
[
'goods'
][
$item
[
'goods_sku_id'
]]
=
$item
[
'goods_num'
];
array_push
(
$metadata
[
'order_item_id'
],
$item
[
'order_item_id'
]);
array_push
(
$metadata
[
'order_item_id'
],
$item
[
'order_item_id'
]);
}
}
...
...
daemon/Wallet.php
View file @
61a8ef93
...
@@ -15,11 +15,12 @@ class Wallet implements DaemonServiceInterface
...
@@ -15,11 +15,12 @@ class Wallet implements DaemonServiceInterface
{
{
$where
[
'can_notify_account'
]
=
1
;
$where
[
'can_notify_account'
]
=
1
;
$where
[
'notify_account_times[<]'
]
=
5
;
$where
[
'notify_account_times[<]'
]
=
5
;
$where
[
'can_notify_account_time[>]'
]
=
time
()
-
86400
;
$where
[
'can_notify_account_time[>]'
]
=
date
(
'Y-m-d'
,
time
()
-
3
*
86400
)
;
$where
[
'ORDER'
]
=
'can_notify_account_time ASC'
;
$where
[
'ORDER'
]
=
[
'can_notify_account_time'
=>
'ASC'
]
;
$where
[
'LIMIT'
]
=
[
0
,
50
];
$where
[
'LIMIT'
]
=
[
0
,
50
];
$list
=
PayOrderItem
::
selectMaster
(
'*'
,
$where
);
$list
=
PayOrderItem
::
selectMaster
(
'*'
,
$where
);
$payService
=
new
PayService
();
$payService
=
new
PayService
();
foreach
(
$list
as
$row
)
{
foreach
(
$list
as
$row
)
{
$payService
->
sync_account_wallet
(
$row
[
'order_item_id'
]);
$payService
->
sync_account_wallet
(
$row
[
'order_item_id'
]);
...
...
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