|
@@ -12,7 +12,7 @@ class AddAccount extends API {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async onRequest(req, res) {
|
|
async onRequest(req, res) {
|
|
|
- let { uuid, session, student_num, email, id, area, max_distance, min_distance, auto_time, notes } = req.body
|
|
|
|
|
|
|
+ let { uuid, session, student_num, email, id, area, max_distance, min_distance, auto_time, auto_run, notes } = req.body
|
|
|
|
|
|
|
|
if ([uuid, session, student_num, email, auto_time].some(value => value === '' || value === null || value === undefined))
|
|
if ([uuid, session, student_num, email, auto_time].some(value => value === '' || value === null || value === undefined))
|
|
|
return res.json({
|
|
return res.json({
|
|
@@ -76,11 +76,11 @@ class AddAccount extends API {
|
|
|
let sql, r
|
|
let sql, r
|
|
|
|
|
|
|
|
if (!id) {
|
|
if (!id) {
|
|
|
- sql = 'INSERT INTO lepao_account (student_num, email, area, auto_time, create_user, create_time, notes) VALUES (?, ?, ?, ?, ?, ?, ?)'
|
|
|
|
|
- r = await db.query(sql, [student_num, email, area, auto_time, uuid, time, notes ?? ''])
|
|
|
|
|
|
|
+ sql = 'INSERT INTO lepao_account (student_num, email, area, auto_time, auto_run, create_user, create_time, notes) VALUES (?, ?, ?, ?, ?, ?, ?, ?)'
|
|
|
|
|
+ r = await db.query(sql, [student_num, email, area, auto_time, auto_run, uuid, time, notes ?? ''])
|
|
|
} else {
|
|
} else {
|
|
|
- sql = 'UPDATE lepao_account SET student_num = ?, email = ?, area = ?, auto_time = ?, update_time = ?, notes = ? WHERE id = ?'
|
|
|
|
|
- r = await db.query(sql, [student_num, email, area, auto_time, time, notes ?? '', id])
|
|
|
|
|
|
|
+ sql = 'UPDATE lepao_account SET student_num = ?, email = ?, area = ?, auto_time = ?, auto_run = ?, update_time = ?, notes = ? WHERE id = ?'
|
|
|
|
|
+ r = await db.query(sql, [student_num, email, area, auto_time, auto_run, time, notes ?? '', id])
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
try {
|