hongze 6 月之前
父節點
當前提交
38e55fa186
共有 2 個文件被更改,包括 8 次插入3 次删除
  1. 6 3
      models/data_manage/supply_analysis/variety.go
  2. 2 0
      models/report_approve/report_approve.go

+ 6 - 3
models/data_manage/supply_analysis/variety.go

@@ -126,7 +126,7 @@ type VarietyItem struct {
 	PermissionUserId          string        `description:"有操作权限的用户id"`
 	ModifyTime                string        `description:"修改时间"`
 	CreateTime                string        `description:"创建时间"`
-	Button                    VarietyButton `description:"操作按钮权限"`
+	Button                    VarietyButton `gorm:"-" description:"操作按钮权限"`
 }
 
 type VarietyButton struct {
@@ -137,13 +137,16 @@ type VarietyButton struct {
 
 // GetListBySuperAdminPage 不区分是否有分析权限的获取分页数据
 func (item Variety) GetListBySuperAdminPage(condition string, pars []interface{}, startSize, pageSize int) (total int, items []*VarietyItem, err error) {
-	baseSql := ` FROM ( SELECT a.*, GROUP_CONCAT(DISTINCT b.sys_user_id ORDER BY b.sys_user_id ASC SEPARATOR ',') AS permission_user_id FROM variety a 
+	baseSql := ` FROM ( SELECT a.variety_id,a.variety_name,a.last_update_sys_user_id,
+a.last_update_sys_user_real_name,a.production_day,a.sys_user_id,a.sys_user_real_name,a.modify_time,a.create_time,LISTAGG(b.sys_user_id, ',') WITHIN GROUP (ORDER BY b.sys_user_id ASC) AS permission_user_id 
+				FROM variety a 
 				LEFT JOIN variety_admin_permission b on a.variety_id=b.variety_id 
 				LEFT JOIN variety_edb_info c on a.variety_id=c.variety_id WHERE 1=1 `
 	if condition != "" {
 		baseSql += condition
 	}
-	baseSql += ` GROUP BY a.variety_id ) d `
+	baseSql += ` GROUP BY a.variety_id,a.variety_name,a.last_update_sys_user_id,
+a.last_update_sys_user_real_name,a.production_day,a.sys_user_id,a.sys_user_real_name,a.modify_time,a.create_time ) d `
 	// 数据总数
 	totalSql := `SELECT COUNT(1) total ` + baseSql
 

+ 2 - 0
models/report_approve/report_approve.go

@@ -391,6 +391,8 @@ func GetApplyReportApprovePageList(cond string, pars []interface{}, orderRule st
 	}
 	sql := fmt.Sprintf(`SELECT a.* FROM report_approve AS a WHERE 1 = 1 %s %s LIMIT ?,?`, cond, order)
 	//_, err = o.Raw(sql, pars...).QueryRows(&items)
+	pars = append(pars, startSize)
+	pars = append(pars, pageSize)
 	err = global.DmSQL["rddp"].Raw(sql, pars...).Find(&items).Error
 	return
 }