Beispiel #1
0
/**
 * 调用
 *
 * @access  public
 * @return  string
 */
function insert_sale_history($arr)
{
    $need_cache = $GLOBALS['smarty']->caching;
    $need_compile = $GLOBALS['smarty']->force_compile;
    $GLOBALS['smarty']->caching = false;
    $GLOBALS['smarty']->force_compile = true;
    $cmt = assign_sale_history($arr['id']);
    $GLOBALS['smarty']->assign('sale_historys', $cmt['sale_historys']);
    $GLOBALS['smarty']->assign('pager', $cmt['pager']);
    $val = $GLOBALS['smarty']->fetch('library/sale_historys.lbi');
    $GLOBALS['smarty']->caching = $need_cache;
    $GLOBALS['smarty']->force_compile = $need_compile;
    return $val;
}
Beispiel #2
0
        $res['goods_pweight'] = $product_info['product_weight'] . ' 千克(kg)';
    } else {
        $res['goods_pweight'] = $goods_tinfo['goods_weight'];
    }
    $res['ecs_shopprice'] = price_format($shop_price);
    die($json->encode($res));
}
/*------------------------------------------------------ */
//-- 商品购买记录ajax处理
/*------------------------------------------------------ */
if (!empty($_REQUEST['act']) && $_REQUEST['act'] == 'gotopage') {
    $cmt = new stdClass();
    $cmt->id = !empty($_GET['id']) ? intval($_GET['id']) : 0;
    $cmt->page = isset($_GET['page']) && intval($_GET['page']) > 0 ? intval($_GET['page']) : 1;
    $result = array('error' => 0, 'message' => '', 'content' => '');
    $sale_historys = assign_sale_history($cmt->id, $cmt->page);
    $smarty->assign('id', $cmt->id);
    $smarty->assign('sale_historys', $sale_historys['sale_historys']);
    $smarty->assign('pager', $sale_historys['pager']);
    $result['content'] = $smarty->fetch("library/sale_historys.lbi");
    die(json_encode($result));
}
/*------------------------------------------------------ */
//-- PROCESSOR
/*------------------------------------------------------ */
$cache_id = $goods_id . '-' . $_SESSION['user_rank'] . '-' . $_CFG['lang'];
$cache_id = sprintf('%X', crc32($cache_id));
if (!$smarty->is_cached('goods.dwt', $cache_id)) {
    goods_promotion($goods_id, $smarty);
    // 积分购,vip购
    $smarty->assign('image_width', $_CFG['image_width']);