:::info 💡 对于响应的源始JSON,最终需要标准成为表格过程中,可归纳为三种不同型态:1.List或Object型:列表下级为需要解析的对象{},包含二级对象{},不包含列表[]。2.List: 对象中都有相同数组[]。3.混合模式。
    除三种格式以外。还有一种JSON字段,对于非LIST ,LIST类型的处理。以源字串型试显示,可以用于MYSQL8.0存储和查询,也可以直接存放MSSQL中,程序做二次处理。 :::

    1. {
    2. "self_support_gmv": {
    3. "value": 67808291,
    4. "unit": "price"
    5. },
    6. "other_gmv": {
    7. "value": 0,
    8. "unit": "price"
    9. },
    10. "self_support_gmv_rate": {
    11. "value": 1,
    12. "unit": "percent"
    13. },
    14. "other_gmv_rate": {
    15. "value": 0,
    16. "unit": "percent"
    17. }
    18. }
    1. [
    2. [
    3. 0,
    4. 50022703,
    5. "大家电",
    6. 1
    7. ],
    8. [
    9. 0,
    10. 50023724,
    11. "其他",
    12. 1
    13. ],
    14. [
    15. 0,
    16. 50230002,
    17. "服务商品",
    18. 1
    19. ],
    20. [
    21. 50022703,
    22. 350301,
    23. "洗衣机",
    24. 2
    25. ],
    26. [
    27. 50022703,
    28. 50022734,
    29. "大家电配件",
    30. 2
    31. ],
    32. [
    33. 50023724,
    34. 50023725,
    35. "邮费",
    36. 2
    37. ],
    38. [
    39. 50023724,
    40. 50023728,
    41. "赠品",
    42. 2
    43. ],
    44. [
    45. 50230002,
    46. 50232002,
    47. "电保包",
    48. 2
    49. ],
    50. [
    51. 50023724,
    52. 124988005,
    53. "有价优惠券",
    54. 2
    55. ],
    56. [
    57. 50022703,
    58. 126664001,
    59. "洗烘套装",
    60. 2
    61. ],
    62. [
    63. 50022703,
    64. 201128001,
    65. "冰洗套装",
    66. 2
    67. ],
    68. [
    69. 50022703,
    70. 201131101,
    71. "冰箱",
    72. 2
    73. ]
    74. ]
    1. {
    2. "index_selected": [
    3. "pay_amt",
    4. "refund_amt"
    5. ],
    6. "data_head": [
    7. {
    8. "index_display": "成交金额",
    9. "index_name": "pay_amt",
    10. "value": {
    11. "value": 67808291,
    12. "unit": "price"
    13. },
    14. "change_value": {
    15. "value": -0.090654130922042955,
    16. "unit": "ratio"
    17. },
    18. "index_tip": "本店全部商品在抖音、火山、头条、西瓜视频当天支付成功或货到付款确认的订单金额汇总,包含退款金额"
    19. },
    20. {
    21. "index_display": "商品曝光次数",
    22. "index_name": "product_show_pv",
    23. "value": {
    24. "value": 1773084,
    25. "unit": "number"
    26. },
    27. "change_value": {
    28. "value": -0.03711624274816705,
    29. "unit": "ratio"
    30. },
    31. "index_tip": "本店全部商品在抖音、火山中的直播、短视频、商品卡展现的曝光次数"
    32. },
    33. {
    34. "index_display": "千次观看成交金额",
    35. "index_name": "gpm",
    36. "value": {
    37. "value": 38243.135125013818,
    38. "unit": "price"
    39. },
    40. "change_value": {
    41. "value": -0.055513075163602432,
    42. "unit": "ratio"
    43. },
    44. "index_tip": "抖音/火山成交金额/商品曝光数*1000"
    45. },
    46. {
    47. "index_display": "退款金额",
    48. "index_name": "refund_amt",
    49. "value": {
    50. "value": 40355855,
    51. "unit": "price"
    52. },
    53. "change_value": {
    54. "value": -0.0025569394947867,
    55. "unit": "ratio"
    56. },
    57. "index_tip": "抖音、火山、头条、西瓜视频所有退款成功商品的退款金额,仅包含走售后系统且退款成功的订单(含货到付款),不含线下退款(如先行赔付等),包含发货前和发货后退款"
    58. },
    59. {
    60. "index_display": "商品点击率",
    61. "index_name": "product_click_ratio",
    62. "value": {
    63. "value": 0.097535706148157666,
    64. "unit": "ratio"
    65. },
    66. "change_value": {
    67. "value": -0.019595114997089928,
    68. "unit": "ratio"
    69. },
    70. "index_tip": "商品点击数/商品总浏览量,商品点击数:所选时间范围内本店全部商品在抖音、火山中的直播、短视频、商品卡展现的点击次数"
    71. },
    72. {
    73. "index_display": "点击-支付转化率",
    74. "index_name": "click_pay_ratio",
    75. "value": {
    76. "value": 0.0460277901456583,
    77. "unit": "ratio"
    78. },
    79. "change_value": {
    80. "value": -0.087142901836757436,
    81. "unit": "ratio"
    82. },
    83. "index_tip": "抖音、火山中的成交订单数/商品点击数,商品点击数:所选时间范围内本店全部商品在抖音、火山中的直播、短视频、商品卡展现的点击次数"
    84. },
    85. {
    86. "index_display": "成交人数",
    87. "index_name": "pay_ucnt",
    88. "value": {
    89. "value": 7269,
    90. "unit": "number"
    91. },
    92. "change_value": {
    93. "value": -0.12157099697885196,
    94. "unit": "ratio"
    95. },
    96. "index_tip": "抖音、火山、头条、西瓜当天支付成功或货到付款确认的用户数汇总,包含退款用户"
    97. },
    98. {
    99. "index_display": "成交件数",
    100. "index_name": "pay_combo_cnt",
    101. "value": {
    102. "value": 7977,
    103. "unit": "number"
    104. },
    105. "change_value": {
    106. "value": -0.14068727781967036,
    107. "unit": "ratio"
    108. },
    109. "index_tip": "抖音、火山抖音、火山、头条、西瓜当天支付成功或货到付款确认的商品件数汇总,包含退款商品"
    110. },
    111. {
    112. "index_display": "成交件单价",
    113. "index_name": "product_unit_price",
    114. "value": {
    115. "value": 8500.47524131879,
    116. "unit": "price"
    117. },
    118. "change_value": {
    119. "value": 0.058224608581004693,
    120. "unit": "ratio"
    121. },
    122. "index_tip": "成交金额/成交件数"
    123. },
    124. {
    125. "index_display": "成交订单数",
    126. "index_name": "pay_cnt",
    127. "value": {
    128. "value": 7960,
    129. "unit": "number"
    130. },
    131. "change_value": {
    132. "value": -0.13824834903107069,
    133. "unit": "ratio"
    134. },
    135. "index_tip": "抖音、火山、头条、西瓜当天支付成功或货到付款确认的子订单数,包含退款的子订单数"
    136. },
    137. {
    138. "index_display": "商品访客数",
    139. "index_name": "product_show_uv",
    140. "value": {
    141. "value": 123342,
    142. "unit": "number"
    143. },
    144. "change_value": {
    145. "value": -0.10196800803803505,
    146. "unit": "ratio"
    147. },
    148. "index_tip": "本店全部商品在抖音、火山中的直播、短视频、商品卡曝光的去重人数(同一用户访问多个商品只被计算1次)"
    149. },
    150. {
    151. "index_display": "商品点击人数",
    152. "index_name": "product_click_uv",
    153. "value": {
    154. "value": 54142,
    155. "unit": "number"
    156. },
    157. "change_value": {
    158. "value": -0.0761854385994847,
    159. "unit": "ratio"
    160. },
    161. "index_tip": "本店全部商品在抖音、火山中的直播、短视频、商品卡点击的去重人数(同一用户点击多个商品只被计算1次)"
    162. }
    163. ],
    164. "data_result": {
    165. "unit": {
    166. "pay_amt": "price",
    167. "refund_amt": "price"
    168. },
    169. "value": [
    170. {
    171. "x": "06/28",
    172. "y": {
    173. "pay_amt": 16850840,
    174. "refund_amt": 6445922
    175. }
    176. },
    177. {
    178. "x": "06/29",
    179. "y": {
    180. "pay_amt": 17241060,
    181. "refund_amt": 6880208
    182. }
    183. },
    184. {
    185. "x": "06/30",
    186. "y": {
    187. "pay_amt": 14073460,
    188. "refund_amt": 7020003
    189. }
    190. },
    191. {
    192. "x": "07/01",
    193. "y": {
    194. "pay_amt": 5060670,
    195. "refund_amt": 5629507
    196. }
    197. },
    198. {
    199. "x": "07/02",
    200. "y": {
    201. "pay_amt": 582110,
    202. "refund_amt": 4554126
    203. }
    204. },
    205. {
    206. "x": "07/03",
    207. "y": {
    208. "pay_amt": 7986600,
    209. "refund_amt": 4790756
    210. }
    211. },
    212. {
    213. "x": "07/04",
    214. "y": {
    215. "pay_amt": 6013551,
    216. "refund_amt": 5035333
    217. }
    218. }
    219. ]
    220. }
    221. }

    image.png
    1656992031235.jpg
    image.png
    从JSON查表,可以看出是一个包含多种结构形式的情况,不能用常规转表模式
    image.png

    image.png
    image.pngimage.png
    这里以json字段直接存放数据库
    image.png
    image.png