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)";