Browse Source

update:内部管理员可以创建经销商任务

zoie 4 weeks ago
parent
commit
7d341d62b4
2 changed files with 10 additions and 4 deletions
  1. 9 1
      controllers/Task.go
  2. 1 3
      models/Account/Admin.go

+ 9 - 1
controllers/Task.go

@@ -666,8 +666,16 @@ func (c *TaskController) Add() {
 		c.ServeJSON()
 		return
 	}
+
+	// 查询信息采集信息
+	user, is := Account.Read_User(T_uuid)
+	if !is {
+		c.Data["json"] = lib.JSONS{Code: 202, Msg: "T_uuid 错误!"}
+		c.ServeJSON()
+		return
+	}
 	var_ := Task.Task{
-		T_Distributor_id:       User_r.T_Distributor_id,
+		T_Distributor_id:       user.T_Distributor_id,
 		T_InfoCollection_id:    T_InfoCollection_id,
 		T_InfoTemplate_id:      infoCollection.T_InfoTemplate_id,
 		T_start_time:           infoCollection.T_start_time, // 项目开始时间使用信息采集开始时间

+ 1 - 3
models/Account/Admin.go

@@ -186,9 +186,7 @@ func Read_Admin_List_ALL_Power(T_Distributor_id string, T_name string, PowerMaps
 	o := orm.NewOrm()
 	var r []Admin
 	qs := o.QueryTable(new(Admin))
-	if len(T_Distributor_id) == 0 {
-		qs = qs.Filter("T_Distributor_id", "")
-	} else {
+	if len(T_Distributor_id) > 0 {
 		qs = qs.Filter("T_Distributor_id", T_Distributor_id)
 	}
 	if len(T_name) > 0 {