|
|
|
17년 전
|
조회 999
|
|
|
|
17년 전
|
조회 747
|
|
|
|
17년 전
|
조회 986
|
|
|
|
17년 전
|
조회 1,666
|
|
|
|
17년 전
|
조회 715
|
|
|
|
17년 전
|
조회 999
|
|
|
|
17년 전
|
조회 1,518
|
|
|
|
17년 전
|
조회 741
|
|
|
|
17년 전
|
조회 1,057
|
|
|
|
17년 전
|
조회 947
|
|
|
|
17년 전
|
조회 1,236
|
|
|
|
17년 전
|
조회 2,839
|
|
|
|
17년 전
|
조회 824
|
|
|
|
17년 전
|
조회 744
|
|
|
|
17년 전
|
조회 3,732
|
|
|
|
17년 전
|
조회 948
|
|
|
|
17년 전
|
조회 1,132
|
|
|
|
17년 전
|
조회 802
|
|
|
|
17년 전
|
조회 752
|
|
|
|
17년 전
|
조회 830
|
댓글 3개
테스트는 안 해봤습니다.
문제있으면 알려주세요. ^^
1. 3개월(90일) 지난거 자동 소멸
$expire_day = 90; // 소멸 기간 설정
$expire = date("Y-m-d H:i:s", time()-($expire_day*24*60*60));
// 포인트 내역 삭제
$sql = " delete from $g4[point_table] where mb_id = '$mb_id' and po_datetime < '$expire' and po_point > 0 ";
$row = sql_query($sql);
// 포인트 내역의 합을 구하고
$sql = " select sum(po_point) as sum_po_point from $g4[point_table] where mb_id = '$mb_id' ";
$row = sql_fetch($sql);
$sum_point = $row[sum_po_point];
// 포인트 UPDATE
$sql = " update $g4[member_table] set mb_point = '$sum_point' where mb_id = '$mb_id' ";
sql_query($sql);
2. 1개월(30일)간 로그인 안하면 1000포인트 소멸
$expire_day = 30; // 소멸 기간 설정
$expire_point = 1000; // 소멸 포인트 설정
$expire = date("Y-m-d H:i:s", time()-($expire_day*24*60*60));
$sql = " select mb_id from $g4[point_table] where mb_id = '$mb_id' and mb_today_login < '$expire' ";
$row = sql_fetch($sql);
if($mb_id == $row[mb_id]) insert_point($mb_id, $expire_point*(-1), "{$expire_day}일 이상 로그인 안 함");