-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
43 lines (42 loc) · 1.85 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// const mysql = require('mysql');
// const config = require('./config');
// const conn = mysql.createConnection(config);
// const obj = require('./ec.json');
// let editorChoice = obj.editorChoice;
// console.log(editorChoice[0]);
// editorChoice.forEach(element => {
// // let concept = element.concept.calm + "/" + element.concept.sightSeeing + "/" + element.concept.dandy + "/" + element.concept.food + "/" + element.concept.activity + "/" + element.concept.luxury + "/" + element.concept.love + "/" + element.concept.party
// // conn.query(
// // "INSERT INTO PackageTrip VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)",
// // [element.id, element.name, element.price, element.days, element.rating, element.area, element.distance, element.description, concept],
// // (err, result) => {
// // if(err) throw err;
// // console.log(result)
// // }
// // )
// element.places.forEach(place => {
// // console.log(element.image_url)
// conn.query(
// "INSERT INTO PackageImage(picurl, trip_id) VALUES(?, ?)",
// [place.image_url[0], element.id],
// (err, result) => {
// if (err) throw err;
// console.log(result);
// }
// )
// if(place.id == 1) {
// console.log(place);
// }
// })
// // console.log(element.id);
// // console.log(element.name);
// // console.log(element.place);
// // console.log(element.price);
// // console.log(element.days);
// // console.log(element.rating);
// // console.log(element.area);
// // console.log(element.distance);
// // console.log(element.description);
// // let concept = element.concept.calm + "/"+ element.concept.sightSeeing + "/"+ element.concept.dandy + "/"+ element.concept.food + "/"+ element.concept.activity + "/"+ element.concept.luxury + "/"+ element.concept.love + "/"+ element.concept.party
// // console.log(concept);
// });