$selected_subcats2 = EstablishmnetSubcategories::Join('establishments','establishments.id','=','establishment_subcategories.establishment_id')->where('establishment_subcategories.establishment_id',$establishment_id)->get(array('establishment_subcategories.status as status'));
Result:[{"status":0},{"status":1},{"status":1},{"status":0},{"status":0}]
这是我的控制器条件和输出,在上面的输出中,我想得到状态的计数,其值仅为零。我不想计数所有,如何可能只获得状态零计数,请帮助。。。谢谢
尝试这个
在查询中添加where('status',0)
它将工作