rax-medical/node-server/core/AIFlagTable.js

32 lines
1.0 KiB
JavaScript
Raw Permalink Normal View History

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
};