zhaojs
2023-07-20 8c00bd0245ca4756ca04483a4980ad202714e43e
application/api/controller/Activity.php
@@ -7,10 +7,12 @@
use app\common\model\FqbCate;
use app\api\logic\taoke\device\Jd as LogicJd;
use app\api\logic\ActivityInfo as ActInfo;
header("Access-Control-Allow-Origin:*");
class Activity extends Api
{
    protected $noNeedLogin = ['fqb_plat_cate'];
    protected $noNeedLogin = ['fqb_plat_cate','run_countRecruitAct','test'];
    protected $noNeedRight = '*';
    /**
     * 获取疯抢榜
@@ -173,4 +175,84 @@
        $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);
    }
    /**
     * 参加活动
     */
    public function attendAct()
    {
        $actid=request()->param('actid');
        if(empty($actid)) $this->error('参数错误');
        $actInfo=new ActInfo();
        $user = $this->auth->getUser();
        $res=$actInfo->attendAct($actid,$user->id);
        $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);
    }
}