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)=>{
if(err){
router.get('/queryChildType',(req,res)=>{
const{type_id}=req.query
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)=>{
if(err){
res.send({
success:false,
err
})
}
res.send({
success:false,
err
success:true,
data:result
})
}
res.send({
success:true,
data:result
})
})
});
});
router.get('/queryToolBox',(req,res)=>{
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 = ?`
if(!isFollow&&!type_id){
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
router.get('/queryToolBox',(req,res)=>{
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 = ?`
if(!isFollow&&!type_id){
SQL=`SELECT * FROM toolbox`
}
if(isFollow){
type_id=JSON.parse(type_id)
SQL='SELECT * FROM toolbox WHERE toolbox_id IN (?)'