constSQL='SELECT child_type.child_type_id, child_type.child_type_name, child_type.type_id FROM child_type INNER JOIN type ON child_type.type_id = type.type_id WHERE type.type_id = ?'
constSQL='SELECT child_type.child_type_id, child_type.child_type_name, child_type.type_id FROM child_type INNER JOIN type ON child_type.type_id = type.type_id WHERE type.type_id = ?'
Mysql.query(SQL,[type_id],(err,result)=>{
Mysql.query(SQL,[type_id],(err,result)=>{
if(err){
if(err){
res.send({
success:false,
err
})
}
res.send({
res.send({
success:false,
success:true,
err
data:result
})
})
}
res.send({
success:true,
data:result
})
})
})
});
});
router.get('/queryToolBox',(req,res)=>{
router.get('/queryToolBox',(req,res)=>{
let{isFollow,type_id}=req.query
let{isFollow,type_id}=req.query
letSQL=`SELECT toolbox.*, type_childtype_toolbox.child_type_id FROM type_childtype_toolbox INNER JOIN toolbox ON type_childtype_toolbox.toolbox_id = toolbox.toolbox_id WHERE type_childtype_toolbox.type_id = ?`
letSQL=`SELECT toolbox.*, type_childtype_toolbox.child_type_id FROM type_childtype_toolbox INNER JOIN toolbox ON type_childtype_toolbox.toolbox_id = toolbox.toolbox_id WHERE type_childtype_toolbox.type_id = ?`
if(!isFollow&&!type_id){
if(!isFollow&&!type_id){
SQL=`SELECT * FROM toolbox`
SQL=`SELECT * FROM toolbox`
}
if(isFollow){
type_id=JSON.parse(type_id)
SQL='SELECT * FROM toolbox WHERE toolbox_id IN (?)'
}
Mysql.query(SQL,[type_id],(err,result)=>{
if(err){
res.send({
success:false,
err
})
throwerr
}
}
if(isFollow){
type_id=JSON.parse(type_id)
SQL='SELECT * FROM toolbox WHERE toolbox_id IN (?)'