From a11d5930250a9748411b22aae18f18eac2f2d000 Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Tue, 3 Sep 2024 22:42:20 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E4=BA=86=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E7=94=9F=E6=B4=BB=E6=94=AF=E4=BB=98=202.=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BA=86=E6=9F=A5=E8=AF=A2=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Pay.php | 14 +++++++++++--- app/api/logic/GoodsLogic.php | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/api/controller/Pay.php b/app/api/controller/Pay.php index 452f28b8..1294ce3e 100755 --- a/app/api/controller/Pay.php +++ b/app/api/controller/Pay.php @@ -112,11 +112,19 @@ class Pay extends Api return $result; } - public function localPay() + public function localPay() { - $user_id = $this->user_id; $post = $this->request->post(); - $result = PayLogic::localWxPay($user_id,$post, $this->client); + $user_id = $this->user_id; + if(!isset($user_id)){ + $user_id = $post['user_id']; + } + if(isset($this->client)){ + $client = $this->client; + }else{ + $client = 1; + } + $result = PayLogic::localWxPay($user_id,$post, $client); return $result; } diff --git a/app/api/logic/GoodsLogic.php b/app/api/logic/GoodsLogic.php index ba0681f6..45bdbc86 100755 --- a/app/api/logic/GoodsLogic.php +++ b/app/api/logic/GoodsLogic.php @@ -394,8 +394,8 @@ class GoodsLogic extends Logic if($category_msg['pid'] == 0){ $wh = "find_in_set(".$get['platform_cate_id'].", first_cate_id)"; }else{ - $category_second_msg = GoodsCategory::where("pid",$category_msg['id'])->select(); - if(count($category_second_msg)>0){ + $category_second_msg = GoodsCategory::where("pid",$category_msg['id'])->find(); + if($category_second_msg==null){ $wh = "find_in_set(".$get['platform_cate_id'].", second_cate_id)"; }else{ $wh = "find_in_set(".$get['platform_cate_id'].", third_cate_id)";