当前位置: 首页>>代码示例>>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;未经允许,请勿转载。