Pārlūkot izejas kodu

订单完成要结算钱

lizhen_gitee 9 mēneši atpakaļ
vecāks
revīzija
c574d4eedc
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6 2
      application/api/controller/doctor/Wenzhen.php

+ 6 - 2
application/api/controller/doctor/Wenzhen.php

@@ -373,19 +373,23 @@ class Wenzhen extends Apic
 
         Db::startTrans();
         //给医生结算钱
-        /*$logtype = $wenzhen_order['ordertype'] == 1 ? 111 : 112;
+        $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',$old_status)->update($update);
         if(!$update_rs){
             Db::rollback();
             $this->error('操作失败');
         }
 
+        //医生接诊量
+        Db::name('doctor')->where('id',$this->auth->id)->setInc('ordernum');
+
         Db::commit();
         $this->success('操作成功');
     }