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
5e28c307
Commit
5e28c307
authored
Dec 13, 2018
by
christ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dilivery
parent
565ed0f7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
7 deletions
+21
-7
Common.php
application/library/OSS/Common.php
+1
-1
RefundService.php
application/models/Business/Order/RefundService.php
+19
-5
Shopkeeper.php
application/modules/Client/controllers/Shopkeeper.php
+1
-1
No files found.
application/library/OSS/Common.php
View file @
5e28c307
...
...
@@ -20,7 +20,7 @@ class Common
const
endpointPre
=
SecretKeys
::
ossEndpointPre
;
const
buketPre
=
SecretKeys
::
ossBucket
;
const
buketPre
=
SecretKeys
::
ossBucket
Pre
;
public
static
function
getOssClientOnline
(){
try
{
...
...
application/models/Business/Order/RefundService.php
View file @
5e28c307
...
...
@@ -441,8 +441,9 @@ class RefundServiceModel extends \Business\AbstractModel
//获取订单
$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为不同意
...
...
@@ -1057,7 +1058,12 @@ class RefundServiceModel extends \Business\AbstractModel
$refundAmount
=
$refundAmount
-
$discountAmount
;
}
}
$returnData
[
'refundAmount'
]
=
$refundAmount
-
$orderInfo
[
'refundAmount'
]
-
$returnData
[
'needShippingFee'
]
+
$shippingFee
;
$liveMoney
=
$orderInfo
[
'orderAmount'
]
-
$orderInfo
[
'refundAmount'
];
if
(
$refundAmount
>
$liveMoney
){
$refundAmount
=
$liveMoney
;
}
// $returnData['refundAmount'] = $refundAmount - $orderInfo['refundAmount'] - $returnData['needShippingFee'] + $shippingFee;
$returnData
[
'refundAmount'
]
=
$refundAmount
-
$returnData
[
'needShippingFee'
]
+
$shippingFee
;
if
((
int
)
$returnData
[
'refundAmount'
]
<
ApiConst
::
zero
){
$returnData
[
'refundAmount'
]
=
ApiConst
::
zero
;
}
...
...
@@ -1116,6 +1122,8 @@ class RefundServiceModel extends \Business\AbstractModel
$orderDao
=
\DAO\Order\OrderModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$orderInfo
=
$orderDao
->
findByMemberIdAndOrderId
(
$memberId
,
$refund
[
'orderId'
],
$this
->
orderField
);
$storeDao
=
\DAO\StoreModel
::
getInstance
();
$orderDao
->
setDb
(
DbNameConst
::
masterDBConnectName
);
$orderDao
->
db
->
doTransaction
();
if
(
$refund
[
'refundType'
]
==
ApiConst
::
refundTypeGoods
){
$refund
[
'refundAmount'
]
-=
$orderInfo
[
'needShippingFee'
];
}
...
...
@@ -1192,15 +1200,22 @@ class RefundServiceModel extends \Business\AbstractModel
$refundArray
[
'refund_shipping_type'
]
=
isset
(
$refund
[
'refundShippingType'
])
?
$refund
[
'refundShippingType'
]
:
ApiConst
::
zero
;
$refundArrayUnLine
=
Common
::
convertUnderline
(
$refundArray
);
$state
=
$refundReturnDao
->
addRefundReturn
(
$refundArray
,
$orderInfo
,
$orderGoods
);
$updateOrderData
[
'refund_amount'
]
=
$refundArray
[
'refund_amount'
];
$orderDao
->
deleteOrderCache
(
$memberId
,
$orderInfo
[
'orderId'
],
$orderInfo
[
'storeId'
],
true
);
$storeDao
->
deleteStoreCache
(
$orderInfo
[
'storeId'
],
$orderInfo
[
'orderId'
]);
$storeDao
->
deleteStoreRefundCache
(
$orderInfo
[
'storeId'
],
$orderInfo
[
'orderId'
]);
if
(
$state
)
{
$orderDao
->
update
(
array
(
'order_id'
=>
$orderInfo
[
'orderId'
]),
$updateOrderData
);
$refundStateName
=
$refundReturnDao
->
getRefundTextStatus
(
$refundArrayUnLine
);
$orderGoodsDao
->
update
(
array
(
'rec_id'
=>
$orderGoods
[
'recId'
]),
array
(
'refund_state_name'
=>
$refundStateName
,
'refund_id'
=>
$state
));
$refundReturnDao
->
deleteRefundCache
(
$memberId
);
$storeDao
->
deleteStoreRefundCache
(
$refundOne
[
'storeId'
]);
$orderLogDao
->
addRefundOrderLog
(
$orderInfo
[
'orderId'
],
$refundArray
[
'refund_type'
],
DescribeConst
::
buyer
,
$orderInfo
[
'buyerName'
],
$orderInfo
[
'orderState'
]);
if
(
$orderInfo
[
'orderState'
]
==
ApiConst
::
orderStateWaitRecieve
)
{
$orderDao
->
editOrderLock
(
$orderInfo
[
'orderId'
]);
}
$orderDao
->
db
->
doCommit
();
$push
=
\Our\Push
::
getInstance
();
$pushData
=
array
(
'storeId'
=>
$orderInfo
[
'storeId'
],
'type'
=>
ApiConst
::
messageRefund
,
...
...
@@ -1219,11 +1234,10 @@ class RefundServiceModel extends \Business\AbstractModel
$push
->
sendTcpMessage
();
//\Our\RedisHelper::rpush('client_push',array('storeId'=>$refund['storeId'],'type'=>ApiConst::messageRefundProccessing,'op'=>NameConst::reduce,'num'=>ApiConst::one,'params'=>array('c'=>'shopkeeper','m'=>'getRefundDetail','refundId'=>$refund['refundId'])));
if
(
$orderInfo
[
'orderState'
]
==
ApiConst
::
orderStateWaitRecieve
)
{
$orderDao
->
editOrderLock
(
$orderInfo
[
'orderId'
]);
}
return
$state
;
}
else
{
$orderDao
->
db
->
doRollback
();
ErrorModel
::
throwException
(
CodeConfigModel
::
refundRefuseByStore
);
}
}
...
...
application/modules/Client/controllers/Shopkeeper.php
View file @
5e28c307
...
...
@@ -303,7 +303,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
ErrorModel
::
throwException
(
CodeConfigModel
::
notExistRefund
);
}
$refundService
=
\Business\Order\RefundServiceModel
::
getInstance
();
$goodsState
=
intval
(
$this
->
req
[
'data'
][
'goodsState'
])
;
$goodsState
=
isset
(
$this
->
req
[
'data'
][
'goodsState'
])
?
intval
(
$this
->
req
[
'data'
][
'goodsState'
])
:
\Our\ApiConst
::
goodsStateRecieved
;
$res
=
$refundService
->
receive
(
$this
->
storeId
,
$this
->
sellerId
,
$this
->
sellerName
,
$refundId
,
$goodsState
);
if
(
$res
){
$this
->
success
(
$res
);
...
...
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