The manual is simple enough to handle the queries we may use daily:
$oSpecialty = new Specialty (),//dd (Specialty::where (' id ', 3)->value (' path ')),//Query a single field, Return String//dd (specialty: : Where (' ID ', 3)->first ([' id ', ' pid ', ' Path ')),//query multiple defined fields//dd (specialty::where (' pid ', 0)->get ([' id ', ' pid ', ' Path ']);//Querying multiple fields consisting of a dataset//dd (Specialty::where (' pid ', 0)->lists (' id '));//Querying a collection of columns, and returning the result key is the set DD with the 0,1,2 value as the ID ( Specialty::where (' pid ', 0)->skip (5)->take (+)->get ());//query Limit number of records//DD (Db::update (' Update users set Name= ') Neo2 "where id=1200 '));//Original Ecological update
Another example:
$userModel = new User (), $info 1=user::where (' id ', 1)->get (); $info 2=user::find (1); $info 3=user::whereid (1) First (); $info 4=user::where (' id ', 1)->first (); $info 5 = User::where ([' ID ' =>1, ' email ' = ' admin@163.com '])- >first ();//Multiple Conditions $info6 = User::whereid (1)->first ();//Use where+ Key name to query $info7 = User::where ([' ID ' =>1])->first (); $info 8 = User::where ([' ID ' =>1])->first ()->toarray ();//Note that the ToArray object is null to give an error, so it is generally not used $info9 = Userbind:: where ([' Fromid ' =>1])->get ()->toarray ();//Notice that the ToArray object is null will error, so it is generally not used
More examples
User::wherein (' id ', $id)->delete ();//need to be aware that $id is an array, not a comma-linked string Teacher::wherein (' user_id ', $id)->delete (); /delete Teacher's Watch