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