Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const userSchema = new Schema({
- mode : {type: Number, required : true},
- name : {type : String, required : true},
- surname : {type : String, required : true},
- email : {type : String, required : true},
- phone : {type : Number, required : true},
- community : {type : String, required : true},
- city : {type : String, required: true},
- password : {type : String, required: true},
- instagram : {type : String},
- facebook : {type : String},
- twitter : {type : String},
- portfolio : {type : String},
- tutorial : {type : Boolean, default : true},
- ban : {type : Boolean, default : false}
- });
- const OffersSchema = new Schema ({
- id_advisor : {type : String, required : true},
- title : {type : String, required : true},
- short_description : {type : String, required: true, max : 150},
- description : {type : String, required: true},
- price_max : {type : String, required : true},
- start_date : {type : Date, default : date},
- end_date : {type : Date, default : end_date},
- finished : {type : Boolean, default : false},
- id_user : {type : String},
- paid : {type : Boolean, default: false},
- city : {type : String, required: true},
- transation_id : {type : String}
- });
- const resultOffers = await Offers.find({city : req.user.city}).sort({start_date: "desc"});
- {{#each resultOffers}}
- $consult1 = "SELECT * FROM usuarios WHERE city = '$city' ORDER BY start_date DESC";
- $result1 = mysql_query($consult1);
- while($row = mysql_fetch_assoc($result1) {
- $id_advisor = $row['id_advisor'};
- $consult2 = "SELECT * FROM users WHERE id = '$id_advisor'";
- $result = mysq_query($consult2);
- while($row2 = mysql_fetch_assoc($result2) {
- $name = $row2['name'] // AQUI TENGO YA EL NOMBRE
- }
- }
Add Comment
Please, Sign In to add comment