How do data model objects in thinkPHP5 query multiple conditions?

the title is not clear. Let"s be more specific:

query the records of id==1

 self::where("id","=", 1);

if there is an id array now, how can I put this array into where as a query parameter of id?

Php
May.22,2021

self::where('id','in',[1,3,5,7]);

The usage of

where has many conditions

  • Array condition:

        $map['name'] = 'thinkphp';
        $map['status'] = 1;
        // 
        Db::table('think_user')->where($map)->select();
  • string condition

    Db::table('think_user')->where('type=1 AND status=1')->select(); 
For more information, please see

Previous: The website can be accessed normally after the go program file is deleted, so where is the executed code saved?

Next: LocalStorage native encapsulation

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b849-412df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b849-412df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?