From 74f6db362e1aacb440eacce84e9433de1368a51a Mon Sep 17 00:00:00 2001
From: zhaojs <349234519@qq.com>
Date: 星期六, 07 十月 2023 10:58:36 +0800
Subject: [PATCH] Merge branch 'hotfix/首页猜你喜欢修复'

---
 application/api/controller/Activity.php |   84 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 79 insertions(+), 5 deletions(-)

diff --git a/application/api/controller/Activity.php b/application/api/controller/Activity.php
index a404d53..bb56ac7 100644
--- a/application/api/controller/Activity.php
+++ b/application/api/controller/Activity.php
@@ -6,13 +6,14 @@
 use app\api\logic\taoke\device\Haodanku;
 use app\common\model\FqbCate;
 use app\api\logic\taoke\device\Jd as LogicJd;
+use app\api\logic\Banner as LogicBanner;
 
 use app\api\logic\ActivityInfo as ActInfo;
 
 header("Access-Control-Allow-Origin:*");
 class Activity extends Api
 {
-    protected $noNeedLogin = ['fqb_plat_cate'];
+    protected $noNeedLogin = ['recordItemClick','fqb_plat_cate','run_countRecruitAct','test'];
     protected $noNeedRight = '*';
     /**
      * 鑾峰彇鐤姠姒�
@@ -216,10 +217,7 @@
         $actInfo=new ActInfo();
         $user = $this->auth->getUser();
         $res=$actInfo->getActRecruitCount($actid,$user->id);
-        $data = [
-            'hascount' => $res
-        ];
-        $this->success('鑾峰彇鎴愬姛',$data);
+        $this->success('鑾峰彇鎴愬姛',$res);
     }
 
     /**
@@ -235,4 +233,80 @@
         $this->success('鑾峰彇鎴愬姛',$res);
     }
 
+    public function test()
+    {
+        $actInfo=new ActInfo();
+        $res=$actInfo->updateRecruitCount(2);
+    }
+
+    /**
+     * 鎷涘嫙娲诲姩璁$畻
+     */
+    public function run_countRecruitAct()
+    {
+        $actInfo=new ActInfo();
+        $res=$actInfo->run_countRecruitAct();
+        $this->success('鎵ц瀹屾垚',$res);
+    }
+    /**
+     * 鑾峰彇閭�璇风爜
+     */
+    public function getInviteUrl()
+    {
+        $user = $this->auth->getUser();
+        $this->success('鑾峰彇鎴愬姛',$user->invitation_code);
+    }
+
+
+    /**
+     * 鑾峰彇鑷畾涔夊脊绐�
+     * 
+     */
+    public function getCustomizePopup()
+    {
+        $LogicBanner = new LogicBanner();
+        $list = $LogicBanner->getList('20,21');
+        if(!$list||$list['customizePop']==null||count($list['customizePop'])==0)
+        {
+            $this->success('鑾峰彇鎴愬姛',[]);
+        }
+        $user = $this->auth->getUser();
+        $actInfo=new ActInfo();
+        foreach ($list['customizePop'] as $vaule) {
+            $paraJson=json_decode($vaule->note);
+            $isPop=false;
+            switch($paraJson->poptype)
+            {
+                case 'freebuy'://0鍏冭喘寮圭獥
+                    $isPop=$actInfo->popupcus_freebuy($user);
+                    break;
+                default:
+                    break;
+            }
+            if($isPop)
+            {
+                $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]);
+    }
+
+    
 }
\ No newline at end of file

--
Gitblit v1.9.3