收藏
回答

对不执行的语句进行报错?

if (jump == 0{

            await db.collection(CollectionName).orderBy('num','asc')

            .where({

              excel_name:excel_name,

              phenomenon:condition[1]

            }).limit(num).get().then(res =>{

              let data = res.data

              let length = data.length

              num_record = length

              for(let i=0;i<length;i++){

                  if (data[i].Quest1 != result_container{

                    result_container = data[i].Quest1

                    if(result_container != null){

                      if (data[i].Answer1 == null{

                        if (!tip_flag{tip_flag = true} 

                        tips.push(data[i].tips)

                      }else{

                        tips.push('no tips')

                      }

                      if (p_last < data[i].num{p_last = data[i].num}

                      result.push(result_container)

                    }

                  }

              }

            })

          }else{

            await db.collection(CollectionName).orderBy('num','asc').skip(jump)

            .where({

              excel_name:excel_name,

              phenomenon:condition[1]

            }).limit(num).get().then(res =>{

              let data = res.data

              let length = data.length

              num_record = length

              for(let i=0;i<length;i++){

                  if (data[i].Quest1 != result_container{

                    result_container = data[i].Quest1

                    if(result_container != null){

                      if (data[i].Answer1 == null{

                        if (!tip_flag{tip_flag = true} 

                        tips.push(data[i].tips)

                      }else{

                        tips.push('no tips')

                      }

                      if (p_last < data[i].num{p_last = data[i].num}

                      result.push(result_container)

                    }

                  }

              }

            }

          }

这个从返回的save变量可以看出collection.skip不执行的,程序在调用云函数时依旧报错

回答关注问题邀请回答
收藏

1 个回答

  • 旺财
    旺财
    2023-12-11

    小程序调试的时候报错,本地调试不报错,云端调试也不报错,麻了

    2023-12-11
    有用
    回复
登录 后发表内容