<?php
/**
 * InvitecodeModel.php
 * Created by: Owen
 * Created on: 2021/11/26 18:41
 *
 */

class InvitecodeModel
{
    /**
     * 获取邀请人数
     * @param $tempKeyDate
     * @return mixed
     * newplayerFrom($type = 1, $device = 1)
     */
    public function getInviteNum($tempKeyDate)
    {
        $tempKeyFBAnd 	= okeys::newplayerFromDate(1, 1, $tempKeyDate);//FB 安卓
        $fbAndNum = oo::commonOprRedis('games')->get($tempKeyFBAnd);
        $tempKeyInvAnd 	= okeys::newplayerFromDate(2, 1, $tempKeyDate);//邀请码 安卓
        $invAndNum = oo::commonOprRedis('games')->get($tempKeyInvAnd);
        $tempKeyFBIos = okeys::newplayerFromDate(1, 2, $tempKeyDate);//FB IOS
        $fbIosNum = oo::commonOprRedis('games')->get($tempKeyFBIos);
        $tempKeyInvIos = okeys::newplayerFromDate(2, 2, $tempKeyDate);//邀请码 IOS
        $invIosNum = oo::commonOprRedis('games')->get($tempKeyInvIos);
        $data['fbAndNum'] = intval($fbAndNum);
        $data['invAndNum'] = intval($invAndNum);
        $data['fbIosNum'] = intval($fbIosNum);
        $data['invIosNum'] = intval($invIosNum);
        return $data;
    }
}