Mysql
 sql >> Teknologi Basis Data >  >> RDS >> Mysql

Laravel whereIn ATAU whereIn

Anda bisa saja mencari whereIn fungsi di inti untuk melihat itu. Ini kamu. Ini harus menjawab semua pertanyaan Anda

/**
 * Add a "where in" clause to the query.
 *
 * @param  string  $column
 * @param  mixed   $values
 * @param  string  $boolean
 * @param  bool    $not
 * @return \Illuminate\Database\Query\Builder|static
 */
public function whereIn($column, $values, $boolean = 'and', $not = false)
{
    $type = $not ? 'NotIn' : 'In';

    // If the value of the where in clause is actually a Closure, we will assume that
    // the developer is using a full sub-select for this "in" statement, and will
    // execute those Closures, then we can re-construct the entire sub-selects.
    if ($values instanceof Closure)
    {
        return $this->whereInSub($column, $values, $boolean, $not);
    }

    $this->wheres[] = compact('type', 'column', 'values', 'boolean');

    $this->bindings = array_merge($this->bindings, $values);

    return $this;
}

Lihat bahwa ia memiliki param boolean ketiga. Semoga berhasil.



  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Grup DateTime berdasarkan tanggal dan jam

  2. Pencarian MySQL Fulltext Boolean Mode mengembalikan terlalu banyak hasil

  3. SQL menghitung semua baris alih-alih menghitung baris individual

  4. MySQL WEEK() :Dapatkan semua minggu dalam rentang tanggal (dengan/tanpa catatan)

  5. Plugin otentikasi 'caching_sha2_password' tidak didukung