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

Menu