I am trying to book create a time slot and find between time in two-time value this code is always returned value 0.
async store({request, auth, response}) {
let {uuid, start_timestamp, end_timestamp, price} = request.all();
try {
let influencer = await auth.getUser();
let avaliabelBookinSlot = await Database.from('booking_slots')
.where('influencer_id', influencer.id)
.where(function () {
this
.where(function () {
this
.where('start_timestamp', '>', start_timestamp)
.where('start_timestamp', '<', end_timestamp)
}).orWhere(function () {
this
.where('end_timestamp', '>', start_timestamp)
.where('end_timestamp', '<', end_timestamp)
})
}).orWhere(function () {
this
.where('start_timestamp', '>', start_timestamp)
.where('end_timestamp', '<', end_timestamp)
})
console.log(avaliabelBookinSlot.length)
}