patch: 3fd8740c92
This commit is contained in:
parent
a255dd9ef7
commit
f6f6337635
2 changed files with 211 additions and 205 deletions
|
|
@ -1204,13 +1204,17 @@ function delete_point($mb_id, $rel_table, $rel_id, $rel_action)
|
||||||
and po_rel_action = '$rel_action' ";
|
and po_rel_action = '$rel_action' ";
|
||||||
$row = sql_fetch($sql);
|
$row = sql_fetch($sql);
|
||||||
|
|
||||||
if ($row['po_point'] < 0) {
|
if (!(isset($row['po_id']) && $row['po_id'])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($row['po_point']) && $row['po_point'] < 0) {
|
||||||
$mb_id = $row['mb_id'];
|
$mb_id = $row['mb_id'];
|
||||||
$po_point = abs($row['po_point']);
|
$po_point = abs($row['po_point']);
|
||||||
|
|
||||||
delete_use_point($mb_id, $po_point);
|
delete_use_point($mb_id, $po_point);
|
||||||
} else {
|
} else {
|
||||||
if ($row['po_use_point'] > 0) {
|
if (isset($row['po_use_point']) && $row['po_use_point'] > 0) {
|
||||||
insert_use_point($row['mb_id'], $row['po_use_point'], $row['po_id']);
|
insert_use_point($row['mb_id'], $row['po_use_point'], $row['po_id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1222,11 +1226,13 @@ function delete_point($mb_id, $rel_table, $rel_id, $rel_action)
|
||||||
and po_rel_action = '$rel_action' ", false);
|
and po_rel_action = '$rel_action' ", false);
|
||||||
|
|
||||||
// po_mb_point에 반영
|
// po_mb_point에 반영
|
||||||
|
if (isset($row['po_point'])) {
|
||||||
$sql = " update {$g5['point_table']}
|
$sql = " update {$g5['point_table']}
|
||||||
set po_mb_point = po_mb_point - '{$row['po_point']}'
|
set po_mb_point = po_mb_point - '{$row['po_point']}'
|
||||||
where mb_id = '$mb_id'
|
where mb_id = '$mb_id'
|
||||||
and po_id > '{$row['po_id']}' ";
|
and po_id > '{$row['po_id']}' ";
|
||||||
sql_query($sql);
|
sql_query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
// 포인트 내역의 합을 구하고
|
// 포인트 내역의 합을 구하고
|
||||||
$sum_point = get_point_sum($mb_id);
|
$sum_point = get_point_sum($mb_id);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue