From 52108eeb162e33692d7888504dfb38155d053dd3 Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Mon, 25 Nov 2024 16:58:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E8=A1=8C=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Gh.php | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/app/api/controller/Gh.php b/app/api/controller/Gh.php index f4746048..58c62cb5 100644 --- a/app/api/controller/Gh.php +++ b/app/api/controller/Gh.php @@ -175,14 +175,6 @@ class Gh extends Api if($abutment == null){ return JsonServer::error('支付失败'); } - if($type == ""){ - $distributionPay = Db::name("distribution_pay") - ->where("alog_id",$alog_id) - ->find(); - if($distributionPay == null){ - return JsonServer::error('支付失败'); - } - } $checkPay = $this->payReturnCheck($abutment['out_trade_no']); if($checkPay['return_msg'] === "SUCCESS"){ Db::name("abutment_log") @@ -206,14 +198,28 @@ class Gh extends Api //分销审核通过之后才会解冻分账或者确认收货 public function CompleteAudit($id,$type=""){ - $dmemberApply = Db::name("distribution_member_apply") - ->where("id",$id) - ->find(); - $alog_id = $dmemberApply['alog_id']; - $abutment = Db::name("abutment_log") - ->where("alog_id",$alog_id) - ->where("state",0) - ->find(); + $alog_id = ""; + if($type == ""){ + $messsage = Db::name("distribution_member_apply") + ->where("id",$id) + ->find(); + $alog_id = $messsage['alog_id']; + $abutment = Db::name("abutment_log") + ->where("alog_id",$alog_id) + ->where("state",1) + ->find(); + } + if($type == 1){ + $abutment = Db::name("abutment_log") + ->where("order_id",$id) + ->where("state",1) + ->find(); + $alog_id = $messsage['alog_id']; + Db::name("order") + ->where("id",$id) + ->where("order_status",3) + ->find(); + } $checkPay = $this->payReturnCheck($abutment['out_trade_no']); if($checkPay['return_msg'] === "SUCCESS") { $r = json_decode($checkPay['order_submit_act_output'], true);