<?php

namespace loyalsoft;

//
///*
// * To change this license header, choose License Headers in Project Properties.
// * To change this template file, choose Tools | Templates
// * and open the template in the editor.
// */
//
///**
// * Description of UserGuildModel
// *
// * @author cyzhao
// */
//class UserGuildModel {
//
//    //put your code here
//    public static function Clear() {
//        $userGuildinfo = new UserGuildModel();
//        $userGuildinfo->ts = now();
//        $userGuildinfo->joints = now(); //玩家公会的创建时间
//        $userGuildinfo->guildId = 0;
//        //s$userGuildinfo->guildName;
//        $userGuildinfo->cupScore = 0;
//        $userGuildinfo->appliedguildlist = array();
//        $userGuildinfo->appliedguildRecord = ObjectInit();
//        $userGuildinfo->contribute = 0; //贡献度
////        $userGuildinfo->level;
////        $userGuildinfo->name;
//        //$userGuildinfo->fightPower;
//        $userGuildinfo->requestCardTs = 0;
//        $userGuildinfo->donateCount = ObjectInit();
//        $userGuildinfo->allDonateCount = 0;
//        //$userGuildinfo->position = 0; //职位
//
//        return $userGuildinfo;
//    }
//
//    /**
//     * 检查玩家每日需要清理的状态
//     * @param UserGuildModel $userGuildInfo
//     */
//    static function checkFirstlog($userGuildInfo) {
//        #每天清理
//        if (TimeUtil::tsDay() > TimeUtil::tsDay($userGuildInfo->ts)) {
//            $userGuildInfo->allDonateCount = 0;
//        }
//        #清理过期捐献信息
//        $donateCount = $userGuildInfo->donateCount;
//        foreach ($donateCount as $key => $value) {
//            if (now() - $value->ts >= glc()->Guild_DonateCoolingTime) {//捐献冷却时间到了
//                unset($donateCount->$key);
//            }
//        }
//    }
//
//    /**
//     * 初始化个人公会信息
//     * @param type $userGuildInfo
//     * @param type $uid
//     * @param type $baseInfo
//     * @param type $mem
//     * @param type $guildId
//     * @param type $zoneid
//     */
//    static function userGuildInfoInit($userGuildInfo, $uid, $baseInfo, $mem, $zoneid) {
//        #self::Clear();
//        $userGuildInfo->ts = now();
////        if ($guildId != 0) {
////            $guildInfo = GuildProc::getMemGuildInfo($mem, $guildId, $zoneid);
////            $userGuildInfo->guildName = $guildInfo->name;
////        }
////        $key_cur = MemKey_GameRun::Game_PVPScoreByZone_zset($zoneid);   # 总积分榜
////        $score = $mem->zscore($key_cur, $uid);
////        $cupScore = $score == null ? 0 : $score;
////        $userGuildInfo->cupScore = $cupScore;
//        $userGuildInfo->name = $baseInfo->name;
//        $userGuildInfo->level = $baseInfo->level;
//        //$userGuildInfo->fightPower = GuildProc::initFightTeamInfo($mem, $uid, $zoneid); #$game->heroTeamConfig;
//        $userGuildInfo->uid = $uid;
//        $userGuildInfo->headImg = $baseInfo->headImg;
//        $userGuildInfo->imgBorderId = $baseInfo->imgBorderId;
//    }
//
//}
