|
|
@@ -83,7 +83,7 @@ class CgRefundController extends BaseController
|
|
|
if ($cg->status == PurchaseClass::STATUS_CANCEL) {
|
|
|
util::fail("订单已取消,不能申请售后");
|
|
|
}
|
|
|
- if (isset($cg->clearId) && !empty($cg->clearId)) {
|
|
|
+ if (!empty($cg->clearId)) {
|
|
|
util::fail('订单已结,不能再申请售后');
|
|
|
}
|
|
|
$payTime = $cg->payTime;
|
|
|
@@ -98,13 +98,26 @@ class CgRefundController extends BaseController
|
|
|
util::fail('超时订单,请联系门店售后');
|
|
|
}
|
|
|
}
|
|
|
+ //退款类型 1退货并退款 2 仅退款
|
|
|
+ $refundType = $post['refundType'] ?? 1;
|
|
|
+ if ($ghsShop->refundOnlyPrice == 0) {
|
|
|
+ //不支持仅退款申请
|
|
|
+ if ($refundType == 2) {
|
|
|
+ util::fail('只能选 退货并退款');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $imgList = $post['imgList'] ?? '';
|
|
|
+ if ($ghsShop->refundMustImg == 1) {
|
|
|
+ if(empty($imgList)) {
|
|
|
+ util::fail('必须按规范提供照片');
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
$connection = Yii::$app->db;
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
try {
|
|
|
|
|
|
- //退款类型 1退货并退款 2 仅退款
|
|
|
- $refundType = $post['refundType'] ?? 1;
|
|
|
+
|
|
|
if ($refundType == CgRefundClass::REFUND_TYPE_MONEY_GOOD) {
|
|
|
//花材列表结构
|
|
|
// [{productId:0,num:1,unitType:0,unitPrice:12,unitName:'扎'}] productId 花材id num 退货数 unitType 大小单位0大1小 unitPrice 售价 unitName单位名称
|