After following, you can keep track of his dynamic information in a timely manner
Courses in the relevant section:A preliminary study on connecting databases and models
connections配置數(shù)據(jù)庫(kù)連接信息,可以是多個(gè)數(shù)據(jù)庫(kù),便于切換
2022-11-260個(gè)贊
Courses in the relevant section:Aggregate . Native . Subquery
兩張表之間的子查詢(第一張表有id,name;第二張表有uid,性別) //求出所有男的uid $subQuery = Db::name('two)->field('uid')->where('gender','男')->buildSql(true); //查詢出所有性別為男的所有用戶信息 $result = Db::name('one')->where('id', 'exp', 'IN' .$subQuery)->select(); 第二種方法 $result = Db::name('one')->where('id','in',function($query){ $query->name('two')->field('uid')->where('gender','男'); })->select();
2022-11-270個(gè)贊
Courses in the relevant section:Chain query method (Part 1)
使用field()方法,可以指定要查詢的字段
2022-11-270個(gè)贊