master
huanghai 5 years ago
parent bf0932e783
commit a5e4be9bc6

@ -15,7 +15,7 @@ var db = DbUtil.Engine
//增加 //增加
func AddBasePosition(model models.TBasePosition) (int64, error) { func AddBasePosition(model models.TBasePosition) (int64, error) {
if model.SortId == 0 { if model.SortId == 0 {
sql := `select max(sort_id) as maxSortId from t_base_position where parent_id=?` sql := `select ifnull(max(sort_id),0) as maxSortId from t_base_position where parent_id=?`
list, err := db.SQL(sql, model.ParentId).Query().List() list, err := db.SQL(sql, model.ParentId).Query().List()
if err != nil { if err != nil {
return -1, err return -1, err

Loading…
Cancel
Save