Pchen. 1 month ago
parent
commit
c7dfabfdeb
1 changed files with 2 additions and 2 deletions
  1. 2 2
      apis/Lepao/Account/AddAccount.js

+ 2 - 2
apis/Lepao/Account/AddAccount.js

@@ -116,13 +116,13 @@ class AddAccount extends API {
         if (!id) {
             if (countRows.length !== 0) {
                 sql = 'UPDATE lepao_account SET create_user = ?, email = ?, area = ?, auto_time = ?, auto_run = ?, target_count = ?, create_time = ?, update_time = ?, notes = ?, auto_day = ?, notice_type = ? WHERE id = ?'
-                r = await db.query(sql, [uuid, email, area, auto_time, auto_run, target_count, time, time, notes ?? '', JSON.stringify(auto_day), notice_type, countRows[0].id])
+                r = await db.query(sql, [uuid, email ?? '', area, auto_time, auto_run, target_count, time, time, notes ?? '', JSON.stringify(auto_day), notice_type, countRows[0].id])
             }
             else {
                 const bind_code = await this.generateCode()
 
                 sql = 'INSERT INTO lepao_account (student_num, email, area, auto_time, auto_run, target_count, create_user, create_time, notes, auto_day, notice_type) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'
-                r = await db.query(sql, [student_num, email, area, auto_time, auto_run, target_count, uuid, time, notes ?? '', JSON.stringify(auto_day), notice_type])
+                r = await db.query(sql, [student_num, email ?? '', area, auto_time, auto_run, target_count, uuid, time, notes ?? '', JSON.stringify(auto_day), notice_type])
 
                 let faceSql = 'INSERT INTO lepao_extra (student_num, bind_code) VALUES (?, ?)'
                 let faceRows = await db.query(faceSql, [student_num, bind_code])