Changeset 17987


Ignore:
Timestamp:
2009/04/26 21:12:51 (13 years ago)
Author:
x41
Message:

受注管理の個別編集画面でポイント付与後に新規とキャンセルにステータスを変更すればポイントを自動返還。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php

    r17890 r17987  
    518518            // 発送済みに変更の際ポイント付与 
    519519            $customer_id = $sqlval['customer_id']; 
    520             $add_point = $sqlval['add_point']; 
    521             if($customer_id != "" && $customer_id >= 1) { 
    522                 $arrRet = $objQuery->select("point", 'dtb_customer', 'customer_id = ?', array($customer_id)); 
    523                 $arrRet[0]['point']+= $add_point; 
    524                 $sqlval2['point'] = $arrRet[0]['point']; 
    525                 $objQuery->update('dtb_customer', $sqlval2, 'customer_id = ?', array($customer_id)); 
    526             } 
     520        $add_point = $sqlval['add_point']; 
     521        if($customer_id != "" && $customer_id >= 1) { 
     522            $arrRet = $objQuery->select("point", 'dtb_customer', 'customer_id = ?', array($customer_id)); 
     523            $arrRet[0]['point']+= $add_point; 
     524            $sqlval2['point'] = $arrRet[0]['point']; 
     525            $objQuery->update('dtb_customer', $sqlval2, 'customer_id = ?', array($customer_id)); 
     526           } 
     527        } elseif ($sqlval['status'] == 1 || $sqlval['status'] == 3) { 
     528                $customer_id = $sqlval['customer_id']; 
     529        $add_point = $sqlval['add_point']; 
     530        if($customer_id != "" && $customer_id >= 1) { 
     531            $arrRet = $objQuery->select("point", 'dtb_customer', 'customer_id = ?', array($customer_id)); 
     532            $arrRet[0]['point']-= $add_point; 
     533            $sqlval2['point'] = $arrRet[0]['point']; 
     534            $objQuery->update('dtb_customer', $sqlval2, 'customer_id = ?', array($customer_id)); 
     535              } 
     536        }else { 
     537                $customer_id = $sqlval['customer_id']; 
     538        $add_point = $sqlval['add_point']; 
     539        if($customer_id != "" && $customer_id >= 1) { 
     540            $arrRet = $objQuery->select("point", 'dtb_customer', 'customer_id = ?', array($customer_id)); 
     541            $sqlval2['point'] = $arrRet[0]['point']; 
     542            $objQuery->update('dtb_customer', $sqlval2, 'customer_id = ?', array($customer_id)); 
     543           } 
    527544        } 
    528545 
     
    613630            // 発送済みに変更の際ポイント付与 
    614631            $customer_id = $sqlval['customer_id']; 
    615             $add_point = $sqlval['add_point']; 
    616             if($customer_id != "" && $customer_id >= 1) { 
    617                 $arrRet = $objQuery->select("point", 'dtb_customer', 'customer_id = ?', array($customer_id)); 
    618                 $arrRet[0]['point']+= $add_point; 
    619                 $sqlval2['point'] = $arrRet[0]['point']; 
    620                 $objQuery->update('dtb_customer', $sqlval2, 'customer_id = ?', array($customer_id)); 
    621             } 
     632        $add_point = $sqlval['add_point']; 
     633        if($customer_id != "" && $customer_id >= 1) { 
     634            $arrRet = $objQuery->select("point", 'dtb_customer', 'customer_id = ?', array($customer_id)); 
     635            $arrRet[0]['point']+= $add_point; 
     636            $sqlval2['point'] = $arrRet[0]['point']; 
     637            $objQuery->update('dtb_customer', $sqlval2, 'customer_id = ?', array($customer_id)); 
     638           } 
     639        } elseif ($sqlval['status'] == 1 || $sqlval['status'] == 3) { 
     640                $customer_id = $sqlval['customer_id']; 
     641        $add_point = $sqlval['add_point']; 
     642        if($customer_id != "" && $customer_id >= 1) { 
     643            $arrRet = $objQuery->select("point", 'dtb_customer', 'customer_id = ?', array($customer_id)); 
     644            $arrRet[0]['point']-= $add_point; 
     645            $sqlval2['point'] = $arrRet[0]['point']; 
     646            $objQuery->update('dtb_customer', $sqlval2, 'customer_id = ?', array($customer_id)); 
     647              } 
     648        }else { 
     649                $customer_id = $sqlval['customer_id']; 
     650        $add_point = $sqlval['add_point']; 
     651        if($customer_id != "" && $customer_id >= 1) { 
     652            $arrRet = $objQuery->select("point", 'dtb_customer', 'customer_id = ?', array($customer_id)); 
     653            $sqlval2['point'] = $arrRet[0]['point']; 
     654            $objQuery->update('dtb_customer', $sqlval2, 'customer_id = ?', array($customer_id)); 
     655           } 
    622656        } 
    623657 
Note: See TracChangeset for help on using the changeset viewer.