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
f42dc8dc
Commit
f42dc8dc
authored
Dec 17, 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
28a3530f
5c9eac71
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
10 deletions
+27
-10
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+1
-1
RefundService.php
application/models/Business/Order/RefundService.php
+24
-9
CodeConfig.php
application/models/Error/CodeConfig.php
+2
-0
No files found.
application/models/Business/Goods/GoodsCommonService.php
View file @
f42dc8dc
...
...
@@ -10,7 +10,7 @@ use Zend\Json\Server\Exception\ErrorException;
class
GoodsCommonServiceModel
extends
\Business\AbstractModel
{
private
$goodsStorageField
=
'goods_id goodsId,goods_name goodsName,goods_verify goodsVerify,goods_state goodsState,goods_image goodsImage,goods_price goodsPrice,goods_storage goodsStorage,goods_spec goodsAttr'
;
private
$goodsStorageField
=
'goods_id goodsId,goods_name goodsName,goods_verify goodsVerify,goods_state goodsState,goods_image goodsImage,goods_price goodsPrice,goods_storage goodsStorage,goods_spec goodsAttr
,goods_storage_alarm as goodsStorageAlarm
'
;
private
$setStorageType
=
array
(
'add'
=>
1
,
'set'
=>
2
);
public
function
init
()
{
...
...
application/models/Business/Order/RefundService.php
View file @
f42dc8dc
...
...
@@ -241,7 +241,7 @@ class RefundServiceModel extends \Business\AbstractModel
* 退货审核页
*
*/
public
function
returnGoods
(
$storeId
,
$refundId
,
$sellerState
,
$refundAmount
,
$sellerMessage
,
$isGiveUp
=
ApiConst
::
zero
)
{
public
function
returnGoods
(
$storeId
,
$refundId
,
$sellerState
,
$refundAmount
,
$sellerMessage
,
$
orderAlreadyRefundAmount
,
$
isGiveUp
=
ApiConst
::
zero
)
{
$refundReturnDao
=
\DAO\Order\RefundReturnModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$orderGoodsDao
=
\DAO\Order\OrderGoodsModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
...
...
@@ -260,6 +260,8 @@ class RefundServiceModel extends \Business\AbstractModel
}
$orderDao
->
setDb
(
DbNameConst
::
masterDBConnectName
);
$orderDao
->
db
->
doTransaction
();
$orderData
[
'refund_amount'
]
=
$orderAlreadyRefundAmount
;
$orderDao
->
updateByOrderId
(
$orderData
,
$return
[
'order_id'
]);
$order_info
=
$orderDao
->
findByOrderId
(
$return
[
'order_id'
]);
$refund_array
=
array
();
$refund_array
[
'seller_time'
]
=
TIMESTAMP
;
...
...
@@ -421,8 +423,16 @@ class RefundServiceModel extends \Business\AbstractModel
$whereRefund
[
'store_id'
]
=
$storeId
;
$whereRefund
[
'refund_id'
]
=
$refundId
;
$refund
=
$refundReturnDao
->
find
(
$whereRefund
);
//获取订单
$order_id
=
$refund
[
'order_id'
];
$order_info
=
$orderDao
->
find
(
array
(
'order_id'
=>
$order_id
));
$alreadyRefund
=
$order_info
[
'refund_amount'
]
-
$refund
[
'refund_amount'
];
if
((
$order_info
[
'order_amount'
]
-
$alreadyRefund
)
<
$refundAmount
){
ErrorModel
::
throwException
(
CodeConfigModel
::
beyongRefundAmount
);
}
$orderAlreadyRefundAmount
=
$alreadyRefund
+
$refundAmount
;
if
(
$refund
[
'refund_type'
]
==
ApiConst
::
refundTypeGoods
){
if
(
$this
->
returnGoods
(
$storeId
,
$refundId
,
$seller_state
,
$refundAmount
,
$text
,
$isGiveUp
)){
if
(
$this
->
returnGoods
(
$storeId
,
$refundId
,
$seller_state
,
$refundAmount
,
$text
,
$
orderAlreadyRefundAmount
,
$
isGiveUp
)){
$refundReturnDao
->
deleteRefundCache
(
$refund
[
'buyer_id'
],
$refund
[
'refund_id'
]);
$orderDao
->
deleteOrderCache
(
$refund
[
'buyer_id'
],
$refund
[
'order_id'
],
$refund
[
'store_id'
]);
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$refundReturnDao
,
'getList'
),
array
(),
array
(
$refund
[
'store_id'
]));
...
...
@@ -439,18 +449,18 @@ class RefundServiceModel extends \Business\AbstractModel
ErrorModel
::
throwException
(
CodeConfigModel
::
alreadyExsitRefundGoods
);
}
//获取订单
$order_id
=
$refund
[
'order_id'
];
$order_info
=
$orderDao
->
find
(
array
(
'order_id'
=>
$order_id
));
$orderGoodsDao
=
\DAO\Order\OrderGoodsModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$orderData
[
'refund_amount'
]
=
$refundAmount
;
$orderDao
->
updateByOrderId
(
$orderData
,
$order_id
);
$refund_array
=
array
();
$refund_array
[
'seller_time'
]
=
time
();
$refund_array
[
'seller_state'
]
=
$seller_state
;
//卖家处理状态:1为待审核,2为同意,3为不同意
$refund_array
[
'seller_message'
]
=
$text
;
$refund_array
[
'refund_amount'
]
=
$refundAmount
;
$refundReturnDao
->
db
->
doTransaction
();
$orderData
[
'refund_amount'
]
=
$orderAlreadyRefundAmount
;
$orderDao
->
updateByOrderId
(
$orderData
,
$order_id
);
if
(
$seller_state
!=
2
){
//拒绝退款
$result
=
$orderGoodsDao
->
update
(
array
(
'rec_id'
=>
$refund
[
'order_goods_id'
]),
array
(
'is_refund'
=>
0
,
'refund_state_name'
=>
'卖家拒绝退款'
,
'gmt_update'
=>
TIMESTAMP
));
...
...
@@ -1070,9 +1080,12 @@ class RefundServiceModel extends \Business\AbstractModel
}
if
(
$allReadyGoodsCount
==
ApiConst
::
one
){
$refundAmount
=
$refundAmount
+
$orderInfo
[
'shippingFee'
];
if
(
$shippingFee
&&
(
$orderInfo
[
'shippingType'
]
==
ApiConst
::
bySeller
)
){
if
(
$shippingFee
){
$refundAmount
=
$refundAmount
-
$orderInfo
[
'shippingFee'
];
}
// if($shippingFee && ($orderInfo['shippingType']==ApiConst::bySeller)){
// $refundAmount=$refundAmount-$orderInfo['shippingFee'];
// }
}
//修改后的优惠金额按比例退回
$discountAmount
=
$orderInfo
[
'originAmount'
]
-
$orderInfo
[
'orderAmount'
];
...
...
@@ -1080,7 +1093,9 @@ class RefundServiceModel extends \Business\AbstractModel
if
(
$discountAmount
){
$mustReduceAmount
=
$orderGoodsDao
->
getMustReduceAmount
(
$allOrderGoods
,
$discountAmount
,
$orderGoodsConvert
);
}
$refundAmount
=
$refundAmount
-
$mustReduceAmount
;
if
(
!
$orderInfo
[
'couponId'
]){
$refundAmount
=
$refundAmount
-
$mustReduceAmount
;
}
//配送订单配送费按比例收取
// if($orderInfo['shippingType']==ApiConst::bySeller){
// $mustSheepingFee=ApiConst::zero;
...
...
application/models/Error/CodeConfig.php
View file @
f42dc8dc
...
...
@@ -325,6 +325,7 @@ class CodeConfigModel
const
refundWriteError
=
300143
;
const
beyondRecieverTime
=
300144
;
const
payTypeUpdateError
=
30145
;
const
beyongRefundAmount
=
300146
;
//店铺相关错误码
//商品分类
...
...
@@ -832,6 +833,7 @@ class CodeConfigModel
self
::
refundWriteError
=>
'退款表写入失败'
,
self
::
beyondRecieverTime
=>
'设置收货时间不能早于当前时间'
,
self
::
payTypeUpdateError
=>
'更新支付类型失败'
,
self
::
beyongRefundAmount
=>
'退款金额不能超过可退款金额'
,
//销售员
self
::
emptySaleGoodsId
=>
'商品id不能为空'
,
self
::
emptySaleGoods
=>
'销售商品不存在'
,
...
...
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