69 lines
3.8 KiB
JavaScript
Executable File
69 lines
3.8 KiB
JavaScript
Executable File
module.exports = {
|
|
mysql: {
|
|
connectionLimit : 100,
|
|
host: 'localhost',
|
|
user: 'root',
|
|
password: 'lb714500',
|
|
database: 'lost'
|
|
},
|
|
jwt: 'Pc!0YQPA$57iksjA',
|
|
rsa: {
|
|
private_key: '../config/private_key.pem',
|
|
public_key: '../config/public_key.pem'
|
|
},
|
|
filter: {
|
|
login: '/user/login',
|
|
add: '/user/add',
|
|
home: '/home/index',
|
|
// type: '/type/list',
|
|
// banner: '/home/banner',
|
|
// recommend: '/home/recommend'
|
|
},
|
|
sql: {
|
|
getUserAddress: 'SELECT user_address from `user` where user_id = ?',
|
|
updateUserMoney: 'UPDATE `user` SET user_money = ? WHERE user_id = ?',
|
|
userOrderTotalMoney: 'SELECT goods_totalprice from goods where goods_id = ?',
|
|
getUserMoney: 'SELECT user_money from `user` where user_id = ?',
|
|
buyOrder: 'UPDATE goods SET goods_status = ? WHERE goods_id = ?',
|
|
getStatusOrder: 'SELECT goods.*, wares.* FROM goods, wares WHERE goods.wares_id = wares.wares_id AND goods.user_id = ? AND goods.goods_status = ?',
|
|
getAllOrder: 'SELECT goods.*, wares.* FROM goods, wares WHERE goods.wares_id = wares.wares_id AND goods.user_id = ?',
|
|
addCarToOrder: 'INSERT INTO goods (user_id,wares_id,goods_num,goods_price,goods_totalprice) VALUES (?,?,?,?,?)',
|
|
updateCarNum: 'UPDATE car SET car_num = ? WHERE car_id = ?',
|
|
deleteCarShop: 'DELETE FROM car WHERE car_id = ?',
|
|
getCarList: 'SELECT car.user_id,car.car_id,car.car_num, wares.* FROM car ,wares WHERE car.wares_id = wares.wares_id AND car.user_id = ?',
|
|
selectCarShop: 'SELECT * from car where user_id = ? and wares_id = ?',
|
|
addCar: 'INSERT INTO car (user_id,wares_id,car_num) VALUES (?,?,?)',
|
|
getLikeList: 'SELECT collection.like_id, wares.* FROM collection ,wares WHERE collection.wares_id = wares.wares_id AND collection.user_id = ?',
|
|
selectLike: 'SELECT * from collection where wares_id = ? and user_id = ?',
|
|
|
|
getSearchShop: `SELECT * from wares where wares_title LIKE "%?%"`,
|
|
getTypeList: 'SELECT wares_title,wares_id,wares_masterimg from wares where wares_type = ?',
|
|
|
|
edit: `UPDATE lost_user SET user_city = ?,user_name = ?,user_portrait = ?,user_school = ? WHERE user_id = ?`,
|
|
|
|
getStatistics: `select (select count(*) from lost_thing WHERE thing_type = 1 AND user_id = ?) as lose_matter ,(select count(*) from lost_thing WHERE thing_type = 2 AND user_id = ?) as search_matter`,
|
|
|
|
getHistory: 'SELECT * from lost_thing where user_id = ? AND thing_type = ?',
|
|
|
|
|
|
changeStatus: 'UPDATE lost_thing SET thing_status = ? WHERE thing_id = ? AND user_id = ?',
|
|
|
|
|
|
allTabs: 'SELECT lost_user.user_name, lost_user.user_portrait, lost_user.user_id, lost_thing.* FROM lost_user, lost_thing WHERE lost_user.user_id = lost_thing.user_id AND thing_type=? ORDER BY thing_id DESC LIMIT ?,10',
|
|
|
|
tabs: 'SELECT lost_user.user_name, lost_user.user_portrait, lost_user.user_id, lost_thing.* FROM lost_user, lost_thing WHERE lost_user.user_id = lost_thing.user_id AND thing_type=? AND thing_category=? ORDER BY thing_id DESC LIMIT ?,10',
|
|
|
|
search: `SELECT lost_user.user_name, lost_user.user_portrait, lost_user.user_id, lost_thing.* FROM lost_user, lost_thing WHERE lost_user.user_id = lost_thing.user_id AND thing_title LIKE "%"?"%" LIMIT ?,10`,
|
|
|
|
getInfo: 'SELECT lost_user.user_name, lost_user.user_portrait, lost_user.user_school,lost_user.user_id, lost_user.user_phone, lost_thing.* FROM lost_user, lost_thing WHERE lost_user.user_id = lost_thing.user_id AND thing_id = ?',
|
|
|
|
push: 'INSERT INTO lost_thing (user_id,thing_title,thing_introduce,thing_img,thing_type,thing_category) VALUES (?,?,?,?,?,?)',
|
|
|
|
getNotice: 'SELECT * from lost_notice',
|
|
|
|
addUser: 'INSERT INTO `lost_user` (user_name, user_phone, user_pwd, user_portrait) VALUES (?, ?, ?, ?)',
|
|
|
|
userLogin: 'SELECT * from lost_user where user_phone = ? and user_pwd = ?'
|
|
}
|
|
};
|