|
|
@@ -13,6 +13,7 @@ use app\common\model\goods\Goods;
|
|
|
use app\common\model\master_worker\MasterWorker;
|
|
|
use app\common\model\orders\RechargeOrder;
|
|
|
use app\common\model\recharge\OrderGoods;
|
|
|
+use app\common\model\refund\RefundRecord;
|
|
|
use app\common\model\spare_part\SparePart;
|
|
|
use app\common\model\works\ServiceWork;
|
|
|
use app\common\model\works\ServiceWorkSpare;
|
|
|
@@ -418,6 +419,7 @@ class ServiceOrderLogic extends BaseLogic
|
|
|
|
|
|
if($v['refund_status']==1){
|
|
|
$order_refund_amount += $v['order_amount'];
|
|
|
+ $refund_status = RefundRecord::where('order_id',$v['order_id'])->value('refund_status');
|
|
|
}
|
|
|
|
|
|
if($v['payment_type']!=1 and !empty($order_info['service_work']['spare_total'])){
|
|
|
@@ -434,6 +436,22 @@ class ServiceOrderLogic extends BaseLogic
|
|
|
//退款汇总
|
|
|
$order_info['refund_amount'] = $order_refund_amount;
|
|
|
|
|
|
+ if(isset($refund_status)){
|
|
|
+ switch ($refund_status){
|
|
|
+ case 0:
|
|
|
+ $order_info['refund_status'] = '退款中';
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ $order_info['refund_status'] = '退款成功';
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ $order_info['refund_status'] = '退款失败';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $order_info['refund_status'] = '未退款';
|
|
|
+ }
|
|
|
+
|
|
|
// 所有配件
|
|
|
$order_info['spare_total'] = $order_info['service_work']['spare_total']??0;
|
|
|
$order_info['spare_parts'] = [];
|
|
|
@@ -502,6 +520,7 @@ class ServiceOrderLogic extends BaseLogic
|
|
|
$v['pay_way_name'] = $pay_way_data[$v['pay_way']];
|
|
|
if($v['refund_status']==1){
|
|
|
$order_refund_amount += $v['order_amount'];
|
|
|
+ $refund_status = RefundRecord::where('order_id',$v['order_id'])->value('refund_status');
|
|
|
}
|
|
|
if($v['payment_type']!=1 and !empty($order_info['service_work']['spare_total'])){
|
|
|
$v['order_total'] = $v['order_total'] - $order_info['service_work']['spare_total'];
|
|
|
@@ -515,6 +534,21 @@ class ServiceOrderLogic extends BaseLogic
|
|
|
$order_info['coupon_price'] = $coupon_price;
|
|
|
//退款汇总
|
|
|
$order_info['refund_amount'] = $order_refund_amount;
|
|
|
+ if(isset($refund_status)){
|
|
|
+ switch ($refund_status){
|
|
|
+ case 0:
|
|
|
+ $order_info['refund_status'] = '退款中';
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ $order_info['refund_status'] = '退款成功';
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ $order_info['refund_status'] = '退款失败';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $order_info['refund_status'] = '未退款';
|
|
|
+ }
|
|
|
// 所有配件
|
|
|
$order_info['spare_total'] = $order_info['service_work']['spare_total']??0;
|
|
|
$order_info['spare_parts'] = [];
|