Foxtable(狐表)用户栏目专家坐堂 → 将返回信息填入表格


  共有2176人关注过本帖树形打印复制链接

主题:将返回信息填入表格

帅哥哟,离线,有人找我吗?
fubblyc
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2355 积分:16187 威望:0 精华:0 注册:2013/9/1 8:09:00
将返回信息填入表格  发帖心情 Post By:2019/1/3 21:01:00 [显示全部帖子]

甜老师,我建了对应字段的表,要将这些填入新增行,自己慢慢调试也可以写出来,但是因为时间紧,可否请甜老师帮忙写一下吗~~~
{
"order_list": [
{
"order_id": "Z2y2rY74ksZX1ceuGA",
"page_id": "abcedfghifk=+Uasdaseq14fadkf8123h4jk",
"trans_id": "4001562001201608292531663351",
"create_time": 123,
"pay_finish_time": 123,
"total_price": 123,
"open_id": "123",
"accepter_openid": "123",
"card_list": [
{
"card_id": "card_id_1",
"price": 123,
"code": "code_123456",
"default_gifting_msg": "",
"background_pic_url": "",
"accepter_openid": "123"
}
],
"outer_str": "web","IsChatRoom": true
},
{
"order_id": "Z2y2rY74ksZX1ceuGA",
"page_id": "abcedfghifk=+Uasdaseq14fadkf8123h4jk",
"trans_id": "4001562001201608292531663351",
"create_time": 123,
"pay_finish_time": 123,
"total_price": 123,
"open_id": "123",
"accepter_openid": "123",
"card_list": [
{
"card_id": "card_id_1",
"price": 123,
"code": "code_123456",
"default_gifting_msg": "",
"background_pic_url": ""
}
],
"outer_str": "web"
}
]
}
[此贴子已经被作者于2019/1/3 21:01:36编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
fubblyc
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2355 积分:16187 威望:0 精华:0 注册:2013/9/1 8:09:00
  发帖心情 Post By:2019/1/3 22:05:00 [显示全部帖子]

甜老师,我这样写,会出现这种错行的情况,要怎么处理呢。。

图片点击可在新窗口打开查看此主题相关图片如下:微信截图_20190103220203.png
图片点击可在新窗口打开查看
Dim nms() As String = {"order_id","page_id","trans_id","create_time","pay_finish_time","total_price","open_id","accepter_openid","outer_str","IsChatRoom","background_pic_url","nickname"} '列名
Dim nms1() As String = {"card_id","price","code","default_gifting_msg","background_pic_url","accepter_openid"}
If jo1("errcode") = "0" Then
    Dim ia As JArray = jo1("order_list") '获取的用户信息列表
    For Each jt As JToken In ia
        Dim dr As DataRow = DataTables("微信礼品卡订单信息").Find("order_id = '" & jt("order_id").ToString() & "'")
        If dr Is Nothing Then
            dr = DataTables("微信礼品卡订单信息").AddNew()
            For Each nm As String In nms
                dr(nm) = jt(nm)
            Next
            
            Dim ia1 As JArray = jt("card_list") '获取的用户信息列表
            For Each jt1 As JToken In ia1
                Dim dr1 As DataRow = DataTables("微信礼品卡订单信息").Find("code = '" & jt1("code").ToString() & "' and card_id = '" & jt1("card_id").ToString() & "' ")
                If dr1 Is Nothing Then
                    dr1 = DataTables("微信礼品卡订单信息").AddNew()
                    For Each nm1 As String In nms1
                        dr1(nm1) = jt1(nm1)
                    Next
                End If
            Next
            
        End If
    Next
Else
    output.show("1:" & jo1.ToString)
End If

 回到顶部