public function createOrUpdateStatistic($params = array()) { $statistic = YNSOCIALBRIDGE_BOL_StatisticService::getInstance()->getTotalInviteOfDay($params); if ($statistic) { $statistic->inviteOfDay = $params['inviteOfDay']; } else { $statistic = new YNSOCIALBRIDGE_BOL_Statistic(); $statistic->service = $params['service']; $statistic->userId = $params['userId']; $statistic->uid = $params['uid']; $statistic->inviteOfDay = $params['inviteOfDay']; $statistic->date = $params['date']; } YNSOCIALBRIDGE_BOL_StatisticService::getInstance()->save($statistic); }