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
8562be52
Commit
8562be52
authored
Dec 06, 2018
by
christ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage
parent
090325dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
ApiConst.php
application/library/Our/ApiConst.php
+1
-1
RefundService.php
application/models/Business/Order/RefundService.php
+37
-3
No files found.
application/library/Our/ApiConst.php
View file @
8562be52
...
@@ -192,7 +192,7 @@ class ApiConst
...
@@ -192,7 +192,7 @@ class ApiConst
const
goodsStateWaitRecieve
=
2
;
const
goodsStateWaitRecieve
=
2
;
const
goodsStateUnRecieve
=
3
;
const
goodsStateUnRecieve
=
3
;
const
goodsStateRecieved
=
4
;
const
goodsStateRecieved
=
4
;
const
refundStateProccess
=
1
;
const
refundStateComplete
=
3
;
const
refundStateComplete
=
3
;
//是否退款成功
//是否退款成功
const
refundSuccess
=
1
;
const
refundSuccess
=
1
;
...
...
application/models/Business/Order/RefundService.php
View file @
8562be52
...
@@ -234,7 +234,7 @@ class RefundServiceModel extends \Business\AbstractModel
...
@@ -234,7 +234,7 @@ class RefundServiceModel extends \Business\AbstractModel
}
}
$orderDao
->
setDb
(
DbNameConst
::
masterDBConnectName
);
$orderDao
->
setDb
(
DbNameConst
::
masterDBConnectName
);
$orderDao
->
db
->
doTransaction
();
$orderDao
->
db
->
doTransaction
();
$order_info
=
$orderDao
->
findByOrderId
(
$return
[
'order_id'
]
,
$orderDao
->
getOrderDetailField
()
);
$order_info
=
$orderDao
->
findByOrderId
(
$return
[
'order_id'
]);
$refund_array
=
array
();
$refund_array
=
array
();
$refund_array
[
'seller_time'
]
=
TIMESTAMP
;
$refund_array
[
'seller_time'
]
=
TIMESTAMP
;
$refund_array
[
'seller_state'
]
=
$sellerState
;
//卖家处理状态:1为待审核,2为同意,3为不同意
$refund_array
[
'seller_state'
]
=
$sellerState
;
//卖家处理状态:1为待审核,2为同意,3为不同意
...
@@ -259,7 +259,7 @@ class RefundServiceModel extends \Business\AbstractModel
...
@@ -259,7 +259,7 @@ class RefundServiceModel extends \Business\AbstractModel
ErrorModel
::
throwException
(
CodeConfigModel
::
updateIsRefundFail
);
ErrorModel
::
throwException
(
CodeConfigModel
::
updateIsRefundFail
);
}
}
$push
=
\Our\Push
::
getInstance
();
$push
=
\Our\Push
::
getInstance
();
$pushData
=
array
(
'storeId'
=>
$order_info
[
'store
I
d'
],
$pushData
=
array
(
'storeId'
=>
$order_info
[
'store
_i
d'
],
'type'
=>
ApiConst
::
messageRefund
,
'type'
=>
ApiConst
::
messageRefund
,
'waitReceiveCount'
=>
ApiConst
::
zero
,
'waitReceiveCount'
=>
ApiConst
::
zero
,
'waitDeliveryCount'
=>
ApiConst
::
zero
,
'waitDeliveryCount'
=>
ApiConst
::
zero
,
...
@@ -297,6 +297,40 @@ class RefundServiceModel extends \Business\AbstractModel
...
@@ -297,6 +297,40 @@ class RefundServiceModel extends \Business\AbstractModel
$refund_array
[
'seller_state'
]
=
'2'
;
$refund_array
[
'seller_state'
]
=
'2'
;
$refund_array
[
'refund_state'
]
=
ApiConst
::
refundStateComplete
;
$refund_array
[
'refund_state'
]
=
ApiConst
::
refundStateComplete
;
$refund_array
[
'return_type'
]
=
'1'
;
//选择弃货
$refund_array
[
'return_type'
]
=
'1'
;
//选择弃货
$storeDao
=
\DAO\StoreModel
::
getInstance
();
$is_direct_refund
=
$storeDao
->
getInfoById
(
$storeId
,
'is_direct_refund'
,
'is_direct_refund'
);
if
(
$is_direct_refund
==
ApiConst
::
one
){
$payment_type
=
$order_info
[
'payment_type'
];
if
(
!
in_array
(
$payment_type
,
array
(
0
,
2
))){
$state
=
$refundReturnDao
->
storeRefund
(
array_merge
(
$order_info
,
array
(
'refund_order_no'
=>
$order_info
[
'order_sn'
],
'refund_amount'
=>
$refundAmount
)));
if
(
!
$state
)
{
//throw new Exception('更新订单信息失败');
$orderDao
->
db
->
doRollback
();
return
false
;
}
if
(
$payment_type
==
1
)
{
//微信支付
$updateData
=
array
(
'is_suc_refund'
=>
1
,
'gmt_update'
=>
TIMESTAMP
,
'seller_state'
=>
$refund_array
[
'seller_state'
],
'refund_state'
=>
$refund_array
[
'refund_state'
]);
}
else
{
$updateData
=
array
(
'is_suc_refund'
=>
1
,
'gmt_update'
=>
TIMESTAMP
);
}
$res
=
$refundReturnDao
->
update
(
array
(
'refund_id'
=>
$returnDetail
[
'refund_id'
]),
$updateData
);
if
(
!
$res
){
$refundReturnDao
->
db
->
doRollback
();
// showDialog('退款成功,退款表写入失败,请联系工作人员!',$reload,'error');
return
false
;
}
$result
=
$orderGoodsDao
->
update
(
array
(
'rec_id'
=>
$returnDetail
[
'order_goods_id'
]),
array
(
'is_refund'
=>
1
,
'gmt_update'
=>
TIMESTAMP
));
if
(
!
$result
){
$refundReturnDao
->
db
->
doRollback
();
// showDialog('refund_state_name',$reload,'error');
return
false
;
}
}
else
{
if
(
!
in_array
(
$payment_type
,
array
(
0
,
2
))){
$refund_array
[
'refund_state'
]
=
ApiConst
::
refundStateProccess
;
}
}
}
}
}
$refund_array
[
'refund_amount'
]
=
$refundAmount
;
$refund_array
[
'refund_amount'
]
=
$refundAmount
;
$state
=
$refundReturnDao
->
update
(
$condition
,
$refund_array
);
$state
=
$refundReturnDao
->
update
(
$condition
,
$refund_array
);
...
@@ -305,7 +339,7 @@ class RefundServiceModel extends \Business\AbstractModel
...
@@ -305,7 +339,7 @@ class RefundServiceModel extends \Business\AbstractModel
$sellerLogDao
->
record
(
'退货处理,退货编号:'
.
$return
[
'refund_sn'
]);
$sellerLogDao
->
record
(
'退货处理,退货编号:'
.
$return
[
'refund_sn'
]);
$orderDao
->
db
->
doCommit
();
$orderDao
->
db
->
doCommit
();
$push
=
\Our\Push
::
getInstance
();
$push
=
\Our\Push
::
getInstance
();
$pushData
=
array
(
'storeId'
=>
$order_info
[
'store
I
d'
],
$pushData
=
array
(
'storeId'
=>
$order_info
[
'store
_i
d'
],
'type'
=>
ApiConst
::
messageRefund
,
'type'
=>
ApiConst
::
messageRefund
,
'waitReceiveCount'
=>
ApiConst
::
zero
,
'waitReceiveCount'
=>
ApiConst
::
zero
,
'waitDeliveryCount'
=>
ApiConst
::
zero
,
'waitDeliveryCount'
=>
ApiConst
::
zero
,
...
...
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