$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}]
这是我的控制器条件和输出,在上面的输出中,我想获取状态计数,其值仅为零。我不想全部计数,怎么可能只获得状态零计数,请帮助...谢谢
答案 0 :(得分:0)
尝试
在查询中添加where('status',0)
它将起作用