안녕하세요.
번번히 도와주셔서 다시 한 번 감사드리며, 염치없이 또 질문드려요.. --;;;
카츠님이 알려주신 코드로
http://sir.co.kr/qa/88541#answer_88654
주문하면 추천인에게 포인트가 삽입되도록 했는데,
주문 취소시 포인트 반환이 안되네요..
어디서 손을봐야할지.... 고수님들의 조언을 부탁드려요.
-------이렇게 포인트 삽입---------------------------------------------------------
/lib/shop_lib.php 파일 2057 줄에
insert_point($od_row['mb_id'], $po_point, $po_content, "@delivery", $od_row['mb_id'], "{$od_row['od_id']},{$row['ct_id']}");
이거 대신
$mb = get_member($od_row['mb_id']); if ($mb['mb_recommend']){ $recom_mb = get_member($mb['mb_recommend']); if ($recom_mb['mb_id']){ insert_point($recom_mb['mb_id'], $po_point, $po_content, "@delivery", $od_row['mb_id'], "{$od_row['od_id']},{$row['ct_id']}"); }}
이렇게 삽입한 포인트가, 주문 취소일 경우 어디서 어떻게 반환해 주어야 하는지
아무리 찾아봐도 모르겠어요.
adm/shop_admin/orderform.php 여기를 봐도 모르겠고..
lib/common.lib.php 파일의 함수....
// 포인트 삭제function delete_point($mb_id, $rel_table, $rel_id, $rel_action){ global $g5;
$result = false; if ($rel_table || $rel_id || $rel_action) { // 포인트 내역정보 $sql = " select * from {$g5['point_table']} where mb_id = '$mb_id' and po_rel_table = '$rel_table' and po_rel_id = '$rel_id' and po_rel_action = '$rel_action' "; $row = sql_fetch($sql);
if($row['po_point'] < 0) { $mb_id = $row['mb_id']; $po_point = abs($row['po_point']);
delete_use_point($mb_id, $po_point); } else { if($row['po_use_point'] > 0) { insert_use_point($row['mb_id'], $row['po_use_point'], $row['po_id']); } }
$result = sql_query(" delete from {$g5['point_table']} where mb_id = '$mb_id' and po_rel_table = '$rel_table' and po_rel_id = '$rel_id' and po_rel_action = '$rel_action' ", false);
// po_mb_point에 반영 $sql = " update {$g5['point_table']} set po_mb_point = po_mb_point - '{$row['po_point']}' where mb_id = '$mb_id' and po_id > '{$row['po_id']}' "; sql_query($sql);
// 포인트 내역의 합을 구하고 $sum_point = get_point_sum($mb_id);
// 포인트 UPDATE $sql = " update {$g5['member_table']} set mb_point = '$sum_point' where mb_id = '$mb_id' "; $result = sql_query($sql);
// XP UPDATE update_xp($mb_id, $row['po_point'] * (-1), '', $rel_table, $rel_action); }
return $result;}
-----------------------------------------------------------
여기를 봐도 모르겠어요.. ..에고...무식해서 죄송합니다...
고수님들의 조언을 부탁드립니다. 꾸벅..
답변 1개
취소시 해당 포인트를
다시 추가해줘야합니다
답변을 작성하려면 로그인이 필요합니다.