فهرست منبع

医生的收益延迟到反馈

lizhen_gitee 10 ماه پیش
والد
کامیت
afa22c0ed7
2فایلهای تغییر یافته به همراه15 افزوده شده و 11 حذف شده
  1. 13 9
      application/api/controller/doctor/Wenzhen.php
  2. 2 2
      application/extra/wallet.php

+ 13 - 9
application/api/controller/doctor/Wenzhen.php

@@ -167,7 +167,7 @@ class Wenzhen extends Apic
         $update = [
             'status' => 18,
             'cancel_time' => $nowtime,
-            'cancel_reason' => '医生退珍',
+            'cancel_reason' => input('cancel_reason','医生主动退珍'),
             'finish_time' => $nowtime,
         ];
         Db::startTrans();
@@ -175,14 +175,6 @@ class Wenzhen extends Apic
         //余额支付的直接退款
         if($wenzhen_order['pay_type'] == 'wallet'){
 
-            //医生退钱
-            $logtype = $wenzhen_order['ordertype'] == 1 ? 113 : 114;
-            $rs_wallet = model('walletdoctor')->lockChangeAccountRemain($this->auth->id,'money',-$wenzhen_order['total_fee'],$logtype,$remark='问诊退珍','wenzhen_order',$order_id);
-            if($rs_wallet['status'] === false){
-                Db::rollback();
-                $this->error($rs_wallet['msg']);
-            }
-
             //用户加钱
             $logtype = $wenzhen_order['ordertype'] == 1 ? 13 : 14;
             $rs_wallet = model('wallet')->lockChangeAccountRemain($wenzhen_order['user_id'],'money',$wenzhen_order['total_fee'],$logtype,$remark='问诊退珍','wenzhen_order',$order_id);
@@ -347,11 +339,23 @@ class Wenzhen extends Apic
             'feedback_images' => input('feedback_images',''),
         ];
 
+        Db::startTrans();
+
+        //医生
+        $logtype = $wenzhen_order['ordertype'] == 1 ? 111 : 112;
+        $rs_wallet = model('walletdoctor')->lockChangeAccountRemain($this->auth->id,'money',$wenzhen_order['total_fee'],$logtype,$remark='问诊订单','wenzhen_order',$order_id);
+        if($rs_wallet['status'] === false){
+            Db::rollback();
+            $this->error($rs_wallet['msg']);
+        }
+
         $update_rs = Db::name('wenzhen_order')->where('id',$order_id)->where('status',30)->update($update);
         if(!$update_rs){
             $this->error('反馈失败');
+            Db::rollback();
         }
 
+        Db::commit();
         $this->success(1,'反馈成功');
     }
 }

+ 2 - 2
application/extra/wallet.php

@@ -25,8 +25,8 @@ return [
 
         111 => '图文问诊', //money +
         112 => '视频问诊', //money +
-        113 => '图文问诊退款', //money -
-        114 => '视频问诊退款', //money -
+//        113 => '图文问诊退款', //money -
+//        114 => '视频问诊退款', //money -
 
         121 => '钱包余额提现', //money -
         122 => '提现拒绝返回', //money +