Commit 7712c104 by 朱继来

重置剩余领取用户字段

parent 2b22949e
package main
/**
每天零点重置剩余领取用户字段 follow_user_count
*/
import (
"crm-server/internal/dao"
"flag"
"fmt"
"github.com/ichunt2019/logger"
)
// 日志目录
var LogDir string
// 解析命令行参数
func initArgs() {
flag.StringVar(&LogDir, "logDir", "", "日志目录")
flag.Parse()
}
func main() {
initArgs()
logConfig := make(map[string]string)
logConfig["log_path"] = LogDir+"/task/update_follow_count"
logConfig["log_chan_size"] = "100"
logger.InitLogger("file",logConfig)
logger.Init()
db := dao.GetNewDb()
_, err := db.Exec("update lie_employee_card set follow_user_count = follow_user_limit")
defer db.Close()
if err != nil {
fmt.Println("设置失败:" + err.Error())
logger.Info("重置剩余领取用户字段失败: ", err.Error())
return
}
fmt.Println("设置成功")
}
\ No newline at end of file
...@@ -8,7 +8,6 @@ type InvoiceComUser struct { ...@@ -8,7 +8,6 @@ type InvoiceComUser struct {
Status int `json:"status" db:"status"` Status int `json:"status" db:"status"`
Department_Id int `json:"department_id" db:"department_id"` Department_Id int `json:"department_id" db:"department_id"`
Sale_Type int `json:"sale_type" db:"sale_type"` Sale_Type int `json:"sale_type" db:"sale_type"`
Follow_Type int `json:"follow_type" db:"follow_type"`
Create_Time int `json:"create_time" db:"create_time"` Create_Time int `json:"create_time" db:"create_time"`
Update_Time int `json:"update_time" db:"update_time"` Update_Time int `json:"update_time" db:"update_time"`
} }
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 sign in to comment