當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OrderItem::getReturnQuantity方法代碼示例

本文整理匯總了PHP中OrderItem::getReturnQuantity方法的典型用法代碼示例。如果您正苦於以下問題:PHP OrderItem::getReturnQuantity方法的具體用法?PHP OrderItem::getReturnQuantity怎麽用?PHP OrderItem::getReturnQuantity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OrderItem的用法示例。


在下文中一共展示了OrderItem::getReturnQuantity方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loadItems

 private function loadItems($reload = false)
 {
     if ($this->items_total == 0 || $reload == true) {
         $this->items = array();
         $this->items_canceled = array();
         $this->items_notcanceled = array();
         $this->items_total_qty = 0;
         $this->items_canceled_total_qty = 0;
         $this->items_notcanceled_total_qty = 0;
         $this->items_returned = array();
         $this->items_returned_total_qty = 0;
         if ($this->isOrderFromSalesPartner()) {
             $table = OrderItem::TABLENAME_SP;
             $colname_order_id = self::COLNAME_ID_SP;
             $colname_item_id = OrderItem::COLNAME_ID_SP;
         } elseif ($this->isOrderFromJulieGrace()) {
             $table = OrderItem::TABLENAME_JG;
             $colname_order_id = self::COLNAME_ID_JG;
             $colname_item_id = OrderItem::COLNAME_ID_JG;
         }
         $q = "SELECT {$colname_item_id} FROM {$table} WHERE {$colname_order_id}" . " = '" . $this->order_id . "'";
         $r = tep_db_query($q);
         while ($row = tep_db_fetch_array($r)) {
             $item_id = $row[$colname_item_id];
             $i = new OrderItem($this, $item_id);
             $this->items[$item_id] = $i;
             $this->items_total_qty += $i->ordered_quantity;
             if (statusIsCancelled($i->status)) {
                 $this->items_canceled[$item_id] = $i;
                 $this->items_canceled_total_qty += $i->ordered_quantity;
             } else {
                 $this->items_notcanceled[$item_id] = $i;
                 $this->items_notcanceled_total_qty += $i->ordered_quantity;
             }
             $return_qty = $i->getReturnQuantity();
             if ($return_qty > 0) {
                 $this->items_returned[$item_id] = $i;
                 $this->items_returned_total_qty += $return_qty;
             }
         }
         $this->items_total = count($this->items);
         $this->items_canceled_total = count($this->items_canceled);
         $this->items_notcanceled_total = count($this->items_notcanceled);
         $this->items_returned_total = count($this->items_returned);
     }
 }
開發者ID:blasiuscosa,項目名稱:manobo-2008,代碼行數:46,代碼來源:Order.php


注:本文中的OrderItem::getReturnQuantity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。