收藏
回答

如何把多个缓存的数据入库一个表?

我有4个缓存,完成支付后,它们写到云数据库的一个表里...

// 读取缓存
wx.getStorageInfo({
  success: function(res) {
      console.log(res)
    console.log(res.keys)
  }
})


// console.log

萌新一枚,虚心请教大佬。

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

2 个回答

  • Ruderal
    Ruderal
    2022-07-22

    附上方法

    //  缓存入库
    db.collection("songguo_orders").add({ 
      data:{
           order_time: wx.getStorageSync('times'),   //  松果订单创建时间戳
           orderid: wx.getStorageSync('orders').orderid,   //  松果单号
           address: wx.getStorageSync('address_info').provinceName + wx.getStorageSync('address_info').cityName + wx.getStorageSync('address_info').countyName + wx.getStorageSync('address_info').detailInfo     //  地址
         }
     });
    
    2022-07-22
    有用
    回复
  • Ray
    Ray
    2022-07-20

    先读取缓存 然后插入4个数据就可以了啊

    2022-07-20
    有用
    回复 1
    • Ruderal
      Ruderal
      2022-07-22
      是的宝,搞定了,/(ㄒoㄒ)/~~
      2022-07-22
      回复
登录 后发表内容