rax-medical/node-server/core/AIFlagTable.js
2023-11-16 14:20:47 +08:00

32 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import common from "./common.js";
const app = common.app;
const connection = common.connection;
const m_get = common.m_get;
const m_add = common.m_add;
const nowTime = common.nowTime;
const getTable = () => app.post('/getaiflag', function (req, res) {
const database = req.body.database;
const table = `AIFlagTable`;
const order = `ID`;
const Clause = false;
const start = ~~req.body.start;
const end = ~~req.body.end;
common.mysqlQuery(res, database, m_get(table, Clause, order, start, end));
});
const addTable = () => app.post('/addaiflag', (req, res) => {
const database = req.body.database;
const table = `AIFlagTable`;
const key = 'Flag';
// `name, region, area, house_type, phone, create_time, remark`;
const values = Number(req.body.flag) ? 1 : 0; // ai给药 人工给药
// `'${v.name}', '${v.region}', '${v.area}', '${v.house_type}', '${v.phone}', '${nowTime()}', '${remark}'`;
common.mysqlQuery(res, database, m_add(table, key, values));
})
export default {
getTable,
addTable
};