<?php
/*---------------------------------------------------------
 * File:advers.php
 * Author:Tomix
 * Description:
 * Created:2009
 * -------------------------------------------------------
 * Modified history:
 * -------------------------------------------------------
 * Copyright:
 * -------------------------------------------------------
 */
 require_once dirname(__FILE__)."/../dal/productDAL.php";
 require_once dirname(__FILE__)."/../currency.php";
 require_once dirname(__FILE__)."/../bin/system/utility.php";
 class adversProduct
 {
 	static private $dal;

 	//根据广告栏目取得广告信息集合
 	static public function getAdversProduct ($filter="",$orderExp,$start=0,$length=-1)
 	{
		if(!isset(self::$dal))
			self::$dal=new productDAL();
		if($filter=="")
		   $filter="a.Visible='1'";
		else
		   $filter="a.Visible='1' AND ".$filter;

 		 $data = self::$dal->executeRecordset($filter,$orderExp,$start,$length);

 	    for($i=0;$i<count($data);$i++)
 		{
		   // $data[$i]["Detail"]=string::substr($data[$i]["Detail"],0,42)."...";
		   $data[$i]["Name"]=string::cut_str($data[$i]["Name"],42);
 		}
 		return $data;
	}

 }
?>
