直接貼代碼,記錄一下,備用ui
$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(每頁個數);
原文地址:https://blog.jkloozx.com/?id=163spa