|
@@ -129,7 +129,7 @@ func (c *Client) CuserRuleCreate() {
|
|
|
data["entUserId"] = entUserId
|
|
|
}
|
|
|
data["entId"] = qu.IntAll(user["ent_id"])
|
|
|
- data["appid"] = qu.ObjToString(user["app_id"])
|
|
|
+ data["appid"] = qu.ObjToString(user["appid"])
|
|
|
data["i_createtime"] = i_createtime
|
|
|
data["s_createuser"] = user["name"]
|
|
|
s_namekey := gopinyin.Convert(qu.ObjToString(data["s_name"]), false)
|
|
@@ -148,7 +148,7 @@ func (c *Client) CuserRuleCreate() {
|
|
|
} else {
|
|
|
data["entUserId"] = entUserId
|
|
|
}
|
|
|
- data["appid"] = qu.ObjToString(user["app_id"])
|
|
|
+ data["appid"] = qu.ObjToString(user["appid"])
|
|
|
data["entId"] = qu.IntAll(user["ent_id"])
|
|
|
query := bson.M{
|
|
|
"_id": mongoutil.StringTOBsonId(id),
|
|
@@ -210,11 +210,42 @@ func (this *Client) DataPreview() {
|
|
|
}
|
|
|
|
|
|
func (this *Client) ExportLog() {
|
|
|
- id, _ := this.GetInteger("id")
|
|
|
- sql := fmt.Sprintf("select user_name,export_time,filter,export_num,deduct_num,user_id,download_url from entniche_export_log where user_id = %d", id)
|
|
|
- exportLog := JyMysql.SelectBySql(sql)
|
|
|
- if exportLog != nil && *exportLog != nil && len(*exportLog) > 0 {
|
|
|
- this.T["exportLog"] = *exportLog
|
|
|
+ if this.Method() == "POST" {
|
|
|
+ id, _ := this.GetInteger("id")
|
|
|
+ start, _ := this.GetInteger("start")
|
|
|
+ limit, _ := this.GetInteger("length")
|
|
|
+ draw, _ := this.GetInteger("draw")
|
|
|
+ sqls := fmt.Sprintf("select count(1) from user_expend_record where user_id = %d", id)
|
|
|
+ count := JyMysql.CountBySql(sqls)
|
|
|
+ if count > 0 {
|
|
|
+ sql := fmt.Sprintf("select * from user_expend_record where user_id = %d order by id desc limit %d,%d", id, start, limit)
|
|
|
+ exportLog := JyMysql.SelectBySql(sql)
|
|
|
+ for _, v := range *exportLog {
|
|
|
+ data := JyMysql.FindOne("entniche_export_log", map[string]interface{}{"id": v["export_id"]}, "user_name,export_num,deduct_num,download_url", "")
|
|
|
+ if data != nil && *data != nil {
|
|
|
+ v["export_num"] = (*data)["export_num"]
|
|
|
+ v["deduct_num"] = (*data)["deduct_num"]
|
|
|
+ v["download_url"] = (*data)["download_url"]
|
|
|
+ v["user_name"] = (*data)["user_name"]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.ServeJson(map[string]interface{}{
|
|
|
+ "draw": draw,
|
|
|
+ "data": *exportLog,
|
|
|
+ "recordsFiltered": count,
|
|
|
+ "recordsTotal": count,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.ServeJson(map[string]interface{}{
|
|
|
+ "draw": draw,
|
|
|
+ "data": nil,
|
|
|
+ "recordsFiltered": 0,
|
|
|
+ "recordsTotal": 0,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ id, _ := this.GetInteger("id")
|
|
|
+ this.T["id"] = id
|
|
|
+ this.Render("client/exportLog.html", &this.T)
|
|
|
}
|
|
|
- this.Render("client/exportLog.html", &this.T)
|
|
|
}
|