u
This commit is contained in:
1 parent
e893ef2e48
commit
b6415c0d65
25 files changed
+1495
-112
No files matched your search
@@ -1,10 +1,12 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"allapp-go/internal/middleware"
|
||||
"context"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func (c *Client) Update(
|
||||
@@ -18,6 +20,21 @@ func (c *Client) Update(
|
||||
return err
|
||||
}
|
||||
|
||||
if !auditExcludeTables[table] {
|
||||
now := time.Now()
|
||||
|
||||
delete(data, "update_time")
|
||||
delete(data, "update_by")
|
||||
|
||||
data["update_time"] = now
|
||||
|
||||
userID, flag := middleware.GetUserID(ctx)
|
||||
|
||||
if flag {
|
||||
data["update_by"] = userID
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
setClauses []string
|
||||
args []any
|
||||
|
||||
Reference in new issue
Block a user