Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
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
刘小敏
loveisland
Commits
3764f365
Commit
3764f365
authored
May 20, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成订单时增加成本价到order_item表
parent
9b164bb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
OrderCreate.php
addons/shopro/service/order/OrderCreate.php
+1
-0
No files found.
addons/shopro/service/order/OrderCreate.php
View file @
3764f365
...
@@ -1289,6 +1289,7 @@ class OrderCreate
...
@@ -1289,6 +1289,7 @@ class OrderCreate
$orderItem
->
goods_price
=
$current_sku_price
->
price
;
$orderItem
->
goods_price
=
$current_sku_price
->
price
;
$orderItem
->
goods_num
=
$buyInfo
[
'goods_num'
]
??
1
;
$orderItem
->
goods_num
=
$buyInfo
[
'goods_num'
]
??
1
;
$orderItem
->
goods_weight
=
$current_sku_price
->
weight
;
$orderItem
->
goods_weight
=
$current_sku_price
->
weight
;
$orderItem
->
cost_price
=
isset
(
$current_sku_price
[
'cost_price'
])
?
$current_sku_price
[
'cost_price'
]
:
0
;
$orderItem
->
discount_fee
=
bcadd
(
bcadd
(
$buyInfo
[
'promo_discount_fee'
],
$buyInfo
[
'coupon_discount_fee'
],
2
),
$buyInfo
[
'dispatch_discount_fee'
],
2
);
// 当前商品所享受的折扣 (promo_discount_fee + coupon_discount_fee + dispatch_discount_fee)
$orderItem
->
discount_fee
=
bcadd
(
bcadd
(
$buyInfo
[
'promo_discount_fee'
],
$buyInfo
[
'coupon_discount_fee'
],
2
),
$buyInfo
[
'dispatch_discount_fee'
],
2
);
// 当前商品所享受的折扣 (promo_discount_fee + coupon_discount_fee + dispatch_discount_fee)
$pay_fee
=
bcsub
(
$buyInfo
[
'goods_amount'
],
bcadd
(
$buyInfo
[
'promo_discount_fee'
],
$buyInfo
[
'coupon_discount_fee'
],
2
),
2
);
// 商品总金额(不算运费),减去(活动优惠(不包含包邮优惠) + 优惠券优惠)
$pay_fee
=
bcsub
(
$buyInfo
[
'goods_amount'
],
bcadd
(
$buyInfo
[
'promo_discount_fee'
],
$buyInfo
[
'coupon_discount_fee'
],
2
),
2
);
// 商品总金额(不算运费),减去(活动优惠(不包含包邮优惠) + 优惠券优惠)
...
...
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