您的位置:首页 > 编程语言 > PHP开发

thinkphp5 & 数据库多表联查 & where多条件查询

2018-03-27 18:07 369 查看
数据库多表联查

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();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  多表联查