|
@@ -392,6 +392,18 @@ func CreateTx(tableName string, needCreateUserID bool, callbacks *CreateCallback
|
|
|
return callbackOnCreateErrorReturn(callbacks, c, params, e, make(map[string]any), err, i)
|
|
|
}
|
|
|
|
|
|
+ if domain.HasField(e, entity.FieldCreateUserID) && domain.HasField(e, entity.FieldLastUpdateUserID) {
|
|
|
+ createUserID, err := domain.Field[string](e, entity.FieldCreateUserID)
|
|
|
+ if err != nil {
|
|
|
+ return callbackOnCreateErrorReturn(callbacks, c, params, e, make(map[string]any), err, i)
|
|
|
+ }
|
|
|
+
|
|
|
+ err = domain.SetField(e, entity.FieldLastUpdateUserID, createUserID)
|
|
|
+ if err != nil {
|
|
|
+ return callbackOnCreateErrorReturn(callbacks, c, params, e, make(map[string]any), err, i)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
err = database.Transaction(dbExecutor, func(tx database.Executor) error {
|
|
|
err = callbackBeforeCreate(callbacks, c, params, e, prepared, i, tx)
|
|
|
if err != nil {
|