mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
#176, member, point 테이블 비교 후 없는 값 삽입하도록 함, outer join 해결 전까지 임시 방편
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2713 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
de09885fb9
commit
ef25eb818a
6 changed files with 59 additions and 1 deletions
|
|
@ -60,9 +60,13 @@
|
|||
**/
|
||||
function dispPointAdminPointList() {
|
||||
$oPointModel = &getModel('point');
|
||||
|
||||
$args->list_count = 20;
|
||||
$args->page = Context::get('page');
|
||||
|
||||
//회원 목록 갱신
|
||||
if($args->page <= 1) $oPointModel->updateMemberList();
|
||||
|
||||
$output = $oPointModel->getMemberList($args);
|
||||
// 템플릿에 쓰기 위해서 context::set
|
||||
Context::set('total_count', $output->total_count);
|
||||
|
|
|
|||
|
|
@ -53,6 +53,38 @@
|
|||
return $level;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 목록 갱신
|
||||
**/
|
||||
function updateMemberList() {
|
||||
$output = executeQuery("point.getPointCount");
|
||||
$point_count = $output->data->count;
|
||||
|
||||
$output = executeQuery("point.getMemberCount");
|
||||
$member_count = count($output->data);
|
||||
|
||||
if($member_count > $point_count) {
|
||||
foreach($output->data as $key => $val) {
|
||||
|
||||
// 포인트가 있는지 체크
|
||||
if($this->isExistsPoint($val->member_srl)) continue;
|
||||
|
||||
// 변수 설정
|
||||
$args->member_srl = $val->member_srl;
|
||||
$args->point = 0;
|
||||
|
||||
$insert = executeQuery("point.insertPoint", $args);
|
||||
|
||||
// 캐시 설정
|
||||
$cache_path = sprintf('./files/member_extra_info/point/%s/', getNumberingPath($val->member_srl));
|
||||
FileHandler::makedir($cache_path);
|
||||
|
||||
$cache_filename = sprintf('%s%d.cache.txt', $cache_path, $val->member_srl);
|
||||
FileHandler::writeFile($cache_filename, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 포인트 순 회원목록 가져오기
|
||||
**/
|
||||
|
|
@ -110,7 +142,7 @@
|
|||
$config = $oModuleModel->getModuleConfig('point');
|
||||
|
||||
foreach($output->data as $key => $val) {
|
||||
$output->data[$key]->level = $this->getLevel($point, $config->level_step);
|
||||
$output->data[$key]->level = $this->getLevel($val->point, $config->level_step);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
8
modules/point/queries/getMemberCount.xml
Normal file
8
modules/point/queries/getMemberCount.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="getMemberCount" action="select">
|
||||
<tables>
|
||||
<table name="member" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="member_srl" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
@ -21,6 +21,9 @@
|
|||
<condition operation="like_prefix" column="last_login" var="s_last_login" pipe="or" />
|
||||
</group>
|
||||
</conditions>
|
||||
<groups>
|
||||
<group column="member.member_srl" />
|
||||
</groups>
|
||||
<navigation>
|
||||
<index var="sort_index" default="point" order="desc" />
|
||||
<list_count var="list_count" default="20" />
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@
|
|||
<condition operation="like_prefix" column="member.last_login" var="s_last_login" pipe="or" />
|
||||
</group>
|
||||
</conditions>
|
||||
<groups>
|
||||
<group column="member.member_srl" />
|
||||
</groups>
|
||||
<navigation>
|
||||
<index var="sort_index" default="point" order="desc" />
|
||||
<list_count var="list_count" default="20" />
|
||||
|
|
|
|||
8
modules/point/queries/getPointCount.xml
Normal file
8
modules/point/queries/getPointCount.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="getPointCount" action="select">
|
||||
<tables>
|
||||
<table name="point" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
</query>
|
||||
Loading…
Add table
Add a link
Reference in a new issue