您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
webman-查詢構造器-Union 语句-合并結果集
发布时间:2022-02-04 17:38:09编辑:雪饮阅读()
webman也有union查詢,也就是合并結果集,但是呢,合并結果集這不用想肯定都是影響性能的,但是實際上身不由己,有時候還是需要的。
那麽在webman中控制器中的實現如:
public function index(Request $request)
{
ini_set('memory_limit','4096M');
$news = Db::table('ecms_news')
->whereNull('classid')
->where("id",114);
$unionNews = Db::table('ecms_news')
->whereNull('filename')
->where('id',83)
->union($news)
->get();
var_dump($unionNews);
return response("ok");
}
實例被訪問后大致這樣:
[root@localhost webman]# /usr/local/php734/bin/php -c /usr/local/php734/lib/php.ini start.php start
Workerman[start.php] start in DEBUG mode
----------------------------------------- WORKERMAN -----------------------------------------
Workerman version:4.0.26 PHP version:7.3.4
------------------------------------------ WORKERS ------------------------------------------
proto user worker listen processes status
tcp root webman http://0.0.0.0:8787 4 [OK]
tcp root monitor none 1 [OK]
---------------------------------------------------------------------------------------------
Press Ctrl+C to stop. Start success.
訪問了全局中間件!
object(Illuminate\Support\Collection)#52 (2) {
["items":protected]=>
array(0) {
}
["escapeWhenCastingToString":protected]=>
bool(false)
}
关键字词:webman,查詢構造器,Union,合并結果集