@@ -8,3 +8,6 @@ import ( | |||||
func Index(c *gin.Context) { | func Index(c *gin.Context) { | ||||
svc.Index(c) | svc.Index(c) | ||||
} | } | ||||
func UserInfo(c *gin.Context) { | |||||
svc.UserInfo(c) | |||||
} |
@@ -0,0 +1,481 @@ | |||||
package hdl | |||||
import ( | |||||
"applet/app/comm/db" | |||||
"applet/app/comm/e" | |||||
"applet/app/comm/svc" | |||||
"applet/app/comm/utils" | |||||
md2 "applet/app/operator/md" | |||||
"applet/app/store/md" | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/implement" | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | |||||
"fmt" | |||||
"github.com/gin-gonic/gin" | |||||
"time" | |||||
) | |||||
func CenterBase(c *gin.Context) { | |||||
user := svc.GetUser(c) | |||||
allTaskCount, _ := svc.MasterDb(c).Where("uid=?", user.Info.Uid).Count(&models.CampTaskOperatorTask{}) | |||||
sql := `SELECT SUM(ctupor.amount) as amount,SUM(IF(ctupor.uid=%d,ctupo.payment,0)) as own_payment,SUM(IF(ctupor.uid=%d,1,0)) as own_count,SUM(IF(ctupor.uid=%d,ctupor.amount,0)) as own_amount,ctupor.level FROM camp_task_user_promotion_order_relate ctupor | |||||
LEFT JOIN camp_task_user_promotion_order ctupo on ctupo.oid=ctupor.oid | |||||
WHERE ctupor.oid in(select oid from camp_task_user_promotion_order_relate where uid=%d ) GROUP BY ctupor.level` | |||||
sql = fmt.Sprintf(sql, user.Info.Uid, user.Info.Uid, user.Info.Uid, user.Info.Uid) | |||||
nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql) | |||||
var firstAmount float64 = 0 | |||||
var secondAmount float64 = 0 | |||||
var ownAmount float64 = 0 | |||||
var count = 0 | |||||
var sum float64 = 0 | |||||
for _, v := range nativeString { | |||||
if v["level"] == "0" { | |||||
firstAmount += utils.StrToFloat64(v["amount"]) | |||||
} | |||||
if v["level"] == "1" { | |||||
secondAmount += utils.StrToFloat64(v["amount"]) | |||||
} | |||||
ownAmount += utils.StrToFloat64(v["own_amount"]) | |||||
sum += utils.StrToFloat64(v["own_payment"]) | |||||
count += utils.StrToInt(v["own_count"]) | |||||
} | |||||
firstLv := "0" | |||||
secondLv := "0" | |||||
thirdLv := "0" | |||||
sql1 := `SELECT COUNT(*) as count,u.level FROM user_relate ur | |||||
LEFT JOIN user u on u.uid=ur.uid | |||||
WHERE ur.parent_uid=%d GROUP BY u.level` | |||||
sql1 = fmt.Sprintf(sql1, user.Info.Uid) | |||||
nativeString1, _ := db.QueryNativeString(svc.MasterDb(c), sql) | |||||
for _, v := range nativeString1 { | |||||
if v["level"] == "0" { | |||||
firstLv = v["count"] | |||||
} | |||||
if v["level"] == "1" { | |||||
secondLv = v["count"] | |||||
} | |||||
if v["level"] == "2" { | |||||
thirdLv = v["count"] | |||||
} | |||||
} | |||||
totalList := []map[string]string{ | |||||
{"name": "名下团长", "value": secondLv, "unit": "人", "type": "", "is_light": "0"}, | |||||
{"name": "名下普通用户", "value": firstLv, "unit": "人", "type": "", "is_light": "0"}, | |||||
{"name": "佣金总金额", "value": utils.Float64ToStr(sum), "unit": "¥", "type": "", "is_light": "1"}, | |||||
{"name": "推广总订单数", "value": utils.IntToStr(count), "unit": "", "type": "", "is_light": "0"}, | |||||
{"name": "我的分成", "value": utils.Float64ToStr(ownAmount), "unit": "¥", "type": "", "is_light": "1"}, | |||||
} | |||||
if user.Info.Level == 3 { | |||||
totalList = []map[string]string{ | |||||
{"name": "名下运营商", "value": thirdLv, "unit": "人", "type": "operator_detail", "is_light": "0"}, | |||||
{"name": "佣金总金额", "value": utils.Float64ToStr(sum), "unit": "¥", "type": "", "is_light": "1"}, | |||||
{"name": "推广总订单数", "value": utils.IntToStr(count), "unit": "", "type": "", "is_light": "0"}, | |||||
{"name": "我的分成", "value": utils.Float64ToStr(ownAmount), "unit": "¥", "type": "", "is_light": "1"}, | |||||
{"name": "项目数据", "value": "", "unit": "", "type": "project_detail", "is_light": "0"}, | |||||
} | |||||
} | |||||
myTask := make([]map[string]string, 0) | |||||
NewCampTaskOperatorTaskDb := implement.NewCampTaskOperatorTaskDb(svc.MasterDb(c)) | |||||
myTaskList, _, _ := NewCampTaskOperatorTaskDb.FindCampTaskOperatorTaskGroup(user.Info.Uid, 1, 5, "") | |||||
if myTaskList != nil { | |||||
for _, v := range myTaskList { | |||||
tmp := map[string]string{ | |||||
"id": utils.IntToStr(v.CampTaskOperatorTask.TaskId), | |||||
"name": v.Name, | |||||
"icon": svc.ImageFormat(c, v.Logo), | |||||
} | |||||
myTask = append(myTask, tmp) | |||||
} | |||||
} | |||||
res := map[string]interface{}{ | |||||
"total_list": totalList, | |||||
"my_task_count": utils.Int64ToStr(allTaskCount), | |||||
"my_task": myTask, | |||||
} | |||||
e.OutSuc(c, res, nil) | |||||
return | |||||
} | |||||
func CenterList(c *gin.Context) { | |||||
var args md2.OperatorTaskReq | |||||
if err := c.ShouldBindJSON(&args); err != nil { | |||||
e.OutErr(c, e.ERR_INVALID_ARGS) | |||||
return | |||||
} | |||||
user := svc.GetUser(c) | |||||
where := "" | |||||
if args.SettleStateType != "" { | |||||
where += " and ctupo.settle_state=" + args.SettleStateType | |||||
} | |||||
if args.Cid != "" { | |||||
where += " and ctl.first_cid=" + args.Cid | |||||
} | |||||
if args.TaskId != "" { | |||||
where += " and ctupo.task_id=" + args.TaskId | |||||
} | |||||
if args.ApplyType != "" { | |||||
where += " and ctupo.state=" + args.ApplyType | |||||
} | |||||
if args.StartTime != "" { | |||||
where += " and ctupo.create_time>='" + args.StartTime + "'" | |||||
} | |||||
if args.EndTime != "" { | |||||
where += " and ctupo.create_time<>>='" + args.EndTime + "'" | |||||
} | |||||
sqlCount := `select count(*) as count from FROM camp_task_user_promotion_order_relate ctupor | |||||
LEFT JOIN camp_task_user_promotion_order ctupo on ctupo.oid=ctupor.oid | |||||
LEFT JOIN camp_task_list ctl on ctupo.task_id=ctl.id | |||||
WHERE ctupor.uid=%d %s` | |||||
sqlCount = fmt.Sprintf(sqlCount, user.Info.Uid, where) | |||||
nativeStringCount, _ := db.QueryNativeString(svc.MasterDb(c), sqlCount) | |||||
var total = 0 | |||||
hotTask := make([]map[string]string, 0) | |||||
for _, v := range nativeStringCount { | |||||
total = utils.StrToInt(v["count"]) | |||||
} | |||||
sql := `select ctl.name as task_name,ul.level_name,ctc.name as cate_name,ctupo.payment,ctupor.oid,ctupo.name as user_name,ctupo.phone as user_phone, | |||||
ctupo.state,ctupo.settle_state,ctupo.create_time,ctupor.amount | |||||
from FROM camp_task_user_promotion_order_relate ctupor | |||||
LEFT JOIN camp_task_user_promotion_order ctupo on ctupo.oid=ctupor.oid | |||||
LEFT JOIN camp_task_list ctl on ctupo.task_id=ctl.id | |||||
LEFT JOIN user_level ul on ctupo.user_lv=ul.id | |||||
LEFT JOIN camp_task_cate ctc on ctl.first_cid=ctc.id | |||||
WHERE ctupor.uid=%d %s order by ctupo.id desc %s` | |||||
sql = fmt.Sprintf(sql, user.Info.Uid, where, "limit "+utils.IntToStr((utils.StrToInt(args.P)-1)*utils.StrToInt(args.Size))+","+args.Size) | |||||
nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql) | |||||
stateType := []string{"审核中", "审核通过", "审核拒绝"} | |||||
settleStateType := []string{"未结算", "结算成功", "结算失败"} | |||||
for _, v := range nativeString { | |||||
tmp := map[string]string{ | |||||
"task_name": v["task_name"], | |||||
"level_name": v["level_name"], | |||||
"cate_name": v["cate_name"], | |||||
"oid": v["oid"], | |||||
"user_name": v["user_name"], | |||||
"user_phone": v["user_phone"], | |||||
"state": v["state"], | |||||
"state_str": stateType[utils.StrToInt(v["state"])], | |||||
"settle_state_str": settleStateType[utils.StrToInt(v["settle_state"])], | |||||
"settle_state": v["settle_state"], | |||||
"create_time": v["create_time"], | |||||
"amount": v["amount"], | |||||
} | |||||
hotTask = append(hotTask, tmp) | |||||
} | |||||
task := make([]map[string]string, 0) | |||||
taskList := make([]models.CampTaskList, 0) | |||||
svc.MasterDb(c).Where("state=?", 1).OrderBy("sort desc,id desc").Find(&taskList) | |||||
for _, v := range taskList { | |||||
tmp := map[string]string{ | |||||
"name": v.Name, "value": utils.IntToStr(v.Id), | |||||
} | |||||
task = append(task, tmp) | |||||
} | |||||
taskCate := make([]map[string]string, 0) | |||||
taskCateList := make([]models.CampTaskCate, 0) | |||||
svc.MasterDb(c).Where(" is_show=?", 1).OrderBy("sort desc,id desc").Find(&taskCateList) | |||||
for _, v := range taskCateList { | |||||
if v.Pid > 0 { | |||||
continue | |||||
} | |||||
tmp := map[string]string{ | |||||
"name": v.Name, "value": utils.IntToStr(v.Id), | |||||
} | |||||
taskCate = append(taskCate, tmp) | |||||
} | |||||
res := map[string]interface{}{ | |||||
"cate_list": taskCate, | |||||
"task_cate_list": task, | |||||
"settle_state_type": []map[string]string{ | |||||
{"name": "未结算", "value": "0"}, | |||||
{"name": "已结算", "value": "1"}, | |||||
{"name": "结算拒绝", "value": "2"}, | |||||
}, | |||||
"state_type": []map[string]string{ | |||||
{"name": "未审核", "value": "0"}, | |||||
{"name": "审核成功", "value": "1"}, | |||||
{"name": "审核拒绝", "value": "2"}, | |||||
}, | |||||
"total": total, "list": hotTask, | |||||
} | |||||
e.OutSuc(c, res, nil) | |||||
return | |||||
} | |||||
func CenterOperatorList(c *gin.Context) { | |||||
var args md2.OperatorTaskReq | |||||
if err := c.ShouldBindJSON(&args); err != nil { | |||||
e.OutErr(c, e.ERR_INVALID_ARGS) | |||||
return | |||||
} | |||||
user := svc.GetUser(c) | |||||
total := 0 | |||||
hotTask := make([]map[string]string, 0) | |||||
sql := `SELECT u.nickname,u.uid,u.level_expire_at,u.level_arrive_at | |||||
(select count(*) as count from user_relate ur1 | |||||
LEFT JOIN user u1 on u1.uid=ur1.uid where ur1.parent_uid=ur.uid and u1.level=0 ) as firstLv, | |||||
(select count(*) as count from user_relate ur1 | |||||
LEFT JOIN user u1 on u1.uid=ur1.uid where ur1.parent_uid=ur.uid and u1.level=1 ) as secondLv | |||||
FROM user_relate ur | |||||
LEFT JOIN user u on u.uid=ur.uid | |||||
WHERE ur.parent_uid=%d and u.level=2 order by u.uid desc %s` | |||||
sql = fmt.Sprintf(sql, user.Info.Uid, "limit "+utils.IntToStr((utils.StrToInt(args.P)-1)*utils.StrToInt(args.Size))+","+args.Size) | |||||
nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql) | |||||
for _, v := range nativeString { | |||||
timer := "0天" | |||||
leave := utils.TimeStdParseUnix(v["level_expire_at"]) - time.Now().Unix() | |||||
if leave > 0 { | |||||
timer = utils.Int64ToStr(leave/86400) + "天" | |||||
} | |||||
if v["level_expire_at"] == v["level_arrive_at"] { | |||||
timer = "永久" | |||||
} | |||||
commission, _ := svc.MasterDb(c).Where("uid=?", v["uid"]).Sum(&models.CampTaskUserPromotionOrderRelate{}, "amount") | |||||
orderCount, _ := svc.MasterDb(c).Where("uid=?", v["uid"]).Count(&models.CampTaskUserPromotionOrderRelate{}) | |||||
tmp := map[string]string{ | |||||
"uid": v["uid"], | |||||
"nickname": v["nickname"], | |||||
"timer": timer, | |||||
"first_lv_count": v["firstLv"], | |||||
"second_lv_count": v["secondLv"], | |||||
"order_count": utils.Int64ToStr(orderCount), | |||||
"commission": utils.Float64ToStr(commission), | |||||
} | |||||
hotTask = append(hotTask, tmp) | |||||
} | |||||
sqlCount := `SELECT COUNT(*) as count,u.level FROM user_relate ur | |||||
LEFT JOIN user u on u.uid=ur.uid | |||||
WHERE ur.parent_uid=%d and u.level=2` | |||||
sqlCount = fmt.Sprintf(sqlCount, user.Info.Uid) | |||||
nativeStringCount, _ := db.QueryNativeString(svc.MasterDb(c), sql) | |||||
for _, v := range nativeStringCount { | |||||
total = utils.StrToInt(v["count"]) | |||||
} | |||||
res := map[string]interface{}{ | |||||
"total": total, "list": hotTask, | |||||
} | |||||
e.OutSuc(c, res, nil) | |||||
return | |||||
} | |||||
func CenterOperatorDetailList(c *gin.Context) { | |||||
var args md2.OperatorTaskReq | |||||
if err := c.ShouldBindJSON(&args); err != nil { | |||||
e.OutErr(c, e.ERR_INVALID_ARGS) | |||||
return | |||||
} | |||||
total := 0 | |||||
hotTask := make([]map[string]string, 0) | |||||
sql := `SELECT u.nickname,u.uid,u.phone,u.create_at | |||||
FROM user_relate ur | |||||
LEFT JOIN user u on u.uid=ur.uid | |||||
WHERE ur.parent_uid=%d and u.level=%s order by u.uid desc %s` | |||||
sql = fmt.Sprintf(sql, args.Uid, args.Level, "limit "+utils.IntToStr((utils.StrToInt(args.P)-1)*utils.StrToInt(args.Size))+","+args.Size) | |||||
nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql) | |||||
for _, v := range nativeString { | |||||
tmp := map[string]string{ | |||||
"uid": v["uid"], | |||||
"nickname": v["nickname"], | |||||
"phone": v["phone"], | |||||
"create_time": v["create_at"], | |||||
} | |||||
hotTask = append(hotTask, tmp) | |||||
} | |||||
sqlCount := `SELECT COUNT(*) as count,u.level FROM user_relate ur | |||||
LEFT JOIN user u on u.uid=ur.uid | |||||
WHERE ur.parent_uid=%d and u.level=%s` | |||||
sqlCount = fmt.Sprintf(sqlCount, args.Uid, args.Level) | |||||
nativeStringCount, _ := db.QueryNativeString(svc.MasterDb(c), sql) | |||||
for _, v := range nativeStringCount { | |||||
total = utils.StrToInt(v["count"]) | |||||
} | |||||
res := map[string]interface{}{ | |||||
"total": total, "list": hotTask, | |||||
} | |||||
e.OutSuc(c, res, nil) | |||||
return | |||||
} | |||||
func CenterOperatorDetailTaskList(c *gin.Context) { | |||||
var args md2.OperatorTaskReq | |||||
if err := c.ShouldBindJSON(&args); err != nil { | |||||
e.OutErr(c, e.ERR_INVALID_ARGS) | |||||
return | |||||
} | |||||
where := "" | |||||
if args.SettleStateType != "" { | |||||
where += " and ctupo.settle_state=" + args.SettleStateType | |||||
} | |||||
if args.Cid != "" { | |||||
where += " and ctl.first_cid=" + args.Cid | |||||
} | |||||
if args.TaskId != "" { | |||||
where += " and ctupo.task_id=" + args.TaskId | |||||
} | |||||
if args.ApplyType != "" { | |||||
where += " and ctupo.state=" + args.ApplyType | |||||
} | |||||
if args.StartTime != "" { | |||||
where += " and ctupo.create_time>='" + args.StartTime + "'" | |||||
} | |||||
if args.EndTime != "" { | |||||
where += " and ctupo.create_time<>>='" + args.EndTime + "'" | |||||
} | |||||
sqlCount := `select count(*) as count from FROM camp_task_user_promotion_order_relate ctupor | |||||
LEFT JOIN camp_task_user_promotion_order ctupo on ctupo.oid=ctupor.oid | |||||
LEFT JOIN camp_task_list ctl on ctupo.task_id=ctl.id | |||||
WHERE ctupor.uid=%d %s` | |||||
sqlCount = fmt.Sprintf(sqlCount, args.Uid, where) | |||||
nativeStringCount, _ := db.QueryNativeString(svc.MasterDb(c), sqlCount) | |||||
var total = 0 | |||||
hotTask := make([]map[string]string, 0) | |||||
for _, v := range nativeStringCount { | |||||
total = utils.StrToInt(v["count"]) | |||||
} | |||||
sql := `select ctl.name as task_name,ul.level_name,ctc.name as cate_name,ctupo.payment,ctupor.oid,ctupo.name as user_name,ctupo.phone as user_phone, | |||||
ctupo.state,ctupo.settle_state,ctupo.create_time,ctupor.amount | |||||
from FROM camp_task_user_promotion_order_relate ctupor | |||||
LEFT JOIN camp_task_user_promotion_order ctupo on ctupo.oid=ctupor.oid | |||||
LEFT JOIN camp_task_list ctl on ctupo.task_id=ctl.id | |||||
LEFT JOIN user_level ul on ctupo.user_lv=ul.id | |||||
LEFT JOIN camp_task_cate ctc on ctl.first_cid=ctc.id | |||||
WHERE ctupor.uid=%d %s order by ctupo.id desc %s` | |||||
sql = fmt.Sprintf(sql, args.Uid, where, "limit "+utils.IntToStr((utils.StrToInt(args.P)-1)*utils.StrToInt(args.Size))+","+args.Size) | |||||
nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql) | |||||
stateType := []string{"审核中", "审核通过", "审核拒绝"} | |||||
settleStateType := []string{"未结算", "结算成功", "结算失败"} | |||||
for _, v := range nativeString { | |||||
tmp := map[string]string{ | |||||
"task_name": v["task_name"], | |||||
"level_name": v["level_name"], | |||||
"cate_name": v["cate_name"], | |||||
"oid": v["oid"], | |||||
"user_name": v["user_name"], | |||||
"user_phone": v["user_phone"], | |||||
"state": v["state"], | |||||
"state_str": stateType[utils.StrToInt(v["state"])], | |||||
"settle_state_str": settleStateType[utils.StrToInt(v["settle_state"])], | |||||
"settle_state": v["settle_state"], | |||||
"create_time": v["create_time"], | |||||
"amount": v["amount"], | |||||
} | |||||
hotTask = append(hotTask, tmp) | |||||
} | |||||
task := make([]map[string]string, 0) | |||||
taskList := make([]models.CampTaskList, 0) | |||||
svc.MasterDb(c).Where("state=?", 1).OrderBy("sort desc,id desc").Find(&taskList) | |||||
for _, v := range taskList { | |||||
tmp := map[string]string{ | |||||
"name": v.Name, "value": utils.IntToStr(v.Id), | |||||
} | |||||
task = append(task, tmp) | |||||
} | |||||
taskCate := make([]map[string]string, 0) | |||||
taskCateList := make([]models.CampTaskCate, 0) | |||||
svc.MasterDb(c).Where(" is_show=?", 1).OrderBy("sort desc,id desc").Find(&taskCateList) | |||||
for _, v := range taskCateList { | |||||
if v.Pid > 0 { | |||||
continue | |||||
} | |||||
tmp := map[string]string{ | |||||
"name": v.Name, "value": utils.IntToStr(v.Id), | |||||
} | |||||
taskCate = append(taskCate, tmp) | |||||
} | |||||
res := map[string]interface{}{ | |||||
"cate_list": taskCate, | |||||
"task_cate_list": task, | |||||
"settle_state_type": []map[string]string{ | |||||
{"name": "未结算", "value": "0"}, | |||||
{"name": "已结算", "value": "1"}, | |||||
{"name": "结算拒绝", "value": "2"}, | |||||
}, | |||||
"state_type": []map[string]string{ | |||||
{"name": "未审核", "value": "0"}, | |||||
{"name": "审核成功", "value": "1"}, | |||||
{"name": "审核拒绝", "value": "2"}, | |||||
}, | |||||
"total": total, "list": hotTask, | |||||
} | |||||
e.OutSuc(c, res, nil) | |||||
return | |||||
} | |||||
func CenterOperatorProjectList(c *gin.Context) { | |||||
var args md2.OperatorTaskReq | |||||
if err := c.ShouldBindJSON(&args); err != nil { | |||||
e.OutErr(c, e.ERR_INVALID_ARGS) | |||||
return | |||||
} | |||||
user := svc.GetUser(c) | |||||
where := "" | |||||
if args.ApplyType != "" { | |||||
where += " and ctpul.state=" + args.ApplyType | |||||
} | |||||
if args.StartTime != "" { | |||||
where += " and ctpul.create_time>='" + args.StartTime + "'" | |||||
} | |||||
if args.EndTime != "" { | |||||
where += " and ctpul.create_time<>>='" + args.EndTime + "'" | |||||
} | |||||
sqlCount := `select count(*) as count from FROM camp_task_project_user_like ctpul | |||||
WHERE uid in(select uid from user_relate where parent_uid=%d) %s` | |||||
sqlCount = fmt.Sprintf(sqlCount, user.Info.Uid, where) | |||||
nativeStringCount, _ := db.QueryNativeString(svc.MasterDb(c), sqlCount) | |||||
var total = 0 | |||||
hotTask := make([]map[string]string, 0) | |||||
for _, v := range nativeStringCount { | |||||
total = utils.StrToInt(v["count"]) | |||||
} | |||||
sql := `select ctpul.state,ctpl.name as project_name,u.nickname,u.phone,ctpul.create_time,ctpul.remark,ctpul.id | |||||
from FROM camp_task_project_user_like ctpul | |||||
LEFT JOIN camp_task_project_list ctpl on ctpul.project_id=ctpl.id | |||||
LEFT JOIN user u on ctpul.uid=u.uid | |||||
WHERE ctpul.uid in(select uid from user_relate where parent_uid=%d) %s order by ctpul.id desc %s` | |||||
sql = fmt.Sprintf(sql, args.Uid, where, "limit "+utils.IntToStr((utils.StrToInt(args.P)-1)*utils.StrToInt(args.Size))+","+args.Size) | |||||
nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql) | |||||
stateType := []string{"审核中", "审核通过", "审核拒绝"} | |||||
for _, v := range nativeString { | |||||
tmp := map[string]string{ | |||||
"project_name": v["project_name"], | |||||
"id": v["id"], | |||||
"user_name": v["nickname"], | |||||
"user_phone": v["phone"], | |||||
"state": v["state"], | |||||
"state_str": stateType[utils.StrToInt(v["state"])], | |||||
"create_time": v["create_time"], | |||||
"remark": v["remark"], | |||||
} | |||||
hotTask = append(hotTask, tmp) | |||||
} | |||||
res := map[string]interface{}{ | |||||
"state_type": []map[string]string{ | |||||
{"name": "未审核", "value": "0"}, | |||||
{"name": "审核成功", "value": "1"}, | |||||
{"name": "审核拒绝", "value": "2"}, | |||||
}, | |||||
"total": total, "list": hotTask, | |||||
} | |||||
e.OutSuc(c, res, nil) | |||||
return | |||||
} | |||||
func CenterOperatorProjectDel(c *gin.Context) { | |||||
var args md.DirectorDelReq | |||||
if err := c.ShouldBindJSON(&args); err != nil { | |||||
e.OutErr(c, e.ERR_INVALID_ARGS) | |||||
return | |||||
} | |||||
svc.MasterDb(c).In("id", args.Ids).Delete(&models.CampTaskProjectUserLike{}) | |||||
e.OutSuc(c, "success", nil) | |||||
return | |||||
} | |||||
func CenterOperatorProjectRemark(c *gin.Context) { | |||||
var args md.DirectorDelReq | |||||
if err := c.ShouldBindJSON(&args); err != nil { | |||||
e.OutErr(c, e.ERR_INVALID_ARGS) | |||||
return | |||||
} | |||||
svc.MasterDb(c).In("id", args.Ids).Cols("remark").Update(&models.CampTaskProjectUserLike{Remark: args.Remark}) | |||||
e.OutSuc(c, "success", nil) | |||||
return | |||||
} |
@@ -14,6 +14,7 @@ func TaskUp(c *gin.Context) { | |||||
func TaskDown(c *gin.Context) { | func TaskDown(c *gin.Context) { | ||||
svc.TaskDown(c) | svc.TaskDown(c) | ||||
} | } | ||||
func TaskDetail(c *gin.Context) { | |||||
svc.TaskDetail(c) | |||||
func TaskUpList(c *gin.Context) { | |||||
svc.TaskUpList(c) | |||||
} | } |
@@ -6,3 +6,15 @@ type TaskListReq struct { | |||||
Cid string `json:"cid"` | Cid string `json:"cid"` | ||||
SettleType string `json:"settle_type"` | SettleType string `json:"settle_type"` | ||||
} | } | ||||
type OperatorTaskReq struct { | |||||
P string `json:"p"` | |||||
Size string `json:"size"` | |||||
SettleStateType string `json:"task_type"` | |||||
ApplyType string `json:"apply_type"` | |||||
Cid string `json:"cid"` | |||||
TaskId string `json:"task_id"` | |||||
StartTime string `json:"start_time"` | |||||
EndTime string `json:"end_time"` | |||||
Uid string `json:"uid"` | |||||
Level string `json:"level"` | |||||
} |
@@ -11,19 +11,32 @@ import ( | |||||
"github.com/gin-gonic/gin" | "github.com/gin-gonic/gin" | ||||
) | ) | ||||
func UserInfo(c *gin.Context) { | |||||
user := svc.GetUser(c) | |||||
operator := "0" | |||||
if user.Info.Level == 3 { | |||||
operator = "1" | |||||
} | |||||
res := map[string]string{ | |||||
"phone": user.Info.Phone, | |||||
"is_operator": operator, | |||||
} | |||||
e.OutSuc(c, res, nil) | |||||
return | |||||
} | |||||
func Index(c *gin.Context) { | func Index(c *gin.Context) { | ||||
user := svc.GetUser(c) | user := svc.GetUser(c) | ||||
sum, _ := svc.MasterDb(c).Where("form_uid=?", user.Info.Uid).Sum(&models.CampTaskUserPromotionOrder{}, "payment") | |||||
count, _ := svc.MasterDb(c).Where("form_uid=?", user.Info.Uid).Count(&models.CampTaskUserPromotionOrder{}) | |||||
allTaskCount, _ := svc.MasterDb(c).Where("uid=?", user.Info.Uid).Count(&models.CampTaskOperatorTask{}) | allTaskCount, _ := svc.MasterDb(c).Where("uid=?", user.Info.Uid).Count(&models.CampTaskOperatorTask{}) | ||||
sql := `SELECT SUM(ctupor.amount) as amount,SUM(IF(ctupor.uid=%d,ctupor.amount,0)) as own_amount,ctupor.level FROM camp_task_user_promotion_order_relate ctupor | |||||
sql := `SELECT SUM(ctupor.amount) as amount,SUM(IF(ctupor.uid=%d,ctupo.payment,0)) as own_payment,SUM(IF(ctupor.uid=%d,1,0)) as own_count,SUM(IF(ctupor.uid=%d,ctupor.amount,0)) as own_amount,ctupor.level FROM camp_task_user_promotion_order_relate ctupor | |||||
LEFT JOIN camp_task_user_promotion_order ctupo on ctupo.oid=ctupor.oid | LEFT JOIN camp_task_user_promotion_order ctupo on ctupo.oid=ctupor.oid | ||||
WHERE ctupo.form_uid=%d GROUP BY ctupor.level` | |||||
sql = fmt.Sprintf(sql, user.Info.Uid, user.Info.Uid) | |||||
WHERE ctupor.oid in(select oid from camp_task_user_promotion_order_relate where uid=%d ) GROUP BY ctupor.level` | |||||
sql = fmt.Sprintf(sql, user.Info.Uid, user.Info.Uid, user.Info.Uid, user.Info.Uid) | |||||
nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql) | nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql) | ||||
var firstAmount float64 = 0 | var firstAmount float64 = 0 | ||||
var secondAmount float64 = 0 | var secondAmount float64 = 0 | ||||
var ownAmount float64 = 0 | var ownAmount float64 = 0 | ||||
var count = 0 | |||||
var sum float64 = 0 | |||||
for _, v := range nativeString { | for _, v := range nativeString { | ||||
if v["level"] == "0" { | if v["level"] == "0" { | ||||
firstAmount += utils.StrToFloat64(v["amount"]) | firstAmount += utils.StrToFloat64(v["amount"]) | ||||
@@ -32,10 +45,12 @@ WHERE ctupo.form_uid=%d GROUP BY ctupor.level` | |||||
secondAmount += utils.StrToFloat64(v["amount"]) | secondAmount += utils.StrToFloat64(v["amount"]) | ||||
} | } | ||||
ownAmount += utils.StrToFloat64(v["own_amount"]) | ownAmount += utils.StrToFloat64(v["own_amount"]) | ||||
sum += utils.StrToFloat64(v["own_payment"]) | |||||
count += utils.StrToInt(v["own_count"]) | |||||
} | } | ||||
totalList := []map[string]string{ | totalList := []map[string]string{ | ||||
{"name": "佣金总金额", "value": utils.Float64ToStr(sum), "unit": "¥"}, | {"name": "佣金总金额", "value": utils.Float64ToStr(sum), "unit": "¥"}, | ||||
{"name": "推广总订单数", "value": utils.Int64ToStr(count), "unit": ""}, | |||||
{"name": "推广总订单数", "value": utils.IntToStr(count), "unit": ""}, | |||||
{"name": "用户所得", "value": utils.Float64ToStr(firstAmount), "unit": "¥"}, | {"name": "用户所得", "value": utils.Float64ToStr(firstAmount), "unit": "¥"}, | ||||
{"name": "团长所得", "value": utils.Float64ToStr(secondAmount), "unit": "¥"}, | {"name": "团长所得", "value": utils.Float64ToStr(secondAmount), "unit": "¥"}, | ||||
{"name": "我的分成", "value": utils.Float64ToStr(ownAmount), "unit": "¥"}, | {"name": "我的分成", "value": utils.Float64ToStr(ownAmount), "unit": "¥"}, | ||||
@@ -78,6 +93,7 @@ WHERE ctupo.form_uid=%d GROUP BY ctupor.level` | |||||
"total_list": totalList, | "total_list": totalList, | ||||
"my_task_count": utils.Int64ToStr(allTaskCount), | "my_task_count": utils.Int64ToStr(allTaskCount), | ||||
"hot_task": hotTask, | "hot_task": hotTask, | ||||
"my_task": myTask, | |||||
} | } | ||||
e.OutSuc(c, res, nil) | e.OutSuc(c, res, nil) | ||||
return | return | ||||
@@ -6,6 +6,7 @@ import ( | |||||
"applet/app/comm/utils" | "applet/app/comm/utils" | ||||
"applet/app/operator/md" | "applet/app/operator/md" | ||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | ||||
"encoding/json" | |||||
"github.com/gin-gonic/gin" | "github.com/gin-gonic/gin" | ||||
"time" | "time" | ||||
) | ) | ||||
@@ -82,21 +83,55 @@ func ProjectList(c *gin.Context) { | |||||
isCanSelect = "1" | isCanSelect = "1" | ||||
} | } | ||||
hotTask := make([]map[string]string, 0) | |||||
hotTask := make([]map[string]interface{}, 0) | |||||
var hotTaskList []models.CampTaskProject | var hotTaskList []models.CampTaskProject | ||||
sess := svc.MasterDb(c).Where("state=?", 1) | sess := svc.MasterDb(c).Where("state=?", 1) | ||||
if args.Cid != "" { | if args.Cid != "" { | ||||
sess.And("cid=?", args.Cid) | sess.And("cid=?", args.Cid) | ||||
} | } | ||||
total, _ := sess.Limit(utils.StrToInt(args.P), (utils.StrToInt(args.P)-1)*utils.StrToInt(args.Size)).OrderBy("is_must desc,id desc").FindAndCount(&hotTaskList) | total, _ := sess.Limit(utils.StrToInt(args.P), (utils.StrToInt(args.P)-1)*utils.StrToInt(args.Size)).OrderBy("is_must desc,id desc").FindAndCount(&hotTaskList) | ||||
cate := make([]models.CampTaskProjectCate, 0) | |||||
svc.MasterDb(c).Where("1=1").Find(&cate) | |||||
for _, v := range hotTaskList { | for _, v := range hotTaskList { | ||||
tmp := map[string]string{ | |||||
"id": utils.IntToStr(v.Id), | |||||
"is_check": "0", | |||||
"is_must": utils.IntToStr(v.IsMust), | |||||
"name": v.Name, | |||||
"money": v.Money, | |||||
"icon": svc.ImageFormat(c, v.Logo), | |||||
enterpriseInfo := make(map[string]string) | |||||
json.Unmarshal([]byte(v.EnterpriseInfo), &enterpriseInfo) | |||||
enterpriseInfo1 := map[string]string{ | |||||
"name": enterpriseInfo["name"], | |||||
"user_name": enterpriseInfo["user_name"], | |||||
"address": enterpriseInfo["address"], | |||||
} | |||||
img := make([]string, 0) | |||||
json.Unmarshal([]byte(v.Img), &img) | |||||
firstImg := "" | |||||
if len(img) > 0 { | |||||
firstImg = img[0] | |||||
} | |||||
detailInfo := make([]string, 0) | |||||
json.Unmarshal([]byte(v.DetailInfo), &detailInfo) | |||||
label := make([]string, 0) | |||||
json.Unmarshal([]byte(v.Label), &label) | |||||
tmp := map[string]interface{}{ | |||||
"year": v.CreateTime.Format("2006") + "年", | |||||
"id": utils.IntToStr(v.Id), | |||||
"name": v.Name, | |||||
"cid": utils.IntToStr(v.Cid), | |||||
"money": v.Money, | |||||
"img": firstImg, | |||||
"video_info": v.VideoInfo, | |||||
"img_list": img, | |||||
"detail_info": detailInfo, | |||||
"create_time": v.CreateTime.Format("2006-01-02 15:04:05"), | |||||
"enterprise_info": enterpriseInfo1, | |||||
"cate_name": "", | |||||
"adv_word": v.AdvWord, | |||||
"label": label, | |||||
"is_check": "0", | |||||
"is_must": utils.IntToStr(v.IsMust), | |||||
} | |||||
for _, v1 := range cate { | |||||
if v1.Id == v.Cid { | |||||
tmp["cate_name"] = v1.Name | |||||
} | |||||
} | } | ||||
counts, _ := svc.MasterDb(c).Where("uid=? and task_id=?", user.Info.Uid, v.Id).Count(&models.CampTaskOperatorTask{}) | counts, _ := svc.MasterDb(c).Where("uid=? and task_id=?", user.Info.Uid, v.Id).Count(&models.CampTaskOperatorTask{}) | ||||
if counts > 0 { | if counts > 0 { | ||||
@@ -1,14 +1,18 @@ | |||||
package svc | package svc | ||||
import ( | import ( | ||||
"applet/app/comm/db" | |||||
"applet/app/comm/e" | "applet/app/comm/e" | ||||
"applet/app/comm/svc" | "applet/app/comm/svc" | ||||
"applet/app/comm/utils" | "applet/app/comm/utils" | ||||
"applet/app/operator/md" | "applet/app/operator/md" | ||||
md2 "applet/app/store/md" | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/lib/comm_plan" | |||||
md2 "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/md" | |||||
svc2 "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/svc" | |||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/implement" | "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/implement" | ||||
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | "code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" | ||||
"encoding/json" | "encoding/json" | ||||
"fmt" | |||||
"github.com/gin-gonic/gin" | "github.com/gin-gonic/gin" | ||||
"time" | "time" | ||||
) | ) | ||||
@@ -60,7 +64,7 @@ func TaskList(c *gin.Context) { | |||||
return | return | ||||
} | } | ||||
user := svc.GetUser(c) | user := svc.GetUser(c) | ||||
hotTask := make([]map[string]string, 0) | |||||
hotTask := make([]map[string]interface{}, 0) | |||||
var hotTaskList []models.CampTaskList | var hotTaskList []models.CampTaskList | ||||
sess := svc.MasterDb(c).Where("up_down_state=?", 1) | sess := svc.MasterDb(c).Where("up_down_state=?", 1) | ||||
if args.Cid != "" { | if args.Cid != "" { | ||||
@@ -71,15 +75,26 @@ func TaskList(c *gin.Context) { | |||||
} | } | ||||
total, _ := sess.Limit(utils.StrToInt(args.P), (utils.StrToInt(args.P)-1)*utils.StrToInt(args.Size)).OrderBy("success_num desc,id desc").FindAndCount(&hotTaskList) | total, _ := sess.Limit(utils.StrToInt(args.P), (utils.StrToInt(args.P)-1)*utils.StrToInt(args.Size)).OrderBy("success_num desc,id desc").FindAndCount(&hotTaskList) | ||||
for _, v := range hotTaskList { | for _, v := range hotTaskList { | ||||
tmp := map[string]string{ | |||||
"id": utils.IntToStr(v.Id), | |||||
"is_check": "0", | |||||
"name": v.Name, | |||||
"price": v.Price, | |||||
"num": utils.IntToStr(v.Num), | |||||
"icon": svc.ImageFormat(c, v.Logo), | |||||
"timer": v.StartTime.Format("2006-01-02") + "至" + v.EndTime.Format("2006-01-02"), | |||||
label := make([]string, 0) | |||||
DetailInfo := make([]string, 0) | |||||
tmp := map[string]interface{}{ | |||||
"id": utils.IntToStr(v.Id), | |||||
"is_check": "0", | |||||
"name": v.Name, | |||||
"price": v.Price, | |||||
"num": utils.IntToStr(v.Num), | |||||
"icon": svc.ImageFormat(c, v.Logo), | |||||
"timer": v.StartTime.Format("2006-01-02") + "至" + v.EndTime.Format("2006-01-02"), | |||||
"detail_info": DetailInfo, | |||||
"label": label, | |||||
} | |||||
taskDetailDb := implement.NewCampTaskDetailDb(svc.MasterDb(c)) | |||||
taskDetail, _ := taskDetailDb.GetCampTaskDetailById(utils.IntToStr(v.Id)) | |||||
if taskDetail != nil { | |||||
json.Unmarshal([]byte(taskDetail.DetailInfo), &DetailInfo) | |||||
tmp["detail_info"] = DetailInfo | |||||
} | } | ||||
json.Unmarshal([]byte(v.Label), &label) | |||||
counts, _ := svc.MasterDb(c).Where("uid=? and task_id=?", user.Info.Uid, v.Id).Count(&models.CampTaskOperatorTask{}) | counts, _ := svc.MasterDb(c).Where("uid=? and task_id=?", user.Info.Uid, v.Id).Count(&models.CampTaskOperatorTask{}) | ||||
if counts > 0 { | if counts > 0 { | ||||
tmp["is_check"] = "1" | tmp["is_check"] = "1" | ||||
@@ -110,41 +125,90 @@ func TaskList(c *gin.Context) { | |||||
e.OutSuc(c, res, nil) | e.OutSuc(c, res, nil) | ||||
return | return | ||||
} | } | ||||
func TaskDetail(c *gin.Context) { | |||||
var args map[string]string | |||||
func TaskUpList(c *gin.Context) { | |||||
var args md.OperatorTaskReq | |||||
if err := c.ShouldBindJSON(&args); err != nil { | if err := c.ShouldBindJSON(&args); err != nil { | ||||
e.OutErr(c, e.ERR_INVALID_ARGS) | e.OutErr(c, e.ERR_INVALID_ARGS) | ||||
return | return | ||||
} | } | ||||
user := svc.GetUser(c) | user := svc.GetUser(c) | ||||
taskDb := implement.NewCampTaskListDb(svc.MasterDb(c)) | |||||
task, _ := taskDb.GetCampTaskById(args["id"]) | |||||
res := md2.TaskAllDetail{} | |||||
res.Label = make([]string, 0) | |||||
res.DetailInfo = make([]string, 0) | |||||
if task != nil { | |||||
taskDetailDb := implement.NewCampTaskDetailDb(svc.MasterDb(c)) | |||||
taskDetail, _ := taskDetailDb.GetCampTaskDetailById(args["id"]) | |||||
res = md2.TaskAllDetail{ | |||||
Id: utils.IntToStr(task.Id), | |||||
Name: task.Name, | |||||
Icon: svc.ImageFormat(c, task.Logo), | |||||
Price: task.Price, | |||||
Num: utils.IntToStr(task.Num), | |||||
Timer: task.StartTime.Format("2006-01-02") + "至" + task.EndTime.Format("2006-01-02"), | |||||
sqlCount := `select count(*) as count from FROM camp_task_operator_task | |||||
WHERE uid=%d ` | |||||
sqlCount = fmt.Sprintf(sqlCount, user.Info.Uid) | |||||
nativeStringCount, _ := db.QueryNativeString(svc.MasterDb(c), sqlCount) | |||||
var total = 0 | |||||
hotTask := make([]map[string]string, 0) | |||||
for _, v := range nativeStringCount { | |||||
total = utils.StrToInt(v["count"]) | |||||
} | |||||
sql := `select ctl.name as task_name,ctl.price as price,ctot.create_time,ctl.up_down_state,ctl.is_delete,ctot.id,ctot.task_id | |||||
from FROM camp_task_operator_task ctot | |||||
LEFT JOIN camp_task_list ctl on ctot.task_id=ctl.id | |||||
WHERE ctot.uid=%d order by ctot.id desc %s` | |||||
sql = fmt.Sprintf(sql, user.Info.Uid, "limit "+utils.IntToStr((utils.StrToInt(args.P)-1)*utils.StrToInt(args.Size))+","+args.Size) | |||||
nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql) | |||||
plan, commission1, virtualCoinMoneyRate := svc2.GetAllPlan(svc.MasterDb(c), c.GetString("mid")) | |||||
rmd := &md2.CommissionParam{} | |||||
cfg, _ := svc2.GetPlanCfg(svc.MasterDb(c), "camp_task", c.GetString("mid"), plan, commission1, virtualCoinMoneyRate, rmd) | |||||
for _, v := range nativeString { | |||||
firstPrice := "0" | |||||
secondPrice := "0" | |||||
if cfg != nil { | |||||
fee, _, _, _ := svc2.CommFee(utils.StrToFloat64(v["price"]), cfg, "commission", rmd) | |||||
tmpPrice, _, _, _ := comm_plan.CalReturnAmountAndRatio(0, 0, 0, "own", fee, 0, cfg) | |||||
firstPrice = utils.Float64ToStr(tmpPrice) | |||||
tmpPrice1, _, _, _ := comm_plan.CalReturnAmountAndRatio(1, 0, 0, "own", fee, 0, cfg) | |||||
secondPrice = utils.Float64ToStr(tmpPrice1) | |||||
} | } | ||||
if taskDetail != nil { | |||||
DetailInfo := make([]string, 0) | |||||
json.Unmarshal([]byte(taskDetail.DetailInfo), &DetailInfo) | |||||
res.DetailInfo = DetailInfo | |||||
orderCount := "0" | |||||
commission := "0" | |||||
sql1 := `select COUNT(*) as count,SUM(ctupor.amount) as amount | |||||
from FROM camp_task_user_promotion_order_relate ctupor | |||||
LEFT JOIN camp_task_user_promotion_order ctupo on ctupo.oid=ctupor.oid | |||||
WHERE ctupor.uid=%d and ctupo.task_id=%s` | |||||
sql1 = fmt.Sprintf(sql1, user.Info.Uid, v["task_id"]) | |||||
queryNativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql1) | |||||
for _, v1 := range queryNativeString { | |||||
orderCount = v1["count"] | |||||
commission = v1["amount"] | |||||
} | } | ||||
label := make([]string, 0) | |||||
json.Unmarshal([]byte(task.Label), &label) | |||||
res.Label = label | |||||
counts, _ := svc.MasterDb(c).Where("uid=? and task_id=?", user.Info.Uid, task.Id).Count(&models.CampTaskOperatorTask{}) | |||||
if counts > 0 { | |||||
res.IsCheck = "1" | |||||
tmp := map[string]string{ | |||||
"task_name": v["task_name"], | |||||
"id": v["id"], | |||||
"base_price": v["price"], | |||||
"first_price": firstPrice, | |||||
"second_price": secondPrice, | |||||
"create_time": v["create_time"], | |||||
"order_count": orderCount, | |||||
"commission": commission, | |||||
} | |||||
hotTask = append(hotTask, tmp) | |||||
} | |||||
task := make([]map[string]string, 0) | |||||
taskList := make([]models.CampTaskList, 0) | |||||
svc.MasterDb(c).Where("state=?", 1).OrderBy("sort desc,id desc").Find(&taskList) | |||||
for _, v := range taskList { | |||||
tmp := map[string]string{ | |||||
"name": v.Name, "value": utils.IntToStr(v.Id), | |||||
} | } | ||||
task = append(task, tmp) | |||||
} | |||||
taskCate := make([]map[string]string, 0) | |||||
taskCateList := make([]models.CampTaskCate, 0) | |||||
svc.MasterDb(c).Where(" is_show=?", 1).OrderBy("sort desc,id desc").Find(&taskCateList) | |||||
for _, v := range taskCateList { | |||||
if v.Pid > 0 { | |||||
continue | |||||
} | |||||
tmp := map[string]string{ | |||||
"name": v.Name, "value": utils.IntToStr(v.Id), | |||||
} | |||||
taskCate = append(taskCate, tmp) | |||||
} | |||||
res := map[string]interface{}{ | |||||
"total": total, "list": hotTask, | |||||
} | } | ||||
e.OutSuc(c, res, nil) | e.OutSuc(c, res, nil) | ||||
return | return | ||||
@@ -125,12 +125,21 @@ func routeOperator(r *gin.RouterGroup) { | |||||
r.POST("/sms", operatorHdl.Sms) //发验证码 | r.POST("/sms", operatorHdl.Sms) //发验证码 | ||||
r.POST("/fastLogin", operatorHdl.FastLogin) //快捷登陆 | r.POST("/fastLogin", operatorHdl.FastLogin) //快捷登陆 | ||||
r.Use(mw.AuthJWT) // 以下接口需要JWT验证 | r.Use(mw.AuthJWT) // 以下接口需要JWT验证 | ||||
r.GET("/userInfo", operatorHdl.UserInfo) //首页数据 | |||||
r.GET("/index", operatorHdl.Index) | r.GET("/index", operatorHdl.Index) | ||||
r.POST("/taskDetail", operatorHdl.TaskDetail) //任务详情 | |||||
r.POST("/taskCenter", operatorHdl.TaskList) | r.POST("/taskCenter", operatorHdl.TaskList) | ||||
r.POST("/taskCenter/upList", operatorHdl.TaskUpList) | |||||
r.POST("/taskCenter/up", operatorHdl.TaskUp) | r.POST("/taskCenter/up", operatorHdl.TaskUp) | ||||
r.POST("/taskCenter/down", operatorHdl.TaskDown) | r.POST("/taskCenter/down", operatorHdl.TaskDown) | ||||
r.POST("/projectCenter", operatorHdl.ProjectList) | r.POST("/projectCenter", operatorHdl.ProjectList) | ||||
//r.POST("/projectDetail", operatorHdl.ProjectDetail) | |||||
r.POST("/projectSelect", operatorHdl.ProjectSelect) | r.POST("/projectSelect", operatorHdl.ProjectSelect) | ||||
r.GET("/centerBase", operatorHdl.CenterBase) | |||||
r.POST("/centerList", operatorHdl.CenterList) | |||||
r.POST("/centerOperatorList", operatorHdl.CenterOperatorList) | |||||
r.POST("/centerOperatorDetailList", operatorHdl.CenterOperatorDetailList) | |||||
r.POST("/centerOperatorDetailTaskList", operatorHdl.CenterOperatorDetailTaskList) | |||||
r.POST("/centerOperatorProjectList", operatorHdl.CenterOperatorProjectList) | |||||
r.POST("/centerOperatorProjectRemark", operatorHdl.CenterOperatorProjectRemark) | |||||
r.POST("/centerOperatorProjectDel", operatorHdl.CenterOperatorProjectDel) | |||||
} | } |
@@ -10,7 +10,8 @@ type DirectorReq struct { | |||||
EndTime string `json:"end_time"` | EndTime string `json:"end_time"` | ||||
} | } | ||||
type DirectorDelReq struct { | type DirectorDelReq struct { | ||||
Ids []string `json:"ids"` | |||||
Ids []string `json:"ids"` | |||||
Remark string `json:"remark"` | |||||
} | } | ||||
type DirectorTaskSaveReq struct { | type DirectorTaskSaveReq struct { | ||||
TaskIds []string `json:"task_ids"` | TaskIds []string `json:"task_ids"` | ||||
@@ -75,7 +75,7 @@ func DirectorSave(c *gin.Context) { | |||||
Phone: args["phone"], | Phone: args["phone"], | ||||
Pid: storeId, | Pid: storeId, | ||||
} | } | ||||
svc.MasterDb(c).Insert(&models.CampTaskStoreUser{}) | |||||
svc.MasterDb(c).Insert(&data) | |||||
} | } | ||||
data.Phone = args["phone"] | data.Phone = args["phone"] | ||||
if args["password"] != "" { | if args["password"] != "" { | ||||