add an all plant filter
This commit is contained in:
parent
cad5a647f1
commit
ed1e7546a7
@ -118,10 +118,11 @@ fun <T> applyVendorHelper(q: io.ebean.ExpressionList<T>, vids: List<Long>?) {
|
|||||||
|
|
||||||
fun <T> applyPlantFilter(q: io.ebean.ExpressionList<T>, vids: List<Long>?) {
|
fun <T> applyPlantFilter(q: io.ebean.ExpressionList<T>, vids: List<Long>?) {
|
||||||
|
|
||||||
if (vids.isNullOrEmpty()) {
|
val v = vids?.filter { it > 0 } ?: emptyList()
|
||||||
|
if (v.isEmpty()) {
|
||||||
q.`in`("unloadingPlantId", Session.currentUserPlants().map { it.plantId })
|
q.`in`("unloadingPlantId", Session.currentUserPlants().map { it.plantId })
|
||||||
} else {
|
} else {
|
||||||
q.`in`("unloadingPlantId", vids.map { it.toString() })
|
q.`in`("unloadingPlantId", v.map { it.toString() })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user