Ejemplo n.º 1
0
    $products = Product::query($query);
    if (empty($products)) {
        $recommendHtml = "<b>暂无产品</b>";
    } else {
        foreach ($products as $product) {
            $recommendHtml .= sprintf("\n\t\t\t\t\t<dl class='l_m_prod'>\n\t\t\t\t\t\t<dd class='f_left'>\n\t\t\t\t\t\t\t<a href='pdetail.php?id=%u' title='%s'>\n\t\t\t\t\t\t\t\t<img src='%s' width='42' height='42' alt='%s' title='%s' class='mm' />\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</dd>\n\t\t\t\t\t\t<dt class='f_left' style='width:160px;'>\n\t\t\t\t\t\t\t<div class='nowrap'><a href='pdetail.php?id=%u' title='%s'>%s</a></div>\t\t\n\t\t\t\t\t\t\t<div><a href='%s' target='_blank'><img src='images/buy_s.png' width='70px' height='20px' alt='%s' /></a></div>\t\t\n\t\t\t\t\t\t</dt>\n\t\t\t\t\t</dl>", $product->productId, $product->productName, str_replace("../", "", $product->mImage), $product->productName, $product->productName, $product->productId, $product->productName, $product->productName, $product->aliUrl, $product->productName);
        }
    }
}
?>

<?php 
//产品类型
if ($sections["sort"] === 1) {
    $query = new Sort(25);
    $sorts = Sort::query($query);
    $sortMenu = "";
    if (empty($sorts)) {
        $sortMenu = "<b>暂无分类</b>";
    } else {
        foreach ($sorts as $sort) {
            $sortMenu .= sprintf("<dl><dt style=\"cursor: hand; float: left;\"><span class=\"l_m_item\"><a href=\"product.php?sort=%u\" target=\"_blank\">%s</a></span> </dt></dl>", $sort->sortId, $sort->sortName);
        }
    }
}
$company_name = Company::content("company_name");
$company_qq = Company::content("company_qq");
$official_site = Company::content("official_site");
$ali_wangwang = Company::content("ali_wangwang");
?>
<style>
Ejemplo n.º 2
0
        }
    }
    exit;
}
//读取产品类型数据
if ($module == "sort") {
    if ($dataType == "list" || $dataType == "count") {
        $query = new Sort($querySize);
        $query->isPaging = $isPaging;
        $query->querySize = $querySize;
        $query->curPage = $curPage;
        try {
            $data = null;
            $listJson = "";
            if ($dataType == "list") {
                $data = Sort::query($query);
                if (!empty($data)) {
                    $listJson = json_encode($data, JSON_UNESCAPED_UNICODE);
                } else {
                    $listJson = "[]";
                }
                Tool::logger(__METHOD__, __LINE__, sprintf("查询类型产品Json: %s", $listJson), _LOG_ERROR);
            } else {
                if ($dataType == "count") {
                    $listJson = Sort::rcount($query);
                    Tool::logger(__METHOD__, __LINE__, sprintf("查询产品类型总数: %s", $listJson), _LOG_ERROR);
                }
            }
            echo "{\"status\":\"true\", \"data\": " . $listJson . "}";
        } catch (Exception $e) {
            echo "{\"status\":\"false\", \"data\": \"" . $e->getMessage() . "\"}";