直接贴代码,记录一下,备用
$a = Db::name(表名)->field(字段)->where(条件)->buildSql();
$b = Db::name(表名)->field(字段)->where(条件)->buildSql();
$c = Db::name(表名)->field(字段)->where(条件)->union([$a, $b])->buildSql();
$list = Db::table($c . ' a')->order(排序)->paginate(每页个数);
直接贴代码,记录一下,备用
$a = Db::name(表名)->field(字段)->where(条件)->buildSql();
$b = Db::name(表名)->field(字段)->where(条件)->buildSql();
$c = Db::name(表名)->field(字段)->where(条件)->union([$a, $b])->buildSql();
$list = Db::table($c . ' a')->order(排序)->paginate(每页个数);
该资源仅限VIP专享下载