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


PHP coupon::getCouponsConditions方法代碼示例

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


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

示例1: isset

    $page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
    /* 獲取用戶留言的數量 */
    $sql = "SELECT COUNT(*) FROM " . $ecs->table('comment') . " WHERE parent_id = 0 AND user_id = '{$user_id}'";
    $record_count = $db->getOne($sql);
    $pager = get_pager('user.php', array('act' => $action), $record_count, $page, 15);
    $rank = get_rank_info();
    $smarty->assign('info', get_user_default($user_id));
    //用戶信息
    $smarty->assign('vip_name', $rank['rank_name']);
    // 用戶名
    $smarty->assign('comment_list', get_comment_list($user_id, $pager['size'], $pager['start']));
    $smarty->assign('pager', $pager);
    $smarty->display('user_clips.dwt');
} elseif ($action == 'coupons') {
    require_once 'includes/cls_coupon.php';
    $couponsConditions = coupon::getCouponsConditions();
    $coupons_list = array();
    foreach ($couponsConditions as $key => $con) {
        $coupons_list[$key] = get_coupons_list($user_id, $key, $con);
    }
    $smarty->assign('coupons_list', $coupons_list);
    $smarty->display('user_clips.dwt');
} elseif ($action == 'return_goods') {
    include_once ROOT_PATH . 'includes/lib_clips.php';
    $page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
    /* 獲取用戶退款申請的總記錄數 */
    $sql = "SELECT COUNT(*) FROM " . $ecs->table('back_order') . " WHERE is_cancled=0 and user_id=" . $user_id;
    $record_count = $db->getOne($sql);
    $pager = get_pager('user.php', array('act' => $action), $record_count, $page, 5);
    $rank = get_rank_info();
    $smarty->assign('info', get_user_default($user_id));
開發者ID:norain2050,項目名稱:benhu,代碼行數:31,代碼來源:user.php

示例2: die

            $result['coupon_id'] = $coupon_id;
            $result['info'] = '您已經成功領取。';
            $result['action'] = ' 您還可以<a href="#">查看我的購物券</a>&nbsp;&nbsp;&nbsp;<a href="' . $staticPages['index'] . '">現在去購物</a>';
        } else {
            $result['error'] = 1;
            $result['info'] = '未知錯誤。';
            $result['action'] = ' 您可以嘗試再次領取,或者聯係客服!';
        }
    }
    die(json_encode($result));
} elseif ('userCenterGotoPage' == $act) {
    require_once 'includes/cls_coupon.php';
    require_once 'includes/lib_clips.php';
    $type = trim($_REQUEST['type']);
    $page = intval(trim($_REQUEST['page']));
    $couponCon = coupon::getCouponsConditions($type);
    $coupons = get_coupons_list($_SESSION['user_id'], $type, $couponCon, $page);
    $result = array('location' => 'coupons', 'type' => $type, 'coupons' => $coupons);
    die(json_encode($result));
}
function get_coupons_sql()
{
    $sql = "SELECT * FROM " . $GLOBALS['ecs']->table('coupons') . " WHERE is_display = 1 ORDER BY coupon_id DESC LIMIT 9";
    return $sql;
}
function get_coupons()
{
    $sql = get_coupons_sql();
    $coupons = $GLOBALS['db']->getAll($sql);
    foreach ($coupons as $key => $value) {
        $coupons[$key]['validate_time'] = local_date("Y年m月d日", $value['validate_time']);
開發者ID:norain2050,項目名稱:benhu,代碼行數:31,代碼來源:coupons.php


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