Javascript Adonis js Where子句不起作用。此代码始终返回值0

Javascript Adonis js Where子句不起作用。此代码始终返回值0,javascript,node.js,laravel,knex.js,adonis.js,Javascript,Node.js,Laravel,Knex.js,Adonis.js,我正在尝试预订创建一个时隙,并在两个时间值中查找时间间隔。此代码始终返回值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

我正在尝试预订创建一个时隙,并在两个时间值中查找时间间隔。此代码始终返回值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)
异步存储({request,auth,response}){
让{uuid,start_timestamp,end_timestamp,price}=request.all();
试一试{
让影响者=等待auth.getUser();
let availablebookinslot=wait Database.from('booking\u slots'))
.where('influencer\u id',influencer.id)
.其中(函数(){
这
.其中(函数(){
这
.where('start\u timestamp','>',start\u timestamp)
.where('start\u timestamp','',start\u timestamp)
.where('结束时间戳','',开始时间戳)

.where('end_timestamp','您可以尝试使用以下where条件:

await Database.from('booking_slots').where({
        {'start_timestamp', '>', start_timestamp},
        {'start_timestamp', '<', end_timestamp} });

    
wait Database.from('booking_slot')。在哪里({
{'start_timestamp','>',start_timestamp},

{'start_timestamp','而不是需要使用where和andWhere的where

this.where('start_timestamp', '>', start_timestamp).andWhere('end_timestamp', '<', end_timestamp)
this.where('start\u timestamp','>',start\u timestamp).和where('end\u timestamp','