mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-24 13:04:57 +08:00
32 lines
1.0 KiB
JavaScript
32 lines
1.0 KiB
JavaScript
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
|
||
};
|