UnknownSec Bypass
403
:
/
var
/
www
/
stp-bhaktisagar-backend
/
src
/
models
/ [
drwxrwxr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
book.model.js
const { runMySqlQuery } = require("../config/mysql"); const commonModel = require("./common.model"); exports.getCategoryById = async (id) => { let results = await runMySqlQuery( ` SELECT * FROM book_category WHERE FIND_IN_SET(?,items); `, [id] ); return results; }; exports.removeFromCategoryById = async (id) => { let playlist = await this.getCategoryById(id); for (const plData of playlist) { let plAudio = plData.items ? plData.items.split(",") : []; let index = plAudio.indexOf(id); plAudio.splice(index, 1); plAudio = plAudio.join(","); await commonModel.insertOrUpdate( "book_category", { items: plAudio }, "where id=?", [plData.id] ); } }; exports.getAll = async (id) => { let results = await runMySqlQuery( `SELECT book.*,(SELECT CONCAT("[", GROUP_CONCAT( CONCAT('{"title":"',title,'"'), CONCAT(',"title_hi":"',title_hi,'"'), CONCAT(',"id":"',id,'"}') ) ,"]") FROM book_category where FIND_IN_SET(book.id,book_category.items)) as book_category FROM book ` ); return results; }; exports.getCollectionsById = async (id) => { let results = await runMySqlQuery( ` SELECT * FROM book_collections WHERE FIND_IN_SET(?,items); `, [id] ); return results; }; exports.categoryRemoveFromCollectionsById = async (id) => { let collections = await this.getCollectionsById(id); for (const cdata of collections) { let pl = cdata.items ? cdata.items.split(",") : []; let index = pl.indexOf(id); index != -1 && pl.splice(index, 1); pl = pl.join(","); await commonModel.insertOrUpdate( "book_collections", { items: pl }, "where id=?", [cdata.id] ); } };
Copyright © 2025 - UnknownSec