From 829561438b88ce2f63f8cc1fd44a5eea895371e2 Mon Sep 17 00:00:00 2001 From: zhaojs <349234519@qq.com> Date: 星期二, 08 八月 2023 16:56:23 +0800 Subject: [PATCH] no message --- application/api/controller/Activity.php | 88 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 87 insertions(+), 1 deletions(-) diff --git a/application/api/controller/Activity.php b/application/api/controller/Activity.php index ce51323..94ae472 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','run_countRecruitAct']; + protected $noNeedLogin = ['UpWxImg','recordItemClick','fqb_plat_cate','run_countRecruitAct','test']; protected $noNeedRight = '*'; /** * 鑾峰彇鐤姠姒� @@ -232,6 +233,12 @@ $this->success('鑾峰彇鎴愬姛',$res); } + public function test() + { + $actInfo=new ActInfo(); + $res=$actInfo->updateRecruitCount(2); + } + /** * 鎷涘嫙娲诲姩璁$畻 */ @@ -249,4 +256,83 @@ $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]); + } + + 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 + } + + } \ No newline at end of file -- Gitblit v1.9.3