2016-04-29 93 views
1

我有一个问题,使用LARAVEL VALIDATIONlaravel validation with delete_at

我希望deleted_at为空,但我得到deleted_at = NULL

'level_name' => 'unique:company_levels,level_name,' . $id . ',id,company_id,' . $company_id.',deleted_at,null', 

它生成一个查询像下面

select count(*) as aggregate from `company_level` where `level_name` = 'Chennai' and `id` <> 1 and `company_id` = 3 and `deleted_at` = null 
这是不符合我的需要

我需要生成类似下面

select count(*) as aggregate from `company_level` where `level_name` = 'Chennai' and `id` <> 1 and `company_id` = 3 and `deleted_at` is null 

由于查询提前

回答

0

问题通过更换空为NULL解决。空

退出查询

使用资本NULL替换

',deleted_at,null', 

我通过

',deleted_at,NULL', 
取代了它