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
be6cd077
Commit
be6cd077
authored
Dec 14, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into lyz
parents
43dac90f
90bda454
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
213 additions
and
141 deletions
+213
-141
RefundService.php
application/models/Business/Order/RefundService.php
+32
-11
OrderGoods.php
application/models/DAO/Order/OrderGoods.php
+178
-128
Store.php
application/models/DAO/Store.php
+2
-1
StoreGoodsClassGoods.php
application/models/DAO/StoreGoodsClassGoods.php
+1
-1
No files found.
application/models/Business/Order/RefundService.php
View file @
be6cd077
...
...
@@ -14,6 +14,7 @@ use Our\ImageConst;
use
Our\ImageUtil
;
use
Our\NameConst
;
use
Our\OrderConst
;
use
Zend\Validator\File\Count
;
/**
* 店铺service
...
...
@@ -992,6 +993,7 @@ class RefundServiceModel extends \Business\AbstractModel
$orderGoodsDao
=
\DAO\Order\OrderGoodsModel
::
getInstance
();
$orderGoodses
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\RefundReasonRedisModel
::
getInstance
(),
array
(
&
$orderGoodsDao
,
'getOrderGoodsByOrderIds'
),
array
(
$orderInfo
[
'orderId'
],
$this
->
orderGoodsField
),
\Our\ApiConst
::
oneDaySecond
);
$orderGoodses
=
$orderGoodsDao
->
convertOrderGoods
(
$orderGoodses
,
'goodsId'
);
$allOrderGoods
=
$orderGoodses
;
$goodsIds
=
$orderGoodsDao
->
getRefundOrderGoodsIds
(
$orderGoodses
);
$alreadyRefundGoodsIds
=
$goodsIds
;
// $this->store=$storeDao->get($this->order['storeId']);
...
...
@@ -1006,11 +1008,18 @@ class RefundServiceModel extends \Business\AbstractModel
ErrorModel
::
throwException
(
CodeConfigModel
::
notExistOrderGoods
);
}
$shippingFee
=
ApiConst
::
zero
;
if
(
count
(
$orderGoods
)
==
ApiConst
::
one
)
{
$shippingFee
=
$storeDao
->
isFee
(
$orderInfo
[
'storeId'
],
$orderInfo
[
'shippingType'
],
$orderInfo
[
'order_state'
])
?
$orderInfo
[
'shippingFee'
]
:
ApiConst
::
zero
;
}
else
{
$allReadyGoodsCount
=
count
(
$goodsIds
);
$allGoodsCount
=
count
(
$orderGoodses
);
if
(
$allReadyGoodsCount
==
$allGoodsCount
){
$shippingFee
=
$storeDao
->
isFee
(
$orderInfo
[
'storeId'
],
$orderInfo
[
'shippingType'
],
$orderInfo
[
'orderState'
])
?
$orderInfo
[
'shippingFee'
]
:
ApiConst
::
zero
;
}
else
{
$shippingFee
==
ApiConst
::
zero
;
}
// if (count($orderGoods) == ApiConst::one) {
// $shippingFee = $storeDao->isFee($orderInfo['storeId'], $orderInfo['shippingType'], $orderInfo['orderState']) ? $orderInfo['shippingFee'] : ApiConst::zero;
// } else {
// $shippingFee == ApiConst::zero;
// }
$orderGoodsConvert
=
$orderGoodsDao
->
getRefundOrderGoods
(
$orderGoods
);
$returnData
=
array
(
...
...
@@ -1035,6 +1044,10 @@ class RefundServiceModel extends \Business\AbstractModel
// }
//修改后的优惠金额
$discountAmount
=
$orderInfo
[
'originAmount'
]
-
$orderInfo
[
'orderAmount'
];
$mustReduceAmount
=
ApiConst
::
zero
;
if
(
$discountAmount
){
$mustReduceAmount
=
$orderGoodsDao
->
getMustReduceAmount
(
$allOrderGoods
,
$discountAmount
,
$orderGoodsConvert
);
}
if
(
$orderInfo
[
'paymentTime'
])
{
$orderConfirmUtil
=
\Order\OrderConfirmUtil
::
getInstance
();
...
...
@@ -1043,19 +1056,26 @@ class RefundServiceModel extends \Business\AbstractModel
$refundCondition
[
'storeCarts'
][
'storeCarts'
]
=
$cartDao
->
refundGoodsRemove
(
$refundCondition
[
'storeCarts'
][
'storeCarts'
],
$goodsIds
);
if
(
!
empty
(
$refundCondition
[
'storeCarts'
][
'storeCarts'
]))
{
$newTotalPrice
=
$orderConfirmUtil
->
reCalcOrderAmount
(
$refundCondition
[
'coupon'
],
$refundCondition
[
'storeCarts'
][
'storeCarts'
]);
$refundAmount
=
$orderInfo
[
'orderAmount'
]
-
$
orderInfo
[
'shippingFee'
]
-
$
newTotalPrice
;
$refundAmount
=
$orderInfo
[
'orderAmount'
]
-
$newTotalPrice
;
}
else
{
$refundAmount
=
$orderInfo
[
'orderAmount'
]
-
$orderInfo
[
'shippingFee'
]
-
ApiConst
::
zero
;;
$refundAmount
=
$orderInfo
[
'orderAmount'
]
-
ApiConst
::
zero
;;
}
}
if
(
!
$alreadyRefundGoodsIds
){
$refundAmount
=
$refundAmount
-
$discountAmount
;
}
// if(!$alreadyRefundGoodsIds){
// $refundAmount=$refundAmount-$discountAmount;
// }
}
else
{
$refundAmount
=
$orderGoods
[
'goodsPrice'
]
*
$orderGoods
[
'goodsNum'
];
if
(
!
$alreadyRefundGoodsIds
){
$refundAmount
=
$refundAmount
-
$discountAmount
;
// if(!$alreadyRefundGoodsIds){
// $refundAmount=$refundAmount-$discountAmount;
// }
}
$refundAmount
=
$refundAmount
-
$mustReduceAmount
;
if
(
$orderInfo
[
'shippingType'
]
==
ApiConst
::
bySeller
){
if
(
!
$shippingFee
){
$refundAmount
=
$refundAmount
+
$orderInfo
[
'shippingFee'
];
}
}
$liveMoney
=
$orderInfo
[
'orderAmount'
]
-
$orderInfo
[
'refundAmount'
];
...
...
@@ -1063,10 +1083,11 @@ class RefundServiceModel extends \Business\AbstractModel
$refundAmount
=
$liveMoney
;
}
// $returnData['refundAmount'] = $refundAmount - $orderInfo['refundAmount'] - $returnData['needShippingFee'] + $shippingFee;
$returnData
[
'refundAmount'
]
=
$refundAmount
-
$returnData
[
'needShippingFee'
]
+
$shippingFee
;
$returnData
[
'refundAmount'
]
=
$refundAmount
-
$returnData
[
'needShippingFee'
];
if
((
int
)
$returnData
[
'refundAmount'
]
<
ApiConst
::
zero
){
$returnData
[
'refundAmount'
]
=
ApiConst
::
zero
;
}
// if($orderGoods['goodsType']==ApiConst::goodsTypeFour){
// //已经退款过的金额
// $alreadyRefundMoney=$orderGoodsDao->getIsRefundMoney($orderGoodses,$orderGoods['promotionsId']);
...
...
application/models/DAO/Order/OrderGoods.php
View file @
be6cd077
This diff is collapsed.
Click to expand it.
application/models/DAO/Store.php
View file @
be6cd077
...
...
@@ -208,7 +208,8 @@ class StoreModel extends \DAO\AbstractModel
public
function
isChargeGet
(
$storeId
)
{
$isChargeGet
=
$this
->
getInfoById
(
$storeId
,
'is_charge_get'
);
return
$isChargeGet
>
ApiConst
::
zero
?
TRUE
:
FALSE
;
return
$isChargeGet
[
'is_charge_get'
]
>
ApiConst
::
zero
?
TRUE
:
FALSE
;
}
//线上支付订单已接单待发货退款是否收取服务费(0:否 1:是)
...
...
application/models/DAO/StoreGoodsClassGoods.php
100755 → 100644
View file @
be6cd077
...
...
@@ -27,7 +27,7 @@ class StoreGoodsClassGoodsModel extends \DAO\AbstractModel {
public
function
getList
(
$where
,
$field
,
$order
=
true
){
$this
->
setDb
(
$this
->
dbName
);
if
(
$order
){
return
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
order
(
'gc_sort'
,
'
DE
SC'
)
->
fetchAll
();
return
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
order
(
'gc_sort'
,
'
A
SC'
)
->
fetchAll
();
}
return
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
fetchAll
();
}
...
...
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