Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
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
chenchuanwen
my-yaf-project
Commits
b7d7ae96
Commit
b7d7ae96
authored
Dec 17, 2018
by
christ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refudn
parent
fdd7deb3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
RefundService.php
application/models/Business/Order/RefundService.php
+0
-1
OrderGoods.php
application/models/DAO/Order/OrderGoods.php
+11
-7
No files found.
application/models/Business/Order/RefundService.php
View file @
b7d7ae96
...
...
@@ -1022,7 +1022,6 @@ class RefundServiceModel extends \Business\AbstractModel
// $shippingFee == ApiConst::zero;
// }
$orderGoodsConvert
=
$orderGoodsDao
->
getRefundOrderGoods
(
$orderGoods
);
$returnData
=
array
(
'orderId'
=>
(
int
)
$orderId
,
'orderSn'
=>
$orderInfo
[
'orderSn'
],
...
...
application/models/DAO/Order/OrderGoods.php
View file @
b7d7ae96
...
...
@@ -230,14 +230,18 @@ class OrderGoodsModel extends \DAO\AbstractModel
);
}
public
function
getMustReduceAmount
(
$orderGoodses
,
$discountAmount
,
$
o
rderGoods
)
public
function
getMustReduceAmount
(
$orderGoodses
,
$discountAmount
,
$
convertO
rderGoods
)
{
$allNumbers
=
array_column
(
$orderGoodses
,
'goodsNum'
);
$allNumbers
=
array_sum
(
$allNumbers
);
$allGoodsPrice
=
array_column
(
$orderGoodses
,
'goodsPrice'
);
$allGoodsPrice
=
array_sum
(
$allGoodsPrice
);
$allMoney
=
$allNumbers
*
$allGoodsPrice
;
$thisOrderGoodsAmount
=
$orderGoods
[
'goodsNum'
]
*
$orderGoods
[
'goodsPrice'
];
$allMoney
=
0
;
foreach
(
$orderGoodses
as
&
$orderGoods
){
$allMoney
+=
$orderGoods
[
'goodsNum'
]
*
$orderGoods
[
'goodsPrice'
];
}
// $allNumbers = array_column($orderGoodses, 'goodsNum');
// $allNumbers=array_sum($allNumbers);
// $allGoodsPrice = array_column($orderGoodses, 'goodsPrice');
// $allGoodsPrice=array_sum($allGoodsPrice);
// $allMoney = $allNumbers * $allGoodsPrice;
$thisOrderGoodsAmount
=
$convertOrderGoods
[
'goodsNum'
]
*
$convertOrderGoods
[
'goodsPrice'
];
$reduceAmount
=
(
$discountAmount
*
$thisOrderGoodsAmount
)
/
(
$allMoney
);
return
round
(
$reduceAmount
);
...
...
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