From b054051ba0ae15006835913c5d8da70490c25db0 Mon Sep 17 00:00:00 2001
From: zhaojs <349234519@qq.com>
Date: 星期二, 22 八月 2023 14:17:27 +0800
Subject: [PATCH] no message

---
 application/api/controller/Activity.php |   54 ++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/application/api/controller/Activity.php b/application/api/controller/Activity.php
index 7ffab56..94ae472 100644
--- a/application/api/controller/Activity.php
+++ b/application/api/controller/Activity.php
@@ -13,7 +13,7 @@
 header("Access-Control-Allow-Origin:*");
 class Activity extends Api
 {
-    protected $noNeedLogin = ['fqb_plat_cate','run_countRecruitAct','test'];
+    protected $noNeedLogin = ['UpWxImg','recordItemClick','fqb_plat_cate','run_countRecruitAct','test'];
     protected $noNeedRight = '*';
     /**
      * 鑾峰彇鐤姠姒�
@@ -265,7 +265,7 @@
     public function getCustomizePopup()
     {
         $LogicBanner = new LogicBanner();
-        $list = $LogicBanner->getList(21);
+        $list = $LogicBanner->getList('20,21');
         if(!$list||$list['customizePop']==null||count($list['customizePop'])==0)
         {
             $this->success('鑾峰彇鎴愬姛',[]);
@@ -273,10 +273,9 @@
         $user = $this->auth->getUser();
         $actInfo=new ActInfo();
         foreach ($list['customizePop'] as $vaule) {
-            $paraJson=json_encode($vaule->parameter_json);
-            $popupType=$paraJson['cmark'];
+            $paraJson=json_decode($vaule->note);
             $isPop=false;
-            switch($popupType)
+            switch($paraJson->poptype)
             {
                 case 'freebuy'://0鍏冭喘寮圭獥
                     $isPop=$actInfo->popupcus_freebuy($user);
@@ -286,10 +285,53 @@
             }
             if($isPop)
             {
-                $this->success('鑾峰彇鎴愬姛',$vaule);
+                $this->success('鑾峰彇鎴愬姛',['haspop'=>true,'info'=>$vaule]);
                 break;
             }
         }
+        $this->success('鑾峰彇鎴愬姛',['haspop'=>false]);
+    }
+
+    /**
+     * 
+     * 璁板綍鍟嗗搧鐐瑰嚮
+     */
+
+    public function recordItemClick()
+    {
+        $goodsid=request()->param('goodsid');
+        $plat=request()->param('plat');
+        $title=request()->param('title');
+        $act_price=request()->param('act_price');
+        $actInfo=new ActInfo();
+        $actInfo->recordItemClick($goodsid,$plat,$title,$act_price);
+        $this->success('鎴愬姛',['success'=>true]);
+    }
+
+    public function UpWxImg()
+    {
+        $token=request()->param('token');
+        $picPath=request()->param('picPath');
+        //涓婁紶姘镐箙绱犳潗
+        $url="https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=".$token."&type=image";
+        //2銆佸悓姝ュ埌寰俊鏈嶅姟鍣�
+        if(class_exists('\CURLFile')){  //7.0
+            $data = ['media' => new \CURLFile($picPath)];
+        }else{  //5.6浠ュ強5.6浠ヤ笅
+            $data = array('media' => '@'.$picPath);
+        }
+ 
+        $ch  = curl_init();
+        curl_setopt($ch, CURLOPT_URL, $url);
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER , true);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , false);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST , false);
+        curl_setopt($ch, CURLOPT_POST, 1);
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
+        $res  = curl_exec($ch);
+        curl_close($ch);
+        $wxrs_id_card=json_decode($res,true);
+        $id_card =$wxrs_id_card['media_id'];  //寰楀埌media_id
     }
 
     

--
Gitblit v1.9.3