当前位置: 首页>>代码示例>>PHP>>正文


PHP Products::findAll方法代码示例

本文整理汇总了PHP中Products::findAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Products::findAll方法的具体用法?PHP Products::findAll怎么用?PHP Products::findAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Products的用法示例。


在下文中一共展示了Products::findAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elseif

    $conditions = NULL;
    $conditions[] = "iffree=1";
} elseif (isset($_GET['page']) && $_GET['page'] == 'all') {
    setvar("Page", 'all');
    $conditions = NULL;
}
if (isset($_GET['category'])) {
    if ($_GET['category'] != 0) {
        setvar("parent_id", $_GET['category']);
        $conditions[] = "Product.category_id=" . $_GET['category'];
    }
}
$conditions[] = "Product.status=1 ";
if (isset($_GET['p'])) {
    if ($_GET['p'] == 'pg-search' && trim($_GET['search']) != '') {
        $conditions[] = "Product.name like '%" . trim($_GET['search']) . "%'";
    }
}
$joins = null;
if ($device_id != '') {
    $joins[] = 'LEFT JOIN ' . $tb_prefix . 'productdevices d ON d.product_id=Product.id';
    //$conditions[] = "d.device_id='" . $device_id . "' ";
}
$amount = $product->findCount(null, $conditions, "Product.id");
$page->displaypg = 5;
$page->setPagenav($amount);
$result = $product->findAll("DISTINCT Product.cache_companyname AS companyname,Product.*", $joins, $conditions, "Product.ifcommend desc,Product.id desc", $page->firstcount, $page->displaypg);
$result = $product->formatResultWap($result);
setvar("Items", $result);
setvar("ByPages", $page->getPagenav());
template("index");
开发者ID:vuong93st,项目名称:w-game,代码行数:31,代码来源:index.php

示例2: flash

        }
    }
    if (($do == "del" || $_GET['act'] == "del") && !empty($id)) {
        $res = $product->read("id", $id);
        if ($res) {
            if (!$product->del($_GET['id'], $conditions)) {
                flash();
            }
        } else {
            flash("data_not_exists");
        }
    }
}
if (isset($_GET['typeid']) && !empty($_GET['typeid'])) {
    $conditions[] = "producttype_id = " . $_GET['typeid'];
}
$amount = $product->findCount(null, $conditions, "Product.id");
$page->setPagenav($amount);
$result = $product->findAll("sort_id,id,name,picture,content,created,status,state", null, $conditions, "Product.id DESC", $page->firstcount, $page->displaypg);
if ($result) {
    $i_count = count($result);
    for ($i = 0; $i < $i_count; $i++) {
        $result[$i]['image'] = pb_get_attachmenturl($result[$i]['picture'], '../', 'small');
    }
}
setvar("Items", $result);
setvar("nlink", $page->nextpage_link);
setvar("plink", $page->previouspage_link);
setvar("CheckStatus", explode(",", L('product_status', 'tpl')));
uaAssign(array("pagenav" => $page->getPagenav()));
template($tpl_file);
开发者ID:renduples,项目名称:alibtob,代码行数:31,代码来源:product.php

示例3: date

        }
        if ($_GET['FromDate'] && $_GET['FromDate'] != "None" && $_GET['ToDate'] && $_GET['ToDate'] != "None") {
            $condition = "Product.created BETWEEN ";
            $condition .= Times::dateConvert($_GET['FromDate']);
            $condition .= " AND ";
            $condition .= Times::dateConvert($_GET['ToDate']);
            $conditions[] = $condition;
        }
    }
}
$amount = $product->findCount(null, $conditions, "Product.id", null);
unset($joins);
$joins[] = "LEFT JOIN {$tb_prefix}companies c ON c.id=Product.company_id";
$page->setPagenav($amount);
//print_r($amount);
//exit;
$fields = "Product.id,Product.company_id AS CompanyID,c.id AS CID,c.name AS companyname,Product.name AS ProductName,Product.status AS ProductStatus,Product.created,Product.ifcommend as Ifcommend, Product.state as ProductState,Product.picture as ProductPicture ";
$result = $product->findAll($fields, $joins, $conditions, "Product.id DESC", $page->firstcount, $page->displaypg);
if (!empty($result)) {
    for ($i = 0; $i < count($result); $i++) {
        $result[$i]['pubdate'] = date("Y-m-d", $result[$i]['created']);
        if (!empty($result[$i]['picture'])) {
            $result[$i]['image'] = pb_get_attachmenturl($result[$i]['ProductPicture'], "../", "small");
        }
    }
}
setvar("Items", $result);
setvar("ByPages", $page->pagenav);
//print_r($page->pagenav);
//exit;
template($tpl_file);
开发者ID:vuong93st,项目名称:w-game,代码行数:31,代码来源:product.php

示例4: Pagination

        </tr>
      </thead>
    
      <tbody id="alter_rows">
       <?php 
$count_record = Products::countProducts(1);
if (!isset($_REQUEST['page'])) {
    $page = 1;
} else {
    $page = $_GET[page];
}
$pagination = new Pagination();
//for display
$pg = $pagination->page_pagination(20, $count_record, $page, 20);
//$result_prod = mysql_query($query_Recordset2.$pg[1]);
$product = Products::findAll($pg[1], 1);
?>
		  	<? if($count_record == 0) { ?>
            	  <tr>
                  	<td colspan="6" align="center" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#F00; font-weight:bold">No Record Found</td>
                  </tr>
            <? } else { 
					foreach($product as $products) { 
						$image = $products->fldProductsImage;
			?>		
                <tr>
                  <td> <?php 
echo $products->fldProductsId;
?>
 </td>
                  <td>
开发者ID:romackdnr,项目名称:dnrpiggyments,代码行数:31,代码来源:products_dashboard.php


注:本文中的Products::findAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。