【发布时间】:2020-11-07 17:33:26
【问题描述】:
我想从表中的“category_type”字段中获取 [null]、空白或空格的值 我想获取 category_type 中的 [null]、blank、'Uncategorized' 或空格。 现在我只能获取空值。也需要获取空值。如何在 laravel 查询中的 postgres db 中获取空值字段。
我已经创建了变量$category=[]
if(in_array('Uncategorized',$category)){
$category[]='';
$category[]='-';
$category[]=' ';
$category[]=null;
}
$table=DB::('category')->where('category.category_type',$category)->pluck('name')->toArray();
【问题讨论】:
-
试试
whereIn()和whereNull。 -
这个话题可能会有所帮助:stackoverflow.com/questions/40657940/…
标签: php laravel postgresql laravel-5