本文整理汇总了PHP中Page::getBegin方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::getBegin方法的具体用法?PHP Page::getBegin怎么用?PHP Page::getBegin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page::getBegin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actOrder
function actOrder()
{
global $ST, $get;
$pg = new Page($this->getPages());
$data = array();
$cond = '';
// if($from=$this->getFilter('from')){
// $cond.=" AND create_time>='".dte($from,'Y-m-d')."'";
// }
// if($to=$this->getFilter('to')){
// $cond.=" AND create_time<='".dte($to,'Y-m-d')."'";
// }
if ($from = $this->getFilter('from')) {
$cond .= " AND date>='" . dte($from, 'Y-m-d') . "'";
}
if ($to = $this->getFilter('to')) {
$cond .= " AND date<='" . dte($to, 'Y-m-d') . "'";
}
if (!in_array($this->getFilter('order_status'), array('all', ''))) {
$order_status = (int) $this->getFilter('order_status');
$cond .= " AND order_status=" . $order_status;
}
if ($get->exists('order_status')) {
$cond .= " AND order_status={$get->getInt('order_status')}";
}
if ($this->getURIVal('pay_system')) {
$cond .= " AND pay_system='{$this->getURIVal('pay_system')}'";
}
// if($reg=$this->getUser('region')){//Привязка к региону админа
// $condition.=" AND o.region IN('".implode("','",explode(',',$reg))."')";
// }
$query = "SELECT count(*) AS c FROM sc_shop_order AS o WHERE 1=1 " . $cond;
$rs = $ST->select($query);
if ($rs->next()) {
$pg->all = $rs->getInt('c');
}
$queryStr = "SELECT o.*, u.name AS u_name,u.phone AS u_phone, u.last_name AS last_name, u.first_name AS first_name, u.middle_name AS middle_name,u.type,d.value_desc AS delivery_type,p.value_desc AS pay_system FROM sc_shop_order AS o\r\n\t\t\tLEFT JOIN sc_users AS u ON u.u_id=o.userid\r\n\t\t\tLEFT JOIN (SELECT field_value,value_desc FROM sc_enum WHERE field_name='sh_delivery_type') AS d ON d.field_value=o.delivery_type\r\n\t\t\tLEFT JOIN (SELECT field_value,value_desc FROM sc_enum WHERE field_name='sh_pay_system') AS p ON p.field_value=o.pay_system\r\n\t\t\tWHERE 1=1 {$cond} \r\n\t\t\tORDER BY o.create_time DESC \r\n\t\t\tLIMIT " . $pg->getBegin() . "," . $pg->per;
$queryStr = "SELECT o.*, u.name AS u_name,u.phone AS u_phone, u.last_name AS last_name, u.first_name AS first_name, u.middle_name AS middle_name,u.type,d.value_desc AS delivery_type,p.value_desc AS pay_system,ps.value_desc AS pay_status FROM sc_shop_order AS o\r\n\t\t\tLEFT JOIN sc_users AS u ON u.u_id=o.userid\r\n\t\t\tLEFT JOIN (SELECT field_value,value_desc FROM sc_enum WHERE field_name='sh_delivery_type') AS d ON d.field_value=o.delivery_type\r\n\t\t\tLEFT JOIN (SELECT field_value,value_desc FROM sc_enum WHERE field_name='sh_pay_system') AS p ON p.field_value=o.pay_system\r\n\t\t\tLEFT JOIN (SELECT field_value,value_desc FROM sc_enum WHERE field_name='sh_pay_status') AS ps ON ps.field_value=o.pay_status\r\n\t\t\tWHERE 1=1 {$cond} \r\n\t\t\tORDER BY o.create_time DESC \r\n\t\t\tLIMIT " . $pg->getBegin() . "," . $pg->per;
$rs = $ST->select($queryStr);
$data['rs'] = array();
while ($rs->next()) {
$data['rs'][$rs->getInt('id')] = $rs->getRow();
if ($order_data = getJSON($rs->get('order_data'))) {
$data['rs'][$rs->getInt('id')] += $order_data;
}
// $data['rs'][$rs->getInt('id')]['perforder']=$this->getPerfOrder($rs->getInt('id'));
}
// $data['delivery_type_list']=$this->delivery_type_list;
$data['delivery_type_list'] = $this->enum('sh_delivery_type');
$data['pay_system_list'] = $this->enum('sh_pay_system');
$data['order_status'] = $this->getOrderStatus();
$data['status_list'] = $this->renderStatusList();
$data['pg'] = $pg;
// $data['pglist']=$this->renderPgList();
$this->display($data, dirname(__FILE__) . '/admin_order.tpl.php');
}
示例2: actDefault
function actDefault()
{
$data = array('category' => 0);
$page = new Page($this->cfg('PAGE_SIZE'));
$condition = "b.status=1 AND date_to>='" . date('Y-m-d') . "'";
if ($c = $this->getUriIntVal('catalog')) {
$condition .= " AND b.category={$c}";
$rs = DB::select("SELECT * FROM sc_shop_catalog WHERE id={$c}");
if ($rs->next()) {
$this->setPageTitle($rs->get('name'));
}
$data['category'] = $c;
}
if ($this->getUriIntVal('my')) {
$condition .= " AND b.userid={$this->getUserId()}";
}
$queryStr = "SELECT COUNT(*) as c FROM sc_shop_board b WHERE {$condition}";
$rs = DB::select($queryStr);
if ($rs->next()) {
$page->all = $rs->getInt("c");
}
$order = " ORDER BY time DESC";
$queryStr = "SELECT b.*,u.name,c.name AS c_name,c.id AS c_id FROM sc_shop_board b\r\n\t\t\tLEFT JOIN sc_users u ON u.u_id=b.userid \r\n\t\t\tLEFT JOIN sc_shop_catalog c ON c.id=b.category \r\n\t\tWHERE {$condition} {$order} LIMIT " . $page->getBegin() . "," . $page->per;
$rs = DB::select($queryStr)->toArray();
$data['rs'] = $rs;
$data['pg'] = $page;
$data['catalog_tree'] = LibCatalog::getInstance()->getCatalogTree();
$data['date_to'] = date('Y-m-d', time() + 3600 * 24 * 30);
$this->setCommonCont();
$this->display($data, dirname(__FILE__) . '/board.tpl.php');
}
示例3: actDefault
function actDefault()
{
global $ST;
if ($id = $this->getURIIntVal($this->getType())) {
$this->actView();
return;
}
$page = new Page($this->cfg('PAGE_SIZE'));
// $page=new Page(2);
$condition = "state='public' AND type='" . $this->getType() . "'";
if ($c = $this->getURIIntVal('category')) {
$condition .= " AND category={$c}";
}
$queryStr = "SELECT COUNT(*) as c FROM sc_news WHERE {$condition}";
$rs = $ST->select($queryStr);
if ($rs->next()) {
$page->all = $rs->getInt("c");
}
$order = " ORDER BY date DESC,position DESC";
if ($this->getType() == 'article') {
$order = " ORDER BY position DESC, view DESC";
}
$queryStr = "SELECT *,value_desc AS category_desc FROM sc_news n\r\n\t\tLEFT JOIN (SELECT field_value,value_desc FROM sc_enum WHERE field_name='" . $this->getType() . "_category') AS c ON c.field_value=n.category\r\n\t\tWHERE {$condition} {$order} LIMIT " . $page->getBegin() . "," . $page->per;
$rs = $ST->select($queryStr)->toArray();
$data = array('rs' => $rs, 'pg' => $page);
$data['category_list'] = $this->enum("{$this->getType()}_category");
$this->setCommonCont();
if ($tpl = $this->getTpl($this->getType() . '.tpl.php')) {
$this->display($data, $tpl);
} else {
$this->display($data, $this->getTpl('news.tpl.php'));
}
}
示例4: actDefault
function actDefault()
{
global $ST;
if ($id = $this->getURIIntVal($this->getType())) {
$this->actView();
return;
}
$page = new Page($this->cfg('PAGE_SIZE'));
// $page=new Page(2);
$condition = "state='public' AND type='" . $this->getType() . "'";
$queryStr = "SELECT COUNT(*) as c FROM sc_news WHERE {$condition}";
$rs = $ST->select($queryStr);
if ($rs->next()) {
$page->all = $rs->getInt("c");
}
$order = " ORDER BY date DESC,position DESC";
if ($this->getType() == 'article') {
$order = " ORDER BY position DESC, view DESC";
}
$queryStr = "SELECT * FROM sc_news \r\n\t\tWHERE {$condition} {$order} LIMIT " . $page->getBegin() . "," . $page->per;
$rs = $ST->select($queryStr)->toArray();
$data = array('rs' => $rs, 'pg' => $page);
if ($tpl = $this->getTpl($this->getType() . '.tpl.php')) {
$this->display($data, $tpl);
} else {
$this->display($data, $this->getTpl('news.tpl.php'));
}
}
示例5: actDefault
function actDefault()
{
global $ST;
if (preg_match('|^/([^/]+)|', $this->getURI(), $res)) {
$this->type = $this->getType();
}
$page = new Page($this->cfg('PAGE_SIZE'));
$condition = "state='public' AND type='" . $this->type . "'";
$queryStr = "SELECT COUNT(*) as c FROM sc_faq WHERE {$condition}";
$rs = $ST->select($queryStr);
if ($rs->next()) {
$page->all = $rs->getInt("c");
}
$order = " ORDER BY pos DESC,time";
$queryStr = "SELECT * FROM sc_faq WHERE {$condition} {$order} LIMIT " . $page->getBegin() . "," . $page->per;
$rs = $ST->select($queryStr)->toArray();
$data = array('rs' => $rs, 'pg' => $page);
$data['theme_list'] = $this->enum("{$this->type}_theme");
$this->setCommonCont();
if (file_exists(dirname(__FILE__) . '/' . $this->type . '.tpl.php')) {
$this->display($data, dirname(__FILE__) . '/' . $this->type . '.tpl.php');
} else {
$this->display($data, dirname(__FILE__) . '/faq.tpl.php');
}
}
示例6: actView
function actView($id = 0)
{
global $ST;
$type = trim($this->mod_uri, '/');
$rs = $ST->select("SELECT * FROM sc_gallery WHERE id=" . $id);
if ($rs->next()) {
$data = $rs->getRow();
$data['pg'] = $pg = new Page($this->cfg('PAGE_SIZE'));
// $data['pg']=$pg=new Page(3);
$this->setPageTitle($rs->get('name'));
$data['images'] = array();
$pg->all = 0;
$images = array();
$rs = $ST->select("SELECT * FROM sc_gallery_img WHERE gallery_id={$id} ORDER BY pos");
while ($rs->next()) {
$images[] = $rs->getRow();
}
if ($images) {
$pg->all = count($images);
$data['images'] = array_slice($images, $pg->getBegin(), $pg->per);
}
$data['label_list'] = $ST->select("SELECT gl.*,l.value_desc AS l_desc FROM sc_gallery_label gl\r\n\t\t\t\tLEFT JOIN (SELECT * FROM sc_enum WHERE field_name='gal_{$type}_label') AS l ON l.field_value=gl.label_id\r\n\t\t\tWHERE gallery_id={$id}")->toArray();
}
$this->setCommonCont();
$tpl = dirname(__FILE__) . '/' . $type . '_view.tpl.php';
if (file_exists($tpl)) {
$this->display($data, $tpl);
return;
}
$this->display($data, dirname(__FILE__) . '/gallery_view.tpl.php');
}
示例7: getOrder
function getOrder($arh = false, $id = 0)
{
include 'modules/catalog/Basket.class.php';
global $ST;
$status_list = $this->getOrderStatus();
$data = array('arh' => $arh, 'ps' => array());
$condition = "userid=" . $this->getUserId() . "";
if ($arh !== null) {
if ($arh) {
$condition .= " AND order_status NOT IN (0,1)";
} else {
$condition .= " AND order_status IN (0,1)";
}
}
if ($id) {
$condition .= " AND id={$id}";
}
/*$ps=array();
$rs=$ST->select("SELECT * FROM sc_pay_system");
while ($rs->next()) {
$class="PS".ucfirst($rs->get('name'));
$ps[$rs->get('name')]=new $class(unserialize($rs->get('config')));
// $ps[$rs->get('name')]->setType('pay');
// $ps[$rs->get('name')]->setUserId($this->getUserId());
// $ps[$rs->get('name')]->setEmail($this->getUser('mail'));
}
$ps['payonline']->ReturnUrl='/cabinet/order/';
$ps['payonline']->params['UserId']=$this->getUserId();;
$data['ps']=&$ps;*/
$pg = new Page(5);
$rs = $ST->select("SELECT COUNT(id) AS c FROM sc_shop_order WHERE {$condition}");
if ($rs->next()) {
$pg->all = $rs->getInt('c');
}
$queryStr = "SELECT * FROM sc_shop_order \r\n\t\t\tWHERE {$condition} \r\n\t\t\tORDER BY id DESC LIMIT " . $pg->getBegin() . ', ' . $pg->per;
$rs = $ST->select($queryStr);
$data['rs'] = array();
while ($rs->next()) {
$data['rs'][$rs->getInt('id')] = $rs->getRow();
$data['rs'][$rs->getInt('id')]['order_status_desc'] = @$status_list[$rs->get('order_status')];
$orderItem = array();
$rs1 = $ST->select("SELECT oi.*,i.name,i.img,i.description,i.category\r\n\t\t\t\tFROM sc_shop_order_item AS oi\r\n\t\t\t\t\r\n\t\t\t\tLEFT JOIN sc_shop_item AS i ON i.id=oi.itemid\r\n\t\t\t\tLEFT JOIN sc_shop_catalog AS c ON c.id=i.category\r\n\t\t\t\tLEFT JOIN sc_shop_proposal AS p ON oi.proposalid=p.id \r\n\t\t\t\tWHERE oi.orderid=" . $rs->getInt('id'));
while ($rs1->next()) {
$orderItem[] = array('id' => $rs1->get('itemid'), 'proposalid' => $rs1->get('proposalid'), 'img' => $rs1->get('img'), 'name' => $rs1->get('name'), 'description' => $rs1->get('description'), 'count' => $rs1->get('count'), 'price' => $rs1->get('price'), 'sum' => $rs1->get('price') * $rs1->get('count'));
}
$basket = new Basket($orderItem);
$basket->delivery = $rs->get('delivery');
$basket->discount = $rs->get('discount');
$data['rs'][$rs->getInt('id')]['orderContent'] = $this->render(array('orderContent' => $basket, 'date' => $rs->get('create_time'), 'arh' => $arh, 'id' => $rs->getInt('id')), dirname(__FILE__) . '/ordercontent.tpl.php');
// foreach ($ps as $ps_name=>$pay_system) {
//// $pay_system->setOrderNum($rs->getInt('id'));
//// $pay_system->setSumm($rs->getInt('total_price'));
// $data['rs'][$rs->getInt('id')]['ps'][$ps_name]=$pay_system;
// }
}
$data['pg'] = $pg;
return $data;
}
示例8: actDefault
function actDefault()
{
global $ST;
$data = array('pg' => &$pg, 'form' => trim($this->mod_alias, '/'));
$pg = new Page($this->getPages());
$queryStr = "SELECT count(*) AS c FROM sc_forms";
$rs = $ST->select($queryStr);
if ($rs->next()) {
$pg->all = $rs->getInt("c");
}
$order = "ORDER BY id DESC";
$queryStr = "SELECT *,t.value_desc AS type_desc,s.value_desc AS status_desc\r\n\t\t\tFROM (SELECT * FROM sc_forms {$order} LIMIT " . $pg->getBegin() . "," . $pg->per . ") AS c \r\n\t\t\tLEFT JOIN (SELECT field_value,value_desc FROM sc_enum WHERE field_name='f_type') AS t ON t.field_value=c.form::varchar\r\n\t\t\tLEFT JOIN (SELECT field_value,value_desc FROM sc_enum WHERE field_name='f_status') AS s ON s.field_value=c.status::varchar \r\n\t\t";
$this->rs = $ST->select($queryStr);
$this->display($data, dirname(__FILE__) . '/admin_forms.tpl.php');
}
示例9: actDefault
function actDefault()
{
global $ST, $get;
$this->search = $get->getString('search');
if (empty($this->search)) {
header('Location: /');
exit;
}
$data = array('rs' => array(), 'type_search' => '');
if ($data['type_search'] = $type_search = $this->getURIVal('search')) {
if (isset($this->result[$type_search])) {
$pg = new Page();
$query = $this->getQuery($type_search);
$rs = $ST->select($query[1]);
if ($rs->next()) {
$pg->all = $rs->getInt('c');
}
$rs = $ST->select($query[0] . ' LIMIT ' . $pg->getBegin() . ',' . $pg->per);
while ($rs->next()) {
$data['rs'][] = $rs->getRow();
}
$data['href'] = $query[2];
$data['title'] = $query[3];
$data['pg'] = $pg;
} else {
header('Location: /');
exit;
}
} else {
foreach ($this->result as $key => $result) {
$query = $this->getQuery($key);
$rs = $ST->select($query[1]);
if ($rs->next()) {
$data['rs'][$key]['count'] = $rs->getInt('c');
}
$rs = $ST->select($query[0] . ' LIMIT ' . $this->type_size);
while ($rs->next()) {
$data['rs'][$key]['result'][] = $rs->getRow();
}
$data['rs'][$key]['href'] = $query[2];
$data['rs'][$key]['title'] = $query[3];
}
}
$this->setCommonCont();
$this->display($data, dirname(__FILE__) . '/search.tpl.php');
}
示例10: actDefault
function actDefault()
{
global $ST;
$pg = new Page(10);
$data = array();
$rs = $ST->select("SELECT field_value,value_desc FROM sc_enum WHERE field_name='fb_score' ORDER BY position DESC");
while ($rs->next()) {
$data['score'][] = $rs->getRow();
}
$rs = $ST->select("SELECT COUNT(*) AS c FROM sc_guestbook WHERE status=1");
while ($rs->next()) {
$pg->all = $rs->getInt('c');
}
$data['rs'] = $ST->select("SELECT * FROM sc_guestbook WHERE status=1 ORDER BY time LIMIT {$pg->getBegin()},{$pg->per}")->toArray();
$data['pg'] = $pg;
$this->display($data, dirname(__FILE__) . '/guestbook.tpl.php');
}
示例11: actDefault
function actDefault()
{
global $ST;
$pg = new Page($this->cfg('PAGE_SIZE'));
$data = array('rs' => array(), 'pg' => &$pg);
$condition = "type='feedback' AND status=1";
$queryStr = "SELECT COUNT(*) as c FROM sc_feedback WHERE {$condition}";
$rs = $ST->select($queryStr);
if ($rs->next()) {
$pg->all = $rs->getInt("c");
}
$rs = $ST->select("SELECT * FROM sc_feedback WHERE {$condition} ORDER BY id DESC LIMIT " . $pg->getBegin() . "," . $pg->per);
while ($rs->next()) {
$data['rs'][] = $rs->getRow();
}
$data['FB_CAN_SEND_MSG'] = $this->cfg('FB_CAN_SEND_MSG') == 'true';
$this->setCommonCont();
$this->display($data, dirname(__FILE__) . '/feedback.tpl.php');
}
示例12: Page
<?php
include "../include/database.inc";
include "../include/common.inc";
include "../include/page.inc";
$id = $_GET['id'];
$pageNo = $_GET['pageNo'];
$seac_i = $_GET['seac_i'];
$seac_t = $_GET['seac_t'];
$page = new Page();
if ($pageNo) {
$page->pageNo = $pageNo;
}
$page->pagename = "list.php?id={$id}&";
$menuT = getTableById("menu", $id);
$seac_sql = $seac_i ? " and " . $seac_t . " like '%" . $seac_i . "%' " : "";
$list = getTableByConList("content", "menu = {$id} " . $seac_sql . " order by in_date desc limit " . $page->getBegin() . ",{$page->pageSize}");
$page->pageCount = getTableCount("content", "menu = {$id} " . $seac_sql);
$menu = getTableByConList("menuset", "id = {$id} and isIndex = 1");
$menuAll = getTableByConList("menuset", "id = {$id}");
?>
<body>
<div class="commonDiv">
<div class="commontop">模块【<?php
echo $menuT->menuname;
?>
】</div>
<table border="0" align="center" cellpadding="0" cellspacing="0" class="commonTable" >
<tr>
<th width="100" height="28">序号</th>
<th width="150">标题</th>
<?php
示例13: actSubscribe
function actSubscribe()
{
$page = new Page($this->getPages());
parent::refresh();
$cond = " WHERE 1=1 ";
$query = "SELECT count(*) AS c FROM sc_subscribe " . $cond;
$rs = DB::select($query);
if ($rs->next()) {
$page->all = $rs->getInt('c');
}
$order = 'ORDER BY ';
$ord = $this->getURIVal('ord') != 'asc' ? 'asc' : 'desc';
if (in_array($this->getURIVal('sort'), array('login', 'mail'))) {
$order .= $this->getURIVal('sort') . ' ' . $ord;
} else {
$order .= " mail";
}
$data = array();
$queryStr = "SELECT s.*,u.login FROM sc_subscribe s\r\n\t\tLEFT JOIN sc_users u ON s.mail=u.mail\r\n\t\t\r\n\t\t{$cond} {$order} LIMIT " . $page->getBegin() . "," . $page->per;
$data['rs'] = DB::select($queryStr);
$data['pg'] = $page;
$this->setPageTitle('Подписка');
$this->display($data, dirname(__FILE__) . '/subscribe.tpl.php');
}
示例14: actOrdersPopup
function actOrdersPopup()
{
global $ST, $post;
$status = 5;
$pg = new Page(isset($_COOKIE['pages']) && $_COOKIE['pages'] ? intval($_COOKIE['pages']) : 15);
$cond = "order_status={$status}";
if ($status > 1) {
$cond .= " AND perfid IN(" . $this->getUserId() . ")";
}
$order = "create_time DESC";
$rs = $ST->select("SELECT COUNT(*) AS c FROM sc_shop_order WHERE {$cond}");
if ($rs->next()) {
$pg->all = $rs->getInt('c');
}
$rs = $ST->select("SELECT * FROM sc_shop_order o \r\n\t\t\tWHERE {$cond}\r\n\t\t\tORDER BY {$order} \r\n\t\t\tLIMIT {$pg->getBegin()},{$pg->per}")->toArray();
$data = array('pg' => $pg, 'rs' => $rs);
$data['PAGE_SELECT'] = $this->render(array('list' => array(20, 50, 100, 500, 1000), 'current' => $this->popupPageSize), dirname(__FILE__) . '/pages_select.tpl.php');
$this->tplContainer = 'core/tpl/admin/admin_popup.php';
$this->display($data, dirname(__FILE__) . '/orders_popup.tpl.php');
}
示例15: displayGoods
//.........这里部分代码省略.........
// $order.='sort DESC,name';
// $order.='category,views DESC,name';
$order .= 'sort DESC,name';
if ($this->getURIVal('price')) {
$order = 'price DESC';
}
if ($this->getURIVal('catalog') == 'new') {
$order = 'sort3 DESC';
}
$ord = $this->getURIVal('ord');
if (in_array($ord, array('price', 'manufacturer', 'name', 'views', 'sort1', 'sort2', 'sort3'))) {
$order = $ord . ' ' . $sort;
}
if ($ord == 'hit') {
$order = 'sort2 DESC';
}
if ($ord == 'updated') {
$order = 'sort_print DESC';
}
if ($ord == 'default') {
$order = 'sort DESC, name ' . $sort;
$order = 'name ' . $sort;
if ($show) {
$order = "{$sh_arr[$show]} DESC, name " . $sort;
}
}
// $queryStr="SELECT i.*,coalesce(cn.c,0) AS cnt FROM sc_shop_item i
// LEFT JOIN(SELECT COUNT(itemid) AS c,itemid FROM sc_shop_order_item oi,sc_shop_order o WHERE o.id=oi.orderid AND o.order_status=8 GROUP BY itemid) AS cn ON cn.itemid=i.id,
// sc_shop_offer of
// $condition $man_condition $p_condition $prop_condition ORDER BY $order LIMIT ".$page->getBegin().",".$page->per ;
// $queryStr="SELECT i.* FROM sc_shop_item i,
// sc_shop_offer of
// $condition $man_condition $p_condition $prop_condition $s_condition ORDER BY $order LIMIT ".$page->getBegin().",".$page->per ;
$queryStr = "SELECT i.*,r,c FROM sc_shop_item i\r\n\t\t\r\n\t\tLEFT JOIN(SELECT COUNT(DISTINCT commentid) AS c,AVG(rating) AS r,itemid FROM sc_comment,sc_comment_rait r \r\n\t\t\t\t\tWHERE commentid=id AND TRIM(comment)<>'' AND status=1 AND type IN('','goods') GROUP BY itemid) AS rait ON rait.itemid=i.id\r\n\t\t\t\r\n\t\t\r\n\t\t{$condition} {$man_condition} {$p_condition} {$prop_condition} {$s_condition} ORDER BY {$order} LIMIT " . $page->getBegin() . "," . $page->per;
$data['manufacturer_list'] = array();
$data['type_list'] = array();
$data['prop_list'] = array();
$data['show_list'] = array(0, 0, 0);
$data['min_max_price'] = array(0, 0, 0, 0);
// $q_vendor="SELECT DISTINCT manufacturer FROM sc_shop_item i,sc_shop_offer of $condition AND manufacturer<>''";
// $rs=$ST->select($q_vendor);
// while ($rs->next()) {
// $data['manufacturer_list'][]=$rs->get('manufacturer');
// }
// if(count($data['manufacturer_list'])<2){
// $data['manufacturer_list']=array();
// }
$q_vendor = "SELECT m.name,m.id,COUNT(m.id) AS c FROM sc_shop_item i,sc_manufacturer m {$condition} AND i.manufacturer_id=m.id GROUP BY m.name,m.id";
$rs = $ST->select($q_vendor);
while ($rs->next()) {
$data['manufacturer_list'][] = $rs->getRow();
}
// $this->data=&$data;
$rs = $ST->select($queryStr);
$data['catalog'] = array();
$data['page'] = $page;
$units = $this->enum('sh_unit');
while ($rs->next()) {
$row = $rs->getRow();
// if($row['pack_size']>1){
// $row['price_pack']=$row['price']*$row['pack_size']*$discount;
// }
$row['unit'] = @$units[$row['unit']];
// if($row['sort']>0){
// $row['hit']=true;
// }