Commit cd473165 authored by brent's avatar brent

modify

parent 4f776f11
......@@ -2135,7 +2135,7 @@ func (server *TaskController) Examples() {
var types []*models.Model
sql := fmt.Sprintf("SELECT count(*) FROM task_type WHERE deleted = 0 and publish_status = 1 %s;", where)
sql := fmt.Sprintf("SELECT count(*) FROM task_type WHERE deleted = 0 and access_status = 1 %s;", where)
var total int64
mysql.GetMysqlInstace().Ormer.Raw(sql).QueryRow(&total)
logs.Debug("total = %d", total)
......@@ -2151,7 +2151,7 @@ func (server *TaskController) Examples() {
return
}
sql = fmt.Sprintf("SELECT id, `name` AS tit,type,`desc` AS content, tags ,examples,codes,base_model,model,api_path,version,category,form,access_status FROM task_type WHERE deleted = 0 and access_status = 1 %s LIMIT %d,%d;", where, offset, size)
sql = fmt.Sprintf("SELECT id, `name` AS tit,type,`desc` AS content, tags ,examples,codes,base_model,model,api_path,version,category,form,access_status,publish_status FROM task_type WHERE deleted = 0 and access_status = 1 %s LIMIT %d,%d;", where, offset, size)
mysql.GetMysqlInstace().Ormer.Raw(sql).QueryRows(&types)
var remodels []*models.ResonseModel
for _, data := range types {
......@@ -2195,6 +2195,8 @@ func (server *TaskController) Examples() {
Category: data.Category,
Form: form,
ResultFileExpires: data.ResultFileExpires,
AccessStatus: data.AccessStatus,
PublishStatus: data.PublishStatus,
}
remodels = append(remodels, &remodel)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment