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


PHP EE_Transaction::get_pretty方法代碼示例

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


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

示例1: elseif

 /**
  * 	column_TXN_paid
  * @param \EE_Transaction $item
  * @return mixed|string
  */
 function column_TXN_paid(EE_Transaction $item)
 {
     $transaction_total = $item->get('TXN_total');
     $transaction_paid = $item->get('TXN_paid');
     if ($transaction_total > 0 && $transaction_paid >= $transaction_total) {
         // paid in full
         $span_class = 'txn-overview-full-payment-spn';
     } elseif ($transaction_total > 0 && $transaction_paid > 0) {
         // monies owing
         $span_class = 'txn-overview-part-payment-spn';
     } elseif ($transaction_total > 0 && $transaction_paid == 0) {
         // no payments made
         $span_class = 'txn-overview-no-payment-spn';
     } else {
         $span_class = 'txn-overview-free-event-spn';
         $transaction_paid = 0;
     }
     return '<span class="' . $span_class . ' txn-pad-rght">' . $transaction_paid !== 0 ? $item->get_pretty('TXN_paid') : $transaction_paid . '</span>';
 }
開發者ID:robert-osborne,項目名稱:event-espresso-core-1,代碼行數:24,代碼來源:EE_Admin_Transactions_List_Table.class.php

示例2: elseif

 /**
  * 	column_TXN_paid
  * @param \EE_Transaction $item
  * @return mixed|string
  */
 function column_TXN_paid(EE_Transaction $item)
 {
     $transaction_total = $item->get('TXN_total');
     $transaction_paid = $item->get('TXN_paid');
     if ($transaction_total > 0 && $transaction_paid >= $transaction_total) {
         // paid in full
         $span_class = 'txn-overview-full-payment-spn';
     } elseif ($transaction_total > 0 && $transaction_paid > 0) {
         // monies owing
         $span_class = 'txn-overview-part-payment-spn';
     } elseif ($transaction_total > 0 && $transaction_paid == 0) {
         // no payments made
         $span_class = 'txn-overview-no-payment-spn';
     } else {
         $span_class = 'txn-overview-free-event-spn';
         $transaction_paid = 0;
     }
     $payment_method = $item->payment_method();
     $payment_method_name = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __('Unknown', 'event_espresso');
     $content = '<span class="' . $span_class . ' txn-pad-rght">' . $transaction_paid !== 0 ? $item->get_pretty('TXN_paid') : $transaction_paid . '</span>';
     if ($transaction_paid > 0) {
         $content .= '<br><span class="ee-status-text-small">' . sprintf(__('...via %s', 'event_espresso'), $payment_method_name) . '</span>';
     }
     return $content;
 }
開發者ID:DavidSteinbauer,項目名稱:event-espresso-core,代碼行數:30,代碼來源:EE_Admin_Transactions_List_Table.class.php


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