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


PHP payment::order_set_and方法代碼示例

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


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

示例1: get_account_log

/**
 * 查詢會員餘額的操作記錄
 *
 * @access  public
 * @param   int     $user_id    會員ID
 * @param   int     $num        每頁顯示數量
 * @param   int     $start      開始顯示的條數
 * @return  array
 */
function get_account_log($user_id, $num, $start)
{
    $account_log = array();
    $sql = 'SELECT * FROM ' . $GLOBALS['ecs']->table('user_account') . " WHERE user_id = '{$user_id}'" . " AND process_type " . db_create_in(array(SURPLUS_SAVE, SURPLUS_RETURN)) . " ORDER BY add_time DESC";
    $res = $GLOBALS['db']->selectLimit($sql, $num, $start);
    if ($res) {
        include_once 'includes/modules/payment/payment.php';
        $pay_obj = new payment();
        while ($rows = $GLOBALS['db']->fetchRow($res)) {
            $rows['add_time'] = local_date($GLOBALS['_CFG']['date_format'], $rows['add_time']);
            $rows['admin_note'] = nl2br(htmlspecialchars($rows['admin_note']));
            $rows['short_admin_note'] = $rows['admin_note'] > '' ? sub_str($rows['admin_note'], 30) : 'N/A';
            $rows['user_note'] = nl2br(htmlspecialchars($rows['user_note']));
            $rows['short_user_note'] = $rows['user_note'] > '' ? sub_str($rows['user_note'], 30) : 'N/A';
            $rows['pay_status'] = $rows['is_paid'] == 0 ? $GLOBALS['_LANG']['un_confirm'] : $GLOBALS['_LANG']['is_confirm'];
            $rows['amount'] = price_format(abs($rows['amount']), false);
            /* 會員的操作類型: 衝值,提現 */
            if ($rows['process_type'] == 0) {
                $rows['type'] = $GLOBALS['_LANG']['surplus_type_0'];
            } else {
                $rows['type'] = $GLOBALS['_LANG']['surplus_type_1'];
            }
            /* 支付方式的ID */
            /**2014-04-08 by hg/
               /* $sql = 'SELECT pay_id FROM ' .$GLOBALS['ecs']->table('payment').
                      " WHERE pay_name = '$rows[payment]' AND enabled = 1";
               $pid = $GLOBALS['db']->getOne($sql); */
            $pay_static = $pay_obj->order_set_and($rows['pay_num']);
            if (!empty($pay_static)) {
                $pid = $rows['pay_num'];
            } else {
                $pid = '';
            }
            /*end*/
            /* 如果是預付款而且還沒有付款, 允許付款 */
            if ($rows['is_paid'] == 0 && $rows['process_type'] == 0) {
                $rows['handle'] = '<a href="user.php?act=pay&id=' . $rows['id'] . '&pid=' . $pid . '">' . $GLOBALS['_LANG']['pay'] . '</a>';
            }
            $account_log[] = $rows;
        }
        return $account_log;
    } else {
        return false;
    }
}
開發者ID:dlpc,項目名稱:ecshop,代碼行數:54,代碼來源:lib_clips.php


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