Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jwhx
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
jwhx
Commits
ef6dc563
Commit
ef6dc563
authored
Jul 08, 2025
by
wuxiaoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商家支付收仓库手续费
parent
52690032
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
modules/Store/app/Listeners/PayBlance.php
modules/Store/app/Listeners/PayBlance.php
+47
-1
modules/Store/app/Services/PaymentService.php
modules/Store/app/Services/PaymentService.php
+3
-1
No files found.
modules/Store/app/Listeners/PayBlance.php
View file @
ef6dc563
...
...
@@ -8,6 +8,8 @@
// +----------------------------------------------------------------------
namespace
Modules\Store\Listeners
;
use
Illuminate\Support\Facades\Log
;
use
Modules\Member\Services\PolymerService
;
use
Modules\Store\Events\PaySuccess
;
use
Illuminate\Contracts\Queue\ShouldQueue
;
use
Illuminate\Queue\InteractsWithQueue
;
...
...
@@ -24,6 +26,50 @@ class PayBlance implements ShouldQueue{
$order
=
$event
->
payment
;
$store
=
$order
->
store
()
->
first
();
//Log::info("分仓服务费".$store->balance_service_rate);
if
(
$store
->
balance_service_rate
>
0
){
//分仓服务费
$integral
=
$order
->
integral
;
//店主收入计算
$polymer_money
=
$order
->
polymer_money
;
//店主收入计算
//本金
$cost_money
=
bcdiv
((
$order
->
polymer_money
+
$order
->
amount
),
bcdiv
((
$store
->
balance_service_rate
+
100
),
100
,
2
),
2
);
//Log::info("分仓服务费本金".$cost_money);
//分仓服务费
$balance_service_amount
=
bcsub
((
$order
->
polymer_money
+
$order
->
amount
),
$cost_money
,
2
);
$amount
=
bcsub
(
$order
->
amount
,
$balance_service_amount
,
2
);
//店主收入计算
if
(
$balance_service_amount
>
0
&&
$store
->
service_id
){
//Log::info("分仓服务费资金".$balance_service_amount);
app
(
AccountService
::
class
)
->
createAccount
(
store_id
:
$store
->
id
,
order_id
:
$order
->
id
,
member_id
:
$store
->
service_id
,
type
:
'service_income'
,
account_type
:
'payment'
,
amount
:
$balance_service_amount
,
remark
:
'店铺收款分仓服务费'
);
}
}
else
{
$amount
=
$order
->
amount
;
//店主收入计算
$integral
=
$order
->
integral
;
//店主收入计算
$polymer_money
=
$order
->
polymer_money
;
//店主收入计算
}
//店主收入
if
(
$amount
>
0
){
app
(
AccountService
::
class
)
->
createAccount
(
store_id
:
$order
->
store_id
,
order_id
:
$order
->
id
,
member_id
:
$store
->
member_id
,
type
:
'income'
,
account_type
:
'payment'
,
amount
:
$amount
,
remark
:
'店铺内客户支付'
);
}
if
(
$integral
>
0
){
app
(
ScoreService
::
class
)
->
createScore
(
store_id
:
$store
->
id
,
order_id
:
$order
->
id
,
member_id
:
$store
->
member_id
,
amount
:
$integral
,
type
:
'income'
,
account_type
:
'payment'
,
remark
:
'店铺内客户支付'
);
}
if
(
$polymer_money
>
0
){
app
(
PolymerService
::
class
)
->
createPolymer
(
store_id
:
$store
->
id
,
order_id
:
$order
->
id
,
member_id
:
$store
->
member_id
,
type
:
'income'
,
account_type
:
'payment'
,
amount
:
$polymer_money
,
remark
:
'店铺内客户支付'
);
}
}
/**原始
* Handle the event.
*/
/*public function handle(PaySuccess $event){
$order = $event->payment;
$store = $order->store()->first();
if($store->invite_uid > 0){
$invite = Member::with(['level'])->where('uid', $store->invite_uid)->first();
...
...
@@ -83,5 +129,5 @@ class PayBlance implements ShouldQueue{
if($order->integral > 0){
app(ScoreService::class)->createScore(store_id: $store->id, order_id: $order->id, member_id: $store->member_id, amount: $integral, type: 'income', account_type: 'payment', remark: '店铺内客户支付');
}
}
}
*/
}
\ No newline at end of file
modules/Store/app/Services/PaymentService.php
View file @
ef6dc563
...
...
@@ -115,7 +115,6 @@ class PaymentService {
if
(
$payment
->
polymer_money
>
0
){
//扣除聚物通资金
app
(
\Modules\Member\Services\PolymerService
::
class
)
->
createPolymer
(
store_id
:
$payment
->
store_id
,
order_id
:
$payment
->
id
,
member_id
:
$payment
->
member
[
'uid'
],
type
:
'pay'
,
account_type
:
'payment'
,
amount
:
$payment
->
polymer_money
,
remark
:
'店铺支付'
);
app
(
\Modules\Member\Services\PolymerService
::
class
)
->
createPolymer
(
store_id
:
$payment
->
store_id
,
order_id
:
$payment
->
id
,
member_id
:
$payment
->
store
[
'member_id'
],
type
:
'income'
,
account_type
:
'payment'
,
amount
:
$payment
->
polymer_money
,
remark
:
'店铺内客户支付'
);
}
$res
=
app
(
\Modules\Wechat\Services\PayService
::
class
)
->
orderQuery
(
$order_no
);
...
...
@@ -131,6 +130,9 @@ class PaymentService {
$payment
->
payment_status
=
1
;
$payment
->
payment_time
=
date
(
'Y-m-d H:i:s'
);
$payment
->
save
();
if
(
$payment
->
polymer_money
>
0
)
{
//入账聚物通资金
app
(
\Modules\Member\Services\PolymerService
::
class
)
->
createPolymer
(
store_id
:
$payment
->
store_id
,
order_id
:
$payment
->
id
,
member_id
:
$payment
->
store
[
'member_id'
],
type
:
'income'
,
account_type
:
'payment'
,
amount
:
$payment
->
polymer_money
,
remark
:
'店铺内客户支付'
);
}
}
}
}
...
...
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