Commit 34c374bc authored by brent's avatar brent

modify

parent 72a10b61
No preview for this file type
......@@ -1547,6 +1547,8 @@ func (server *TaskController) AddTasktype() {
Count: int64(0),
Kind: dbType.Kind,
FileExpiresTime: strconv.Itoa(dbType.ResultFileExpires),
AccessStatus: dbType.AccessStatus,
PublishStatus: dbType.PublishStatus,
}
response = append(response, retask)
data, err := json.Marshal(response)
......@@ -1749,6 +1751,8 @@ func (server *TaskController) UpdateTaskType() {
task.Kind = dbType.Kind
task.FileExpiresTime = strconv.Itoa(dbType.ResultFileExpires)
task.OutPutJson = output
task.AccessStatus = dbType.AccessStatus
task.PublishStatus = dbType.PublishStatus
}
}
data, err := json.Marshal(response)
......@@ -2147,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 publish_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 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 {
......
......@@ -119,12 +119,13 @@ func startDebit() {
ctx := context.TODO()
addrOpt := qdb.WithAddress(questAddr)
sender, err := qdb.NewLineSender(ctx, addrOpt)
if err != nil {
logs.Debug("startDebit NewLineSender = %s", err.Error())
return
}
// Make sure to close the sender on exit to release resources.
defer sender.Close()
// Make sure to close the sender on exit to release resources.
currentTime := time.Now()
temp := fmt.Sprintf("-%dh", 2)
......@@ -137,7 +138,7 @@ func startDebit() {
logs.Debug("startDebit before sql = %s", dayTime)
sql := fmt.Sprintf("SELECT time, uid,sum(fee) AS amount FROM bills WHERE time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR GROUP BY uid,time;", start, end)
sql := fmt.Sprintf("SELECT time, uid,sum(fee) AS amount FROM bills WHERE uid != '0' and time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR GROUP BY uid,time;", start, end)
data, err := postgres.CountFunds(sql)
if err != nil {
logs.Debug("startDebit postgres CountFunds = %s", err.Error())
......
......@@ -150,6 +150,7 @@ type Model struct {
Category int `json:"category";orm:"column(category)"`
ResultFileExpires int `json:"result_file_expires";orm:"column(result_file_expires)"`
AccessStatus int `json:"access_status,omitempty"`
PublishStatus int `json:"publish_status,omitempty"`
}
type ResonseModel struct {
......@@ -170,6 +171,7 @@ type ResonseModel struct {
Form interface{} `json:"form";orm:"column(form)"`
ResultFileExpires int `json:"result_file_expires";orm:"column(result_file_expires)"`
AccessStatus int `json:"access_status,omitempty"`
PublishStatus int `json:"publish_status,omitempty"`
}
type Bills struct {
......@@ -231,6 +233,8 @@ type TaskHeat struct {
Kind int `json:"kind";orm:"column(kind)"`
FileExpiresTime string `json:"file_expires_time";orm:"column(file_expires_time)"`
OutPutJson interface{} `json:"out_put_json";orm:"column(out_put_json)"`
AccessStatus int `json:"access_status,omitempty"`
PublishStatus int `json:"publish_status,omitempty"`
}
type AddTaskType struct {
......
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