diff --git a/common/libraries/receiver/Orders_entity.php b/common/libraries/receiver/Orders_entity.php index f798001c..b4ccf74e 100644 --- a/common/libraries/receiver/Orders_entity.php +++ b/common/libraries/receiver/Orders_entity.php @@ -99,7 +99,7 @@ class Orders_entity{ $srv_money = $this->order_srv_money($oid); //获取门店信息 $biz = $this->ci->biz_model->get(['id'=>$this->order_row['biz_id']],'company_id,srv_company_id'); - if($srv_money < $this->order_row['deposit']){ //服务费小于定金 给销售公司 + if($srv_money < $this->order_row['deposit'] || $pay_money){ //服务费小于支付定金或有意向金订单 给销售公司 $company = $this->ci->sys_company_model->get(['id'=>$biz['company_id']],'wx_mchid'); $mch_id = $company['wx_mchid']; }else{ @@ -381,11 +381,13 @@ class Orders_entity{ $company = $this->ci->sys_company_model->get(['id'=>$biz['company_id']]); $srv_company = $this->ci->sys_company_model->get(['id'=>$biz['srv_company_id']]); + $pay_money = $this->ci->app_liche_orders_model->get(['o_id'=>$oid,'uid'=>$userinfo['id'],'type'=>4,'status'=>1,'o_id!='=>253]); //已支付意向金订单 + $srv_money = $this->order_srv_money($oid); //服务费 $money_json = json_decode($this->order_row['money_json'],true); $money_json['price_discount'] && $money_json['price_car'] = $money_json['price_car'] - $money_json['price_discount']; if($this->order_row['payway']){ //全款 - if($srv_money < $this->order_row['deposit']){ //服务费小于定金 + if($srv_money < $this->order_row['deposit'] || $pay_money){ //服务费小于定金 $to_srv_price = $srv_money; $to_com_price = $money_json['price_car'] - $this->order_row['deposit']; $to_com_price = $to_com_price>0 ? $to_com_price : 0; @@ -395,7 +397,7 @@ class Orders_entity{ $to_srv_price = $to_srv_price>0 ? $to_srv_price : 0; } }else{ //分期 - if($srv_money < $this->order_row['deposit']){ //服务费小于定金 + if($srv_money < $this->order_row['deposit'] || $pay_money){ //服务费小于定金 $to_srv_price = $srv_money; $to_com_price = $money_json['price_car']-$money_json['price_loan'] - $this->order_row['deposit']; $to_com_price = $to_com_price>0 ? $to_com_price : 0; @@ -482,16 +484,8 @@ class Orders_entity{ $srv_money = $this->order_srv_money($oid); //获取门店信息 $biz = $this->ci->biz_model->get(['id'=>$this->order_row['biz_id']],'company_id,srv_company_id'); - if($srv_money < $this->order_row['deposit']){ //服务费小于定金 给销售公司 - $company = $this->ci->sys_company_model->get(['id'=>$biz['company_id']],'wx_mchid'); - $mch_id = $company['wx_mchid']; - }else{ - $mch_id = self::SRV_MCH_ID; - if($biz['srv_company_id']){ - $company = $this->ci->sys_company_model->get(['id'=>$biz['srv_company_id']],'wx_mchid'); - $company['wx_mchid'] && $mch_id = $company['wx_mchid']; - } - } + $company = $this->ci->sys_company_model->get(['id'=>$biz['company_id']],'wx_mchid'); + $mch_id = $company['wx_mchid']; $sid = create_order_no(350200,'liche',1,4); $sub_data = [ 'o_id' => $this->order_row['id'],