您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
webman-查詢構造器-判斷記錄是否存在
发布时间:2022-02-01 21:25:26编辑:雪饮阅读()
控制器實現如:
public function index(Request $request)
{
$id86=Db::table('ecms_news')->where('id', 86)->exists();
$id220807=Db::table('ecms_news')->where('id', 220807)->exists();
$did86=Db::table('ecms_news')->where('id', 86)->doesntExist();
$did220807=Db::table('ecms_news')->where('id', 220807)->doesntExist();
$all=compact("id86","id220807","did86","did220807");
var_dump($all);
return response("ok");
}
實例被訪問:
訪問了全局中間件!
array(4) {
["id86"]=>
bool(true)
["id220807"]=>
bool(false)
["did86"]=>
bool(false)
["did220807"]=>
bool(true)
}
关键字词:webman,查詢構造器,判斷記錄是否存在
上一篇:webman-查詢構造器-聚合