Php Laravel雄辩地选择仅数据特定术语
我有一个带有几个状态条件的数据表。 例如:Php Laravel雄辩地选择仅数据特定术语,php,laravel,Php,Laravel,我有一个带有几个状态条件的数据表。 例如: status=“待定”、“已批准”、“已拒绝” 如何使用雄辩的查询选择状态为“待定”、“仅被拒绝”的列?如果需要选择状态为“待定”或“被拒绝”的数据,请使用其中(): 或或where(): Model::whereIn('status', ['pending', 'rejected'])->get(); Model::where('status', 'pending')->orWhere('status', 'rejected')->
status=“待定”、“已批准”、“已拒绝”
如何使用雄辩的查询选择状态为“待定”、“仅被拒绝”的列?如果需要选择状态为“待定”或“被拒绝”的数据,请使用
其中()
:
或或where()
:
Model::whereIn('status', ['pending', 'rejected'])->get();
Model::where('status', 'pending')->orWhere('status', 'rejected')->get();