成人性生交大片免费看视频r_亚洲综合极品香蕉久久网_在线视频免费观看一区_亚洲精品亚洲人成人网在线播放_国产精品毛片av_久久久久国产精品www_亚洲国产一区二区三区在线播_日韩一区二区三区四区区区_亚洲精品国产无套在线观_国产免费www

主頁 > 知識(shí)庫 > 高效mongodb的php分頁類(不使用skip)

高效mongodb的php分頁類(不使用skip)

熱門標(biāo)簽:徐州ai電銷機(jī)器人原理 機(jī)器人外呼系統(tǒng)軟件存在問題 高德地圖標(biāo)注商戶位置 企業(yè)智能外呼系統(tǒng)價(jià)格多少 福州電銷機(jī)器人源代碼 沈陽營銷電銷機(jī)器人招商 智能電銷機(jī)器人銷售話術(shù) 兗州電話外呼營銷系統(tǒng) 南京400電話怎樣辦理

mongodb分頁skip+limit分頁要先查出所有結(jié)果再去跳過,這樣如果查詢頁面越往后效率越低。

如果能夠通過查詢條件查出每頁結(jié)果的最后一條記錄,在用最后一條記錄作為查詢條件去查下一頁,這樣每次都查詢頁面size條記錄,效率不會(huì)差。

具體代碼如下:包含mongodb.class.php, page.class.php, test.php

mongodb.class.php mongodb 操作類

復(fù)制代碼 代碼如下:

?php
function show_error($message, $status_code = 500, $heading = 'An Error Was Encountered')
{
        echo $message, $status_code,PHP_EOL;
        exit;
}

//MongoDB操作類
class DB
{

 private $CI;
 private $config_file = 'MongoDB';

 private $connection;
 private $db;
 private $connection_string;

 private $collection = '';
 private $host;
 private $port;
 private $user;
 private $pass;
 private $dbname;
 private $key;
 private $persist;
 private $persist_key;

 private $selects = array();
 private $wheres = array();
 private $sorts = array();
 private $page_sorts = array();

 private $limit = 999999;
 private $offset = 0;
 

 /**
  * --------------------------------------------------------------------------------
  * CONSTRUCTOR
  * --------------------------------------------------------------------------------
  *
  * Automatically check if the Mongo PECL extension has been installed/enabled.
  * Generate the connection string and establish a connection to the MongoDB.
  */

 public function __construct($MONGODB_CONFIG)
 {
  if(!class_exists('Mongo'))
  {
   show_error("The MongoDB PECL extension has not been installed or enabled", 500);
  }
  /**
        $config['mongo_host'] = '221.234.43.144';
        $config['mongo_port'] = 27017;
        $config['mongo_db'] = 'test';
        $config['mongo_user'] = '';
        $config['mongo_pass'] = '';
        $config['mongo_persist'] = TRUE;
         *
         */
  $this->connection_string($MONGODB_CONFIG);
  $this->connect();
 }

 

 /**
  * --------------------------------------------------------------------------------
  * Switch_db
  * --------------------------------------------------------------------------------
  *
  * Switch from default database to a different db
  */

 public function switch_db($database = '')
 {
  if(empty($database))
  {
   show_error("To switch MongoDB databases, a new database name must be specified", 500);
  }
  $this->dbname = $database;
  try
  {
   $this->db = $this->connection->{$this->dbname};
   return(TRUE);
  }
  catch(Exception $e)
  {
   show_error("Unable to switch Mongo Databases: {$e->getMessage()}", 500);
  }
 }

 /**
  * --------------------------------------------------------------------------------
  * SELECT FIELDS
  * --------------------------------------------------------------------------------
  *
  * Determine which fields to include OR which to exclude during the query process.
  * Currently, including and excluding at the same time is not available, so the
  * $includes array will take precedence over the $excludes array.  If you want to
  * only choose fields to exclude, leave $includes an empty array().
  *
  * @usage: $this->mongo_db->select(array('foo', 'bar'))->get('foobar');
  */

 public function select($includes = array(), $excludes = array())
 {
   if(!is_array($includes))
   {
    $includes = array();
   }

   if(!is_array($excludes))
   {
    $excludes = array();
   }

   if(!empty($includes))
   {
    foreach($includes as $col)
    {
     $this->selects[$col] = 1;
    }
   }
   else
   {
    foreach($excludes as $col)
    {
     $this->selects[$col] = 0;
    }
   }
   return($this);
 }

 /**
  * --------------------------------------------------------------------------------
  * WHERE PARAMETERS
  * --------------------------------------------------------------------------------
  *
  * Get the documents based on these search parameters.  The $wheres array should
  * be an associative array with the field as the key and the value as the search
  * criteria.
  *
  * @usage = $this->mongo_db->where(array('foo' => 'bar'))->get('foobar');
  */

  public function where($wheres = array())
  {
   foreach($wheres as $wh => $val)
   {
    $this->wheres[$wh] = $val;
   }
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * WHERE_IN PARAMETERS
  * --------------------------------------------------------------------------------
  *
  * Get the documents where the value of a $field is in a given $in array().
  *
  * @usage = $this->mongo_db->where_in('foo', array('bar', 'zoo', 'blah'))->get('foobar');
  */

  public function where_in($field = "", $in = array())
  {
   $this->where_init($field);
   $this->wheres[$field]['$in'] = $in;
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * WHERE_NOT_IN PARAMETERS
  * --------------------------------------------------------------------------------
  *
  * Get the documents where the value of a $field is not in a given $in array().
  *
  * @usage = $this->mongo_db->where_not_in('foo', array('bar', 'zoo', 'blah'))->get('foobar');
  */

  public function where_not_in($field = "", $in = array())
  {
   $this->where_init($field);
   $this->wheres[$field]['$nin'] = $in;
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * WHERE GREATER THAN PARAMETERS
  * --------------------------------------------------------------------------------
  *
  * Get the documents where the value of a $field is greater than $x
  *
  * @usage = $this->mongo_db->where_gt('foo', 20);
  */

  public function where_gt($field = "", $x)
  {
   $this->where_init($field);
   $this->wheres[$field]['$gt'] = $x;
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * WHERE GREATER THAN OR EQUAL TO PARAMETERS
  * --------------------------------------------------------------------------------
  *
  * Get the documents where the value of a $field is greater than or equal to $x
  *
  * @usage = $this->mongo_db->where_gte('foo', 20);
  */

  public function where_gte($field = "", $x)
  {
   $this->where_init($field);
   $this->wheres[$field]['$gte'] = $x;
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * WHERE LESS THAN PARAMETERS
  * --------------------------------------------------------------------------------
  *
  * Get the documents where the value of a $field is less than $x
  *
  * @usage = $this->mongo_db->where_lt('foo', 20);
  */

  public function where_lt($field = "", $x)
  {
   $this->where_init($field);
   $this->wheres[$field]['$lt'] = $x;
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * WHERE LESS THAN OR EQUAL TO PARAMETERS
  * --------------------------------------------------------------------------------
  *
  * Get the documents where the value of a $field is less than or equal to $x
  *
  * @usage = $this->mongo_db->where_lte('foo', 20);
  */

  public function where_lte($field = "", $x)
  {
   $this->where_init($field);
   $this->wheres[$field]['$lte'] = $x;
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * WHERE BETWEEN PARAMETERS
  * --------------------------------------------------------------------------------
  *
  * Get the documents where the value of a $field is between $x and $y
  *
  * @usage = $this->mongo_db->where_between('foo', 20, 30);
  */

  public function where_between($field = "", $x, $y)
  {
   $this->where_init($field);
   $this->wheres[$field]['$gte'] = $x;
   $this->wheres[$field]['$lte'] = $y;
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * WHERE BETWEEN AND NOT EQUAL TO PARAMETERS
  * --------------------------------------------------------------------------------
  *
  * Get the documents where the value of a $field is between but not equal to $x and $y
  *
  * @usage = $this->mongo_db->where_between_ne('foo', 20, 30);
  */

  public function where_between_ne($field = "", $x, $y)
  {
   $this->where_init($field);
   $this->wheres[$field]['$gt'] = $x;
   $this->wheres[$field]['$lt'] = $y;
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * WHERE NOT EQUAL TO PARAMETERS
  * --------------------------------------------------------------------------------
  *
  * Get the documents where the value of a $field is not equal to $x
  *
  * @usage = $this->mongo_db->where_between('foo', 20, 30);
  */

  public function where_ne($field = "", $x)
  {
   $this->where_init($field);
   $this->wheres[$field]['$ne'] = $x;
   return($this);
  }

  /**
  * --------------------------------------------------------------------------------
  * WHERE OR
  * --------------------------------------------------------------------------------
  *
  * Get the documents where the value of a $field is in one or more values
  *
  * @usage = $this->mongo_db->where_or('foo', array( 'foo', 'bar', 'blegh' );
  */

  public function where_or($field = "", $values)
  {
   $this->where_init($field);
   $this->wheres[$field]['$or'] = $values;
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * WHERE AND
  * --------------------------------------------------------------------------------
  *
  * Get the documents where the elements match the specified values
  *
  * @usage = $this->mongo_db->where_and( array ( 'foo' => 1, 'b' => 'someexample' );
  */

  public function where_and( $elements_values = array() ) {
   foreach ( $elements_values as $element => $val ) {
    $this->wheres[$element] = $val;
   }
   return($this);
  }

  /**
  * --------------------------------------------------------------------------------
  * WHERE MOD
  * --------------------------------------------------------------------------------
  *
  * Get the documents where $field % $mod = $result
  *
  * @usage = $this->mongo_db->where_mod( 'foo', 10, 1 );
  */

  public function where_mod( $field, $num, $result ) {
   $this->where_init($field);
   $this->wheres[$field]['$mod'] = array ( $num, $result );
   return($this);
  }

 /**
 * --------------------------------------------------------------------------------
 * Where size
 * --------------------------------------------------------------------------------
 *
 * Get the documents where the size of a field is in a given $size int
 *
 * @usage : $this->mongo_db->where_size('foo', 1)->get('foobar');
 */

 public function where_size($field = "", $size = "")
 {
  $this->_where_init($field);
  $this->wheres[$field]['$size'] = $size;
  return ($this);
 }

 /**
  * --------------------------------------------------------------------------------
  * LIKE PARAMETERS
  * --------------------------------------------------------------------------------
  *
  * Get the documents where the (string) value of a $field is like a value. The defaults
  * allow for a case-insensitive search.
  *
  * @param $flags
  * Allows for the typical regular expression flags:
  *  i = case insensitive
  *  m = multiline
  *  x = can contain comments
  *  l = locale
  *  s = dotall, "." matches everything, including newlines
  *  u = match unicode
  *
  * @param $enable_start_wildcard
  * If set to anything other than TRUE, a starting line character "^" will be prepended
  * to the search value, representing only searching for a value at the start of
  * a new line.
  *
  * @param $enable_end_wildcard
  * If set to anything other than TRUE, an ending line character "$" will be appended
  * to the search value, representing only searching for a value at the end of
  * a line.
  *
  * @usage = $this->mongo_db->like('foo', 'bar', 'im', FALSE, TRUE);
  */

  public function like($field = "", $value = "", $flags = "i", $enable_start_wildcard = TRUE, $enable_end_wildcard = TRUE)
  {
   $field = (string) trim($field);
   $this->where_init($field);
   $value = (string) trim($value);
   $value = quotemeta($value);

   if($enable_start_wildcard !== TRUE)
   {
    $value = "^" . $value;
   }

   if($enable_end_wildcard !== TRUE)
   {
    $value .= "$";
   }

   $regex = "/$value/$flags";
   $this->wheres[$field] = new MongoRegex($regex);
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * ORDER BY PARAMETERS
  * --------------------------------------------------------------------------------
  *
  * Sort the documents based on the parameters passed. To set values to descending order,
  * you must pass values of either -1, FALSE, 'desc', or 'DESC', else they will be
  * set to 1 (ASC).
  *
  * @usage = $this->mongo_db->where_between('foo', 20, 30);
  */

  public function order_by($fields = array())
  {
   foreach($fields as $col => $val)
   {
    if($val == -1 || $val === FALSE || strtolower($val) == 'desc')
    {
     $this->sorts[$col] = -1;
    }
    else
    {
     $this->sorts[$col] = 1;
    }
   }
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * LIMIT DOCUMENTS
  * --------------------------------------------------------------------------------
  *
  * Limit the result set to $x number of documents
  *
  * @usage = $this->mongo_db->limit($x);
  */

  public function limit($x = 99999) {
   if($x !== NULL is_numeric($x) $x >= 1)
   {
    $this->limit = (int) $x;
   }
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * OFFSET DOCUMENTS
  * --------------------------------------------------------------------------------
  *
  * Offset the result set to skip $x number of documents
  *
  * @usage = $this->mongo_db->offset($x);
  */

  public function offset($x = 0)
  {
   if($x !== NULL is_numeric($x) $x >= 1)
   {
    $this->offset = (int) $x;
   }
   return($this);
  }

 /**
  * --------------------------------------------------------------------------------
  * GET_WHERE
  * --------------------------------------------------------------------------------
  *
  * Get the documents based upon the passed parameters
  *
  * @usage = $this->mongo_db->get_where('foo', array('bar' => 'something'));
  */

  public function get_where($collection = "", $where = array(), $limit = 99999)
  {
   return($this->where($where)->limit($limit)->get($collection));
  }

 /**
  * --------------------------------------------------------------------------------
  * GET
  * --------------------------------------------------------------------------------
  *
  * Get the documents based upon the passed parameters
  *
  * @usage = $this->mongo_db->get('foo', array('bar' => 'something'));
  */

  public function get($collection = "")
  {
   if(empty($collection))
   {
    show_error("In order to retreive documents from MongoDB, a collection name must be passed", 500);
   }
   $results = array();
   $documents = $this->db->{$collection}->find($this->wheres, $this->selects)->limit((int) $this->limit)->skip((int) $this->offset)->sort($this->sorts);

   $returns = array();

   foreach($documents as $doc):
    $returns[] = $doc;
   endforeach;
  $this->clear();
   return($returns);

  }

 /**
  * --------------------------------------------------------------------------------
  * COUNT
  * --------------------------------------------------------------------------------
  *
  * Count the documents based upon the passed parameters
  *
  * @usage = $this->mongo_db->get('foo');
  */

  public function count($collection = "")
  {
   if(empty($collection))
   {
    show_error("In order to retreive a count of documents from MongoDB, a collection name must be passed", 500);
   }
   $count = $this->db->{$collection}->find($this->wheres)->limit((int) $this->limit)->skip((int) $this->offset)->count();
   $this->clear();
   return($count);
  }

 /**
  * 自增ID實(shí)現(xiàn)
  * return insert_id
  */
 private function insert_inc($table)
 {
  $update = array('$inc'=>array('id'=>1));
  $query = array('table'=>$table);
  $command = array(
  'findandmodify'=>'_increase',
  'update'=>$update,
  'query'=>$query,
  'new'=>true,
  'upsert'=>true
  );
  $id = $this->db->command($command);
  return $id['value']['id'];
 }

 /**
  * --------------------------------------------------------------------------------
  * INSERT
  * --------------------------------------------------------------------------------
  *
  * Insert a new document into the passed collection
  *
  * @usage = $this->mongo_db->insert('foo', $data = array());
  */

  public function insert($collection = "", $data = array()) {
   if(empty($collection))
   {
    show_error("No Mongo collection selected to insert into", 500);
   }

   if(count($data) == 0 || !is_array($data))
   {
    show_error("Nothing to insert into Mongo collection or insert is not an array", 500);
   }

   try
   {
   $inc = $this->insert_inc($collection);
   $data['_id'] = $inc;
    $result = $this->db->{$collection}->insert($data, array('fsync' => TRUE));
    if($result['ok'] || $result){
    return true;
   }
   else{
    return false;
   }
   }
   catch(MongoCursorException $e)
   {
    show_error("Insert of data into MongoDB failed: {$e->getMessage()}", 500);
   }

  }

 /**
  * --------------------------------------------------------------------------------
  * UPDATE
  * --------------------------------------------------------------------------------
  *
  * Update a document into the passed collection
  *
  * @usage = $this->mongo_db->update('foo', $data = array());
  */

  public function update($collection = "", $data = array(), $flage = false)
  {
   if(empty($collection))
   {
    show_error("No Mongo collection selected to update", 500);
  }
   if(count($data) == 0 || !is_array($data))
   {
    show_error("Nothing to update in Mongo collection or update is not an array", 500);
  }
  unset($data['_id']);
  if($flage){
   $arr = $this->wheres;
   unset($arr['_id']);
   if(is_array($arr)){
    foreach($arr as $key => $w){
     unset($data[$key]);
    }
   }
  }
  try
   {
    $res = $this->db->{$collection}->update($this->wheres, array('$set' => $data), array('fsync' => TRUE, 'multiple' => FALSE));
   $this->clear();
   return $res;
   } 
   catch(MongoCursorException $e)
   {
    show_error("Update of data into MongoDB failed: {$e->getMessage()}", 500);
   }

  }

 /**
  * --------------------------------------------------------------------------------
  * UPDATE_ALL
  * --------------------------------------------------------------------------------
  *
  * Insert a new document into the passed collection
  *
  * @usage = $this->mongo_db->update_all('foo', $data = array());
  */

  public function update_all($collection = "", $data = array()) {
   if(empty($collection))
   {
    show_error("No Mongo collection selected to update", 500);
   }

   if(count($data) == 0 || !is_array($data))
   {
    show_error("Nothing to update in Mongo collection or update is not an array", 500);
   }

   try
   {
    $this->db->{$collection}->update($this->wheres, array('$set' => $data), array('fsync' => TRUE, 'multiple' => TRUE));
   $this->clear();
    return(TRUE);
   }
   catch(MongoCursorException $e)
   {
    show_error("Update of data into MongoDB failed: {$e->getMessage()}", 500);
   }

  }

  /**
  * --------------------------------------------------------------------------------
  * DELETE
  * --------------------------------------------------------------------------------
  *
  * delete document from the passed collection based upon certain criteria
  *
  * @usage = $this->mongo_db->delete('foo', $data = array());
  */

  public function delete($collection, $where)
  {
   if(empty($collection))
   {
    show_error("No Mongo collection selected to delete from", 500);
   }
  if(!$where){
   show_error("No data input to delete", 500);
  }
   try
   {
   $this->wheres = $where;
    $this->db->{$collection}->remove($this->wheres);
   $this->clear();
    return(TRUE);
   }
   catch(MongoCursorException $e)
   {
    show_error("Delete of data into MongoDB failed: {$e->getMessage()}", 500);
   }

  }

 /**
  * --------------------------------------------------------------------------------
  * DELETE_ALL
  * --------------------------------------------------------------------------------
  *
  * Delete all documents from the passed collection based upon certain criteria
  *
  * @usage = $this->mongo_db->delete_all('foo', $data = array());
  */

  public function delete_all($collection = "")
  {
     if(empty($collection))
     {
      show_error("No Mongo collection selected to delete from", 500);
    }

   try
   {
    $this->db->{$collection}->remove($this->wheres, array('fsync' => TRUE, 'justOne' => FALSE));
   $this->clear();
    return(TRUE);
   }
   catch(MongoCursorException $e)
   {
    show_error("Delete of data into MongoDB failed: {$e->getMessage()}", 500);
   }

  }

 /**
  * --------------------------------------------------------------------------------
  * ADD_INDEX
  * --------------------------------------------------------------------------------
  *
  * Ensure an index of the keys in a collection with optional parameters. To set values to descending order,
  * you must pass values of either -1, FALSE, 'desc', or 'DESC', else they will be
  * set to 1 (ASC).
  *
  * @usage = $this->mongo_db->add_index($collection, array('first_name' => 'ASC', 'last_name' => -1), array('unique' => TRUE));
  */

 public function add_index($collection = "", $keys = array(), $options = array())
 {
  if(empty($collection))
  {
    show_error("No Mongo collection specified to add index to", 500);
   }

   if(empty($keys) || !is_array($keys))
   {
    show_error("Index could not be created to MongoDB Collection because no keys were specified", 500);
    }

   foreach($keys as $col => $val)
   {
    if($val == -1 || $val === FALSE || strtolower($val) == 'desc')
    {
     $keys[$col] = -1;
    }
    else
    {
     $keys[$col] = 1;
    }
   }

   if($this->db->{$collection}->ensureIndex($keys, $options) == TRUE)
   {
    $this->clear();
    return($this);
   }
   else
   {
    show_error("An error occured when trying to add an index to MongoDB Collection", 500);
  }
 }

 

 /**
  * --------------------------------------------------------------------------------
  * REMOVE_INDEX
  * --------------------------------------------------------------------------------
  *
  * Remove an index of the keys in a collection. To set values to descending order,
  * you must pass values of either -1, FALSE, 'desc', or 'DESC', else they will be
  * set to 1 (ASC).
  *
  * @usage = $this->mongo_db->remove_index($collection, array('first_name' => 'ASC', 'last_name' => -1));
  */

 public function remove_index($collection = "", $keys = array())
 {
  if(empty($collection))
  {
    show_error("No Mongo collection specified to remove index from", 500);
   }

   if(empty($keys) || !is_array($keys))
   {
    show_error("Index could not be removed from MongoDB Collection because no keys were specified", 500);
   }

   if($this->db->{$collection}->deleteIndex($keys, $options) == TRUE)
   {
    $this->clear();
    return($this);
   }
   else
   {
    show_error("An error occured when trying to remove an index from MongoDB Collection", 500);
  }
 }

 /**
  * --------------------------------------------------------------------------------
  * REMOVE_ALL_INDEXES
  * --------------------------------------------------------------------------------
  *
  * Remove all indexes from a collection.
  *
  * @usage = $this->mongo_db->remove_all_index($collection);
  */

 public function remove_all_indexes($collection = "") {
  if(empty($collection))
  {
    show_error("No Mongo collection specified to remove all indexes from", 500);
   }

   $this->db->{$collection}->deleteIndexes();
   $this->clear();
   return($this);
 }

 /**
  * --------------------------------------------------------------------------------
  * LIST_INDEXES
  * --------------------------------------------------------------------------------
  *
  * Lists all indexes in a collection.
  *
  * @usage = $this->mongo_db->list_indexes($collection);
  */
 public function list_indexes($collection = "") {
  if(empty($collection))
  {
    show_error("No Mongo collection specified to remove all indexes from", 500);
   }
   return($this->db->{$collection}->getIndexInfo());
 }

 /**
  * --------------------------------------------------------------------------------
  * DROP COLLECTION
  * --------------------------------------------------------------------------------
  *
  * Removes the specified collection from the database.  Be careful because this
  *  can have some very large issues in production!
  */

  public function drop_collection($collection = "")
  {
    if(empty($collection))
   {
      show_error("No Mongo collection specified to drop from database", 500);
    }
    $this->db->{$collection}->drop();
    return TRUE;
  }


 /**
  * --------------------------------------------------------------------------------
  * CONNECT TO MONGODB
  * --------------------------------------------------------------------------------
  *
  * Establish a connection to MongoDB using the connection string generated in
  * the connection_string() method.  If 'mongo_persist_key' was set to true in the
  * config file, establish a persistent connection.  We allow for only the 'persist'
  * option to be set because we want to establish a connection immediately.
  */

 private function connect() {
  $options = array();
  if($this->persist === TRUE)
  {
   $options['persist'] = isset($this->persist_key) !empty($this->persist_key) ? $this->persist_key : 'ci_mongo_persist';
  }

  try
  {
   $this->connection = new Mongo($this->connection_string, $options);
   $this->db = $this->connection->{$this->dbname};
   return($this);
  }
  catch(MongoConnectionException $e)
  {
   show_error("Unable to connect to MongoDB: {$e->getMessage()}", 500);
  }
 }

 /**
  * --------------------------------------------------------------------------------
  * BUILD CONNECTION STRING
  * --------------------------------------------------------------------------------
  *
  * Build the connection string from the config file.
  */

 private function connection_string($MONGODB_CONFIG)
 {

  $this->host = trim($MONGODB_CONFIG['HOST']);
  $this->port = trim($MONGODB_CONFIG['PORT']);
  $this->user = trim($MONGODB_CONFIG['USER']);
  $this->pass = trim($MONGODB_CONFIG['PWD']);
  $this->dbname = trim($MONGODB_CONFIG['DATABASE']);
  $this->persist = trim($MONGODB_CONFIG['PERSIST']);
  $this->persist_key = trim($MONGODB_CONFIG['PERSIST_KEY']);

  $connection_string = "mongodb://";

  if(empty($this->host))
  {
   show_error("The Host must be set to connect to MongoDB", 500);
  }

  if(empty($this->dbname))
  {
   show_error("The Database must be set to connect to MongoDB", 500);
  }

  if(!empty($this->user) !empty($this->pass))
  {
   $connection_string .= "{$this->user}:{$this->pass}@";
  }

  if(isset($this->port) !empty($this->port))
  {
   $connection_string .= "{$this->host}:{$this->port}/{$this->dbname}";
  }
  else
  {
   $connection_string .= "{$this->host}";
  }

  $this->connection_string = trim($connection_string);
 }

 /**
  * --------------------------------------------------------------------------------
  * CLEAR
  * --------------------------------------------------------------------------------
  *
  * Resets the class variables to default settings
  */

 private function clear()
 {
  $this->selects = array();
  $this->wheres = array();
  $this->limit = NULL;
  $this->offset = NULL;
  $this->sorts = array();
 }

 /**
  * --------------------------------------------------------------------------------
  * WHERE INITIALIZER
  * --------------------------------------------------------------------------------
  *
  * Prepares parameters for insertion in $wheres array().
  */

 private function where_init($param)
 {
  if(!isset($this->wheres[$param]))
  {
   $this->wheres[$param] = array();
   }
 }

 /**
  * --------------------------------------------------------------------------------
  * 設(shè)置表
  * --------------------------------------------------------------------------------
  *  參數(shù):
  *  $table 表名
  */
 public function set_table($table){
  $this->collection = $table;
 }

 /**
  * --------------------------------------------------------------------------------
  * 獲取表名
  * --------------------------------------------------------------------------------
  */
 public function get_table(){
  return $this->collection;
 }

 /**
  * --------------------------------------------------------------------------------
  * 設(shè)置表排序
  * --------------------------------------------------------------------------------
  *  參數(shù):
  *  $orderby 排序
  */
 public function set_orderby($orderby){
  $this->page_sorts = $orderby;
 }

 
 /**
  * --------------------------------------------------------------------------------
  * 獲取左邊結(jié)果集
  * --------------------------------------------------------------------------------
  *  參數(shù):
  *  $left 左邊顯示的個(gè)數(shù)
  *  $last 定位當(dāng)前頁的值
  *  $size 頁面大小
  */
 public function get_left($left, $last, $size = PAGE_SIZE){
  if($last){
   $order = $this->nor_orderby();
   if($this->page_sorts[$this->key] == -1){
    $this->where_gt($this->key, $last);
   } else {
     $this->where_lt($this->key, $last);
   }
   return $this->limit($left * $size)->order_by($order)->get($this->collection);
  }
 }

 
 /**
  * --------------------------------------------------------------------------------
  * 獲取右邊結(jié)果集
  * --------------------------------------------------------------------------------
  *  參數(shù):
  *  $right 右邊顯示的個(gè)數(shù)
  *  $last 定位當(dāng)前頁的值
  *  $size 頁面大小
  */
 public function get_right($right, $last, $size = PAGE_SIZE){
  if($last){
   if($this->page_sorts[$this->key] == -1){
    $this->where_lte($this->key, $last);
   } else {
    $this->where_gte($this->key, $last);
   }
  }
  return $this->limit($right * $size + 1)->order_by($this->page_sorts)->get($this->collection);
 }

 /**
  * --------------------------------------------------------------------------------
  * 設(shè)置key
  * --------------------------------------------------------------------------------
  *  參數(shù):
  *  $key 設(shè)置索引主鍵
  */
 public function set_key($key){
  $this->key = $key;
 }

 /**
  * --------------------------------------------------------------------------------
  * 求反
  * --------------------------------------------------------------------------------
  */
 private function nor_orderby(){
  foreach($this->page_sorts as $key => $order){
   if($order == -1){
    $orderby[$key] = 1;
   }else{
    $orderby[$key] = -1;
   }  
  }
  return $orderby;
 }

 /**
  * --------------------------------------------------------------------------------
  * 獲取上一頁的值
  * --------------------------------------------------------------------------------
  *  參數(shù):
  *  $last 定位當(dāng)前頁的值
  *  $size 頁面大小
  */
 public function get_prev($last, $size = PAGE_SIZE){
  if($last){
   if($this->page_sorts[$this->key] == 1){
    $this->where_lt($this->key,$last)->order_by(array($this->key => -1));
   } else {
    $this->where_gt($this->key,$last)->order_by(array($this->key => 1));
   }
   $result = $this->limit($size)->get($this->collection);
  }
  return $result[$size - 1][$this->key];
 }

  /**
  * --------------------------------------------------------------------------------
  * 獲取下一頁的值
  * --------------------------------------------------------------------------------
  *  參數(shù):
  *  $last 定位當(dāng)前頁的值
  *  $size 頁面大小
  */
 public function get_next($last, $size = PAGE_SIZE){
  if($last){
   if($this->page_sorts[$this->key] == 1){
    $this->where_gte($this->key,$last);
   } else {
    $this->where_lte($this->key,$last);
   }
  }
  $result = $this->limit($size+1)->order_by($this->page_sorts)->get($this->collection);
  return $result[$size][$this->key];
 }

 /**
  * --------------------------------------------------------------------------------
  * 獲取最后一頁的值
  * --------------------------------------------------------------------------------
  *  參數(shù):
  *  $size 頁面大小
  */
 public function get_last($size = PAGE_SIZE){
  $res = $this->count($this->collection) % $size;
  $order = $this->nor_orderby();
  if($res > 0){
   $result = $this->limit($res)->order_by($order)->get($this->collection);
   return $result[$res - 1][$this->key];
  }else{
   $result = $this->limit($size)->order_by($order)->get($this->collection);
   return $result[$size - 1][$this->key];
  }
 }

 /**
  * --------------------------------------------------------------------------------
  * 分頁查詢
  * --------------------------------------------------------------------------------
  *  參數(shù):
  *  $last 定位當(dāng)前頁的值
  *  $size 頁面大小
  */
 public function page_query($last, $size = PAGE_SIZE){
  if($last){
   if($this->page_sorts[$this->key]==1){
    $this->where_gte($this->key,$last);
   } else {
    $this->where_lte($this->key,$last);
   }
  }
  return $this->limit($size)->order_by($this->page_sorts)->get($this->collection);
 }

 /**
  * 批量執(zhí)行代碼_插入
  * @param String $collection
  * @param 二維數(shù)組 $code
  */
 public function execute_insert($collection,$code){
  //將二維數(shù)組分成js格式
  $strcode='';
  foreach($code as $k=>$v){
   foreach($v as $kk=>$vv){
    $strcode.='db.getCollection("'.$collection.'").insert({ "'.$kk.'":"'.$vv.'" });';
   }   
  }
 // retrun array([ok]=>1);
  return $this->db->execute($code); 
 }

}
?>


page.class.php mongodb分頁邏輯類
復(fù)制代碼 代碼如下:

?php
db = $DB;
  $this->count = $this->db->count($this->db->get_table());
  $url = SITE_ROOT.strtolower(CLASS_NAME).'/'.METHOD_NAME;
  $this->url = $this->url ? $this->url : $url;
  $set = $set ? $set : 5;
  $this->set = $set;
  $size = $size ? $size : PAGE_SIZE;
  $this->size = $size;
  $this->last = $last;
  $this->prev = $DB->get_prev($this->last);
  $this->next = $DB->get_next($this->last);
  //$this->page = GET::UINT('page');
  $this->page = $this->page ? $this->page : 1;
  $this->total = @ceil($this->count / $this->size);
  $this->key = $key;
  $this->orderby = $orderby;
 }

 //輸出分頁鏈接
 public function get_link(){
  if($this->total != 1){
   $this->get_first();
   $this->get_prev();
   $this->get_center();
   $this->get_next();
   $this->get_last();
   $this->get_turnto();
  }
  if($this->link){
   $this->link = $this->turnto.$this->link.'共'.number_format($this->total).'頁 '.number_format($this->count).'條記錄';
  }
  if($this->turnto){
   $this->link .= '';
  }
  return $this->link;
 }

 //獲取左邊顯示的個(gè)數(shù)
 public function get_left(){
  return  $this->left = ($this->set - $this->page >= 0) ? ($this->page - 1) : $this->set;
 }

 //獲取右邊顯示的個(gè)數(shù)
 public function get_right(){
  return $this->right = ($this->total - $this->page > $this->set) ? $this->set : ($this->total - $this->page);
 }

 //設(shè)置左邊的結(jié)果集
 public function set_left_result($left_result){
  $this->leftresult = $left_result;
 }

 //設(shè)置右邊的結(jié)果集
 public function set_right_result($right_result){
  $this->rightresult = $right_result;
 }

 //設(shè)置排序條件
 public function set_orderby($orderby){
  $this->orderby = $orderby;
 }

 //設(shè)置最后一頁
 public function set_last($last){
  $this->lastd = $last;
 }

 //設(shè)置中間顯示頁碼個(gè)數(shù)
 public function set($set){
  $this->set = $set;
 }

 //獲取首頁
 private function get_first(){
  if($this->page != 1){
   if($this->total > 0){
    $this->link.='首頁';
   }
  }
 }

 //獲取上一頁
 private function get_prev(){
  if($this->prev){
   $this->link.='上一頁';
  }
 }

 //中間顯示
 private function get_center(){
  $start = ($this->page - $this->set) = 0 ? 1 : ($this->page - $this->set); 
  $end = ($this->page + $this->set + 1 >= $this->total) ? $this->total + 1 : ($this->page + $this->set + 1);

  $ii = $this->left;
  $iii = 0;
  //顯示左邊的
  for($i = $start; $i $end; $i++, $ii--, $iii++){
   if($this->page == $i){
    $this->link.=''.$i.'';
   }else{
    $the_id = $ii * $this->size - 1;
    if($the_id > 0){
     $this->link.=''.$i.'';
    }else{
     $the_id = ($iii - $this->left) * $this->size;
     $this->link.=''.$i.'';
    }   
   }
  }
 }

 //獲取下一頁
 private function get_next(){
  if($this->next){
   $this->link.='下一頁';
  }
 }

 //獲取尾頁
 private function get_last(){
  if($this->page != $this->total){
   $this->link.='尾頁';
  }
 }

 //跳轉(zhuǎn)到
 private function get_turnto(){
  $this->turnto = '
轉(zhuǎn)到第 input type="text" name="p" style="width:25px;text-align:center"> 頁';
 }

 //求反
 public function nor_orderby(){
  foreach($this->orderby as $key => $order){
   if($order==-1){
    $orderby[$key] = 1;
   }else{
    $orderby[$key] = -1;
   }  
  }
  return $orderby;
 }

 //設(shè)置key
 public function set_key($key){
  $this->key = $key;
 }

 //分頁操作
 public function show(){
  $this->set_key($this->key);
  $this->set_orderby($this->orderby);
  $left = $this->get_left();
  $right = $this->get_right();
  $leftresult = $this->db->get_left($left, $this->last);
  $rightresult = $this->db->get_right($right, $this->last);
  $this->set_left_result($leftresult);
  $this->set_right_result($rightresult);
  $last = $this->db->get_last();
  $this->set_last($last);
  return $this->get_link();
 }
}
/*      調(diào)用例子rockmongo
  global $DB;
  $lastid = GET::UINT('id');
  $table = 'log';
  $key = '_id';
  $orderby = array($key => -1);

  $DB->set_table($table);
  $DB->set_key($key);
  $DB->set_orderby($orderby);

  $log = $DB->page_query($lastid);

  $page = new Page($lastid, $key, $orderby);
  $pager = $page->show();
*/

?>


test.php 測(cè)試代碼
復(fù)制代碼 代碼如下:

?php
  include "page.class.php";
  include "mongodb.class.php";
  define(PAGE_SIZE, 5);//每頁大小
  $config['HOST'] = '127.0.0.1';
  $config['PORT'] = 20081;  //mongodb端口
  $config['DATABASE'] = 'domain';//mongodb數(shù)據(jù)庫名
  $config['USER'] = '';
  $config['PWD'] = '';
  $config['PERSIST'] = TRUE;

  $DB = new DB($config);

  $table = 'whois'; //mongodb collection名
  $key = '_id';
  $orderby = array($key => -1);

  $DB->set_table($table);
  $DB->set_key($key);
  $DB->set_orderby($orderby);

  $log = $DB->page_query($lastid,5);

  $page = new Page($lastid, $key, $orderby);

  echo $pager = $page->show();


?>

您可能感興趣的文章:
  • PHP封裝的分頁類與簡(jiǎn)單用法示例
  • PHP分頁顯示的方法分析【附PHP通用分頁類】
  • php封裝的page分頁類完整實(shí)例
  • PHP實(shí)現(xiàn)的簡(jiǎn)單分頁類及用法示例
  • 精美漂亮的php分頁類代碼
  • PHP通用分頁類page.php[仿google分頁]
  • 兩款萬能的php分頁類
  • mysql+php分頁類(已測(cè))
  • PHP ajax 分頁類代碼
  • 仿dedecms下拉分頁樣式修改的thinkphp分頁類實(shí)例
  • PHP基于面向?qū)ο蠓庋b的分頁類示例

標(biāo)簽:丹東 邯鄲 大理 吉安 昭通 景德鎮(zhèn) 本溪 鶴崗

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《高效mongodb的php分頁類(不使用skip)》,本文關(guān)鍵詞  高效,mongodb,的,php,分頁,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《高效mongodb的php分頁類(不使用skip)》相關(guān)的同類信息!
  • 本頁收集關(guān)于高效mongodb的php分頁類(不使用skip)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    日韩欧美一区二区久久婷婷| 色综合久久久无码中文字幕波多| 日本在线成人| 欧美精品v日韩精品v国产精品| 国产传媒av在线| 91麻豆精品激情在线观看最新| 大色综合视频网站在线播放| 国产成人久久精品77777最新版本| 最新中文字幕av专区| 暧暧视频在线免费观看| 成人在线网址| 亚洲日本国产| 99这里只有久久精品视频| a美女胸又www黄视频久久| 精品国产区一区| 久久夜色精品国产亚洲aⅴ| 先锋资源中文字幕| 久久久久久久久久久久久久| 午夜影院在线| 免费男女羞羞的视频网站中文子暮| 青青草原成人在线视频| 久久久久九九视频| 大香一本蕉伊线亚洲网| 我不卡手机影院| 成视人a免费观看视频| 国产精品视屏| 精品久久久久久久久久久久久久久久久| 来个黄色网址| 亚洲日本视频在线观看| 中文字幕免费高清电视剧网站在线观看| 国产+成+人+亚洲欧洲在线| 91人妻一区二区三区| 国产精品欧美大片| 精品国产美女福利到在线不卡| 狠色狠色综合久久| 亚洲综合久久久| 青青操在线观看| 精品久久久久久综合日本欧美| 久久成人精品一区二区三区| 国产精品一区二区黑人巨大| 亚洲青涩在线| 国产一级片自拍| 国产中文字幕一区二区三区| 亚洲无线码在线一区观看| 黑人巨大精品欧美一区二区免费| 国产精品久久久久久久久借妻| 欧美理论片在线观看| 久久久久久亚洲中文字幕无码| 国产精品白嫩初高中害羞小美女| 久久成人av网站| 久草在线青青草| 久久久久久久久久久久久9999| 免费中文字幕在线| 免费av网站在线观看| 噜噜噜91成人网| 欧美午夜精品久久久| 成人精品一区二区三区免费| 国产情侣久久久久aⅴ免费| 欧美日韩一区二区三区四区在线观看| 夜色资源网av在先锋网站观看| 成人午夜一级二级三级| 国产情侣av在线| 亚洲一区二区三区精品视频| 久久精品国产亚洲av无码娇色| 成人h动漫精品一区二区下载| 米奇精品一区二区三区在线观看| 国产精品入口麻豆完整版| 久久久精品999| 国产麻豆精品高清在线播放| 欧美videos另类齐全| 日韩极品精品视频免费观看| 亚洲免费成人网| 逼特逼视频在线观看| 日本中文字幕视频在线| 久久国产精品一区二区三区| av观看网址| 国产一区二区中文| 国产精品免费网站在线观看| 免费成人看片| bt天堂新版中文在线地址| 久久美女高清视频| 最新91在线| 日韩欧美999| 国产一区二区精品久久99| 国产精品av久久久久久无| 巨大荫蒂视频欧美另类大| h七七www色午夜日本| 91福利精品第一导航| 欧美va亚洲va香蕉在线| 久久免费的精品国产v∧| av在线1区2区| 亚洲精品一区二区三区中文字幕| 欧美视频第一| 宅男深夜视频| xxxxxx欧美| 亚洲尤物视频在线| 人妻有码中文字幕| 国产肉丝袜一区二区| 国产精品视频一二区| 一二三四在线视频观看社区| 国产精品久久久久9999小说| 成人三级伦理片| 噜噜爱69成人精品| 91精品国产一区二区人妖| 精品成人一区二区三区| 国产情侣久久久久aⅴ免费| 好吊日精品视频| 成年男女免费视频网站不卡| 啊啊啊国产视频| 香蕉大人久久国产成人av| 综合精品久久| 91精品国产色综合久久不8| 国产精品亚洲美女av网站| 久久成人av| 亚洲精品色午夜无码专区日韩| 久久香蕉精品香蕉| 日韩av最新在线观看| 国产极品在线观看| 国产视频在线观看一区二区| 国产成人aa精品一区在线播放| 美腿丝袜亚洲图片| av在线亚洲色图| 国产一区久久精品| 国内伊人久久久久久网站视频| 久久―日本道色综合久久| 中文字幕一区二区人妻视频| 亚洲精品电影在线| 久久精品国产成人av| 三级视频在线| 日av在线播放中文不卡| 日韩视频一区二区三区在线播放免费观看| 欧美日韩在线精品成人综合网| 成人免费观看在线观看| 国产一区二区小视频| 国产精品福利在线播放| 国产精品99久久免费| 欧美激情日韩图片| 亚洲片在线观看| 亚洲免费精品视频| 精品日韩av一区二区| 人人狠狠综合久久亚洲婷| 特级丰满少妇一级| 久久综合国产精品台湾中文娱乐网| 亚洲人免费视频| 精品国产网站在线观看| 91视频综合| 成年人福利视频| 国产熟女一区二区三区五月婷| 精品三级国产| 717影院理论午夜伦不卡久久| 九色91porny| 色婷婷av一区二区| 国产欧美va欧美va香蕉在线| 一区二区免费视频| 日韩免费视频一区| av一级黄色片| 桥本有菜亚洲精品av在线| 69亚洲精品久久久蜜桃小说| 亚洲午夜久久久影院| 欧亚在线中文字幕免费| 超碰免费97在线观看| 麻豆tv在线播放| 国产99久久久精品| 粉嫩粉嫩芽的虎白女18在线视频| 女同久久另类69精品国产| 成人台湾亚洲精品一区二区| 中文日韩电影网站| 日韩精品一区二区在线播放| 欧美激情精品久久久六区热门| 国产三级自拍| 欧美激情精品久久久久久| 精品国产_亚洲人成在线| 国产美女性感在线观看懂色av| 另类少妇人与禽zozz0性伦| 可以直接在线观看的av| 国产一区二区三区观看| 天天激情综合| 中文字幕网站在线观看| 日韩一区二区不卡视频| 日韩视频免费观看| 鲁一鲁一鲁一鲁一av| 欧美成人高清手机在线视频| 一区二区视频欧美| 国产成人夜色高潮福利影视| 中文字幕人成不卡一区| 亚洲jizzjizz日本少妇| www.污污视频| 91.·福利| 欧美一区二区三区性视频| 91麻豆精品秘密入口| 精品亚洲精品| 成人做爰69片免网站| 国产大片在线观看| 国色天香2019中文字幕在线观看| 999热视频在线观看| 国产精品天美传媒入口| 欧美艳星介绍134位艳星| 午夜久久福利视频| 精选一区二区三区四区五区| 国产免费成人| 欧美国产综合| 久久色.com| 黄色国产在线| 日韩av午夜| 日韩视频在线免费观看| 欧洲在线/亚洲| 国产成人精品视频在线| 另类国产精品一区二区| 韩国福利视频一区| 欧美亚洲精品一区| 福利二区91精品bt7086| h片免费观看| 亚洲美腿欧美激情另类| dy888夜精品国产专区| 成人免费高清| 91蝌蚪porny九色| 欧美老熟妇一区二区三区| 欧美一区二粉嫩精品国产一线天| 欧美一区日韩一区| 欧洲一区二区三区免费视频| 亚洲欧美手机在线| 日韩欧美激情四射| 午夜免费播放观看在线视频| 成人黄色短视频在线观看| 亚欧黄色av| 久久天堂国产精品| 99re6热在线精品视频播放速度| 韩国一区二区视频| 中文久久乱码一区二区| 欧美变态tickle挠乳网站| 欧美日韩国产一中文字不卡| 蜜臀av中文字幕| 欧美日韩一级大片网址| 久草视频一区二区| 天天操夜夜操国产精品| 69av在线播放| 欧洲黄色一级视频| 18激情网站| 国产精品99精品一区二区三区∴| 精品人妻少妇嫩草av无码| 国产精品久久久久三级| 国产在线观看免费网站| 国产日产欧美a一级在线| 久久精品成人一区二区三区蜜臀| 91精品国产高清一区二区三密臀| 狠狠人妻久久久久久综合蜜桃| 国产精品极品在线观看| 日韩亚洲国产中文字幕欧美| 亚洲国产精品女人久久久| 久久精品男人的天堂| 少妇性l交大片| 国产精品99re| **爰片久久毛片| 中文字幕少妇一区二区三区| 成年女人的天堂在线| 日韩欧美一区二区三区四区| 最好看的2019的中文字幕视频| 熟妇高潮精品一区二区三区| 极品粉嫩小仙女高潮喷水久久| 2023亚洲男人天堂| 国产成人无码精品久在线观看| 福利小视频在线| 激情久久一区二区| 欧美性猛交xxxx免费看漫画| 人人爽香蕉精品| 香蕉视频免费版| 国产精品爽黄69天堂a| 国产一区二区在线观看免费播放| 中文字幕av一区二区三区谷原希美| 国产99午夜精品一区二区三区| 国产+成+人+亚洲欧洲自线| 大桥未久一区二区三区| 亚洲黄色在线观看| 亚洲色图图片区| 亚洲女人18毛片水真多| 久久久国产免费| 精品乱子伦一区二区三区| 欧美美女搞黄| 亚洲三级在线免费观看| 国产精品综合在线视频| 一级毛片aaaaaa免费看| 五月天国产在线| 黄在线免费观看| 露出调教综合另类| 超碰97久久国产精品牛牛| 亚洲av成人无码久久精品老人| 国产人成高清视频观看| 日韩一二三区视频| 亚洲一二三区在线观看| 日韩—二三区免费观看av| 国产一区二区在线|播放| 四虎国产精品免费久久5151| 国产欧美精品一区二区三区| 日韩欧美中文字幕在线视频| 久久五月精品| 亚洲国产中文在线二区三区免| 一本到一区二区三区| 国产精品电影网站| 日韩国产精品亚洲а∨天堂免| 青青视频在线播放| 色的视频在线免费看| 精品无码一区二区三区| 欧美性黄网官网| 亚洲福利在线看| 国产视频三区四区| 国产ts人妖调教重口男| 电影在线一区| 亚洲ⅴ国产v天堂a无码二区| 亚洲中文一区二区三区| 中文字幕精品在线播放| 日韩精品一级| 亚洲图片欧洲图片av| 一本大道久久加勒比香蕉| 国产精品成人免费一区二区视频| 人妻少妇被粗大爽9797pw| 日韩三级视频在线播放| 国产porn在线| 亚洲精品成人自拍| 97精品国产99久久久久久免费| 国产欧美欧洲| bt天堂新版中文在线地址| 国产精品国产三级国产专播精品人| 91久久久在线| 一区二区福利视频| 校园激情久久| 中文产幕区在线观看| 色综合蜜月久久综合网| 亚洲欧美日韩一区二区三区在线观看|