heyuntao
2023-10-07 f2528a40b631dd4165484b9fce6b5c2708aae5c7
application/api/controller/Activity.php
@@ -12,7 +12,7 @@
header("Access-Control-Allow-Origin:*");
class Activity extends Api
{
    protected $noNeedLogin = ['fqb_plat_cate'];
    protected $noNeedLogin = ['fqb_plat_cate','run_countRecruitAct','test'];
    protected $noNeedRight = '*';
    /**
     * 获取疯抢榜
@@ -175,6 +175,22 @@
        $this->success('获取成功',$list);
    }
    /**
     * 获取活动信息
     *
     */
    public function getActInfo()
    {
        $actid=request()->param('actid');
        if(empty($actid)) $this->error('参数错误');
        $actInfo=new ActInfo();
        $user = $this->auth->getUser();
        $res=$actInfo->getActInfo($actid,$user->id);
        $this->success('获取成功',$res);
    }
    /**
     * 参加活动
     */
@@ -189,4 +205,54 @@
        $res?$this->success('成功',$res):  $this->error('活动异常');;
    }
    /**
     * 获取活动已邀请人数
     *
     */
    public function getActRecruitCount()
    {
        $actid=request()->param('actid');
        if(empty($actid)) $this->error('参数错误');
        $actInfo=new ActInfo();
        $user = $this->auth->getUser();
        $res=$actInfo->getActRecruitCount($actid,$user->id);
        $this->success('获取成功',$res);
    }
    /**
     * 获取排名
     */
    public function getRankingList()
    {
        $actid=request()->param('actid');
        if(empty($actid)) $this->error('参数错误');
        $actInfo=new ActInfo();
        $user = $this->auth->getUser();
        $res=$actInfo->getRankingList($actid,$user->id);
        $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);
    }
}