mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
삭제
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2327 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
commit
8326004cb2
2773 changed files with 91485 additions and 0 deletions
76
modules/point/point.model.php
Normal file
76
modules/point/point.model.php
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pointModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief point 모듈의 model class
|
||||
**/
|
||||
|
||||
class pointModel extends point {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 포인트 정보가 있는지 체크
|
||||
**/
|
||||
function isExistsPoint($member_srl) {
|
||||
$args->member_srl = $member_srl;
|
||||
$output = executeQuery('point.getPoint', $args);
|
||||
if($output->data->member_srl == $member_srl) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 포인트를 구해옴
|
||||
**/
|
||||
function getPoint($member_srl, $from_db = false) {
|
||||
$cache_filename = sprintf('./files/member_extra_info/point/%s%d.cache.txt', getNumberingPath($member_srl), $member_srl);
|
||||
|
||||
if(!$from_db && file_exists($target_filename)) return trim(FileHandler::readFile($cache_filename));
|
||||
|
||||
// DB에서 가져옴
|
||||
$args->member_srl = $member_srl;
|
||||
$output = executeQuery('point.getPoint', $args);
|
||||
$point = (int)$output->data->point;
|
||||
|
||||
FileHandler::writeFile($cache_filename, $point);
|
||||
|
||||
return $point;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 레벨을 구함
|
||||
**/
|
||||
function getLevel($point, $level_step) {
|
||||
$level_count = count($level_step);
|
||||
for($level=0;$level<=$level_count;$level++) if($point < $level_step[$level]) break;
|
||||
$level --;
|
||||
return $level;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 포인트 순 회원목록 가져오기
|
||||
**/
|
||||
function getMemberList($args = null) {
|
||||
if(!$args) {
|
||||
$args->list_count = 20;
|
||||
$args->page = 1;
|
||||
}
|
||||
$output = executeQuery("point.getMemberList", $args);
|
||||
if($output->total_count) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
foreach($output->data as $key => $val) {
|
||||
$point = $val->point;
|
||||
$level = $this->getLevel($val->point, $config->level_step);
|
||||
$output->data[$key]->level = $level;
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue