heyuntao
2023-07-18 a62ebe0d1b9ea896cdba7bd4ec6e1d0d142b3b84
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'];
    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,43 @@
        $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);
        $data = [
            'hascount' => $res
        ];
        $this->success('获取成功',$data);
    }
    /**
     * 获取排名
     */
    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 run_countRecruitAct()
    {
        $actInfo=new ActInfo();
        $res=$actInfo->run_countRecruitAct();
        $this->success('执行完成',$res);
    }
}