count(); } function getProductByCid($cid = 0 ,$p_type=1){//or p_type=".$p_type." ) return $this->find ( array ('asc' => 'orders', 'where' => 'cid=' . $cid." and p_type!=2 ", 'asArray' => TRUE ) ); } function getProductByCidAll($cid = 0 ){ return $this->find ( array ('asc' => 'orders', 'where' => ' cid=' . $cid." and p_type!=3 ", 'asArray' => TRUE ) ); } function getProductById($pid = 0 ) { return $this->find ( array ('asc' => 'time', 'where' => 'pid=' . $pid, 'asArray' => TRUE ) ); } function getProductList($data = array(), $condition = "", $limit = ""){ foreach ( $data as $key => $value ) { if (is_numeric ( $value )) $condition .= " and " . $key . " = " . $value; else $condition .= " and " . $key . " like '%" . $value . "%' "; } $condition = ' where 1 ' . $condition . $limit; $sql = "select * from " . $this->_table . $condition; $query = Doo::db ()->query ( $sql ); $result = $query->fetchAll (); return $result; } function deleteProductByIdList($id){ $id = implode ( ",", $id ); $sql = "delete from " . $this->_table . " where pid in ( " . $id . " )"; Doo::db ()->query ( $sql ); } } ?>