ThinkPHP 数据库多表联查 where多条件查询

数据库多表联查

Db::table('think_artist')
->alias('a')    // alias 表示命名数据库的别称为a
->join('think_work w','a.id = w.artist_id')
->join('think_card c','a.card_id = c.id')
->select();

数据库 多条件查询

// 使用数组的形式查询数据,db是是数据库的助手函数,注意去掉前缀
$data = db('cms_document')->where(array('cid'=>array("in","5,6")))->select();

猜你喜欢

转载自blog.csdn.net/weixin_35773751/article/details/79717137