33 lines
1.9 KiB
JavaScript
33 lines
1.9 KiB
JavaScript
|
|
module.exports = {
|
|
MysqlConfig: {
|
|
host : 'localhost',
|
|
user : 'root',
|
|
password : 'lb714500',
|
|
database : 'shop'
|
|
},
|
|
SqlConfig: {
|
|
index: {
|
|
QueryIndex: 'SELECT * from shop_commodity',
|
|
QueryIndexInfo: `SELECT * from shop_commodity where id = ?`,
|
|
QueryClassShop: `SELECT * from shop_commodity where commodity_brand = ?`,
|
|
SearchShop: `SELECT * from shop_commodity WHERE commodity_name or commodity_brand LIKE "%?%"`
|
|
},
|
|
user: {
|
|
Querylogin: 'SELECT id, user_money,user_name,user_nicname,user_truename from shop_user where user_name = ? and user_pwd = ?',
|
|
InsertUser: 'INSERT INTO shop_user (user_name, user_pwd, user_nicname) VALUES (?, ?, ?)'
|
|
},
|
|
cart: {
|
|
InsertCart: 'INSERT INTO shop_cart (user_id, commodity_id, cart_nums) VALUES (?, ?, ?)',
|
|
QueryCart: 'SELECT * from shop_cart where user_id = ? and commodity_id = ?',
|
|
SelectCart: 'SELECT shop_cart.cart_nums, shop_cart.id AS cid, shop_commodity.* FROM shop_cart ,shop_commodity WHERE shop_cart.commodity_id = shop_commodity.id AND shop_cart.user_id = ?',
|
|
deleteCart: 'DELETE FROM shop_cart WHERE id = ?'
|
|
},
|
|
order: {
|
|
addOrder: 'INSERT INTO shop_order (user_id, commodity_id, order_number,order_status,order_total,order_size) VALUES (?, ?, ?, ?, ?, ?)',
|
|
SelectOrder: 'SELECT shop_order.id AS oid,shop_order.order_number,shop_order.order_total,shop_order.order_size,shop_order.order_status, shop_commodity.* FROM shop_order ,shop_commodity WHERE shop_order.commodity_id = shop_commodity.id AND shop_order.user_id = ? and order_status = ?',
|
|
SelectAllOrder: 'SELECT shop_order.id AS oid,shop_order.order_number,shop_order.order_total,shop_order.order_size,shop_order.order_status, shop_commodity.* FROM shop_order ,shop_commodity WHERE shop_order.commodity_id = shop_commodity.id AND shop_order.user_id = ?',
|
|
updateOrder: 'UPDATE shop_order set order_status= ? WHERE user_id = ? and id = ?'
|
|
}
|
|
}
|
|
} |