xuzhiheng 2 年之前
父節點
當前提交
9005f8f618
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      service/service.go

+ 6 - 3
service/service.go

@@ -85,14 +85,16 @@ func DelUsePerson(this *entmanageapplication.DelUsePersonReq) *entmanageapplicat
 }
 
 func UsePersonList(this *entmanageapplication.UsePersonListReq) *entmanageapplication.UsePersonListResp {
+	nowTime := time.Now().Format("2006-01-02 15:04:05")
 	data := JyMysql.SelectBySql(`select a.id,a.wait_empower_id,c.name,c.phone,c.mail,g.name as department,e.name as role from entniche_power a 
 		INNER JOIN entniche_user c on (a.ent_user_id=c.id and a.ent_id = c.ent_id) 
 		LEFT JOIN entniche_user_role d on (c.id=d.user_id) 
 		LEFT JOIN entniche_role e on (d.role_id=e.id) 
 		LEFT JOIN entniche_department_user f on (a.ent_user_id=f.user_id) 
 		LEFT JOIN entniche_department g on (g.id=f.dept_id) 
-		where a.status = 1 and a.ent_id = ?
-		order by a.update_time desc`, this.EntId)
+		LEFT JOIN entniche_wait_empower h on (h.id=a.wait_empower_id) 
+		where a.status = 1 and a.ent_id = ? and end_time >= ? 
+		order by a.update_time desc`, this.EntId, nowTime)
 	arr := []*entmanageapplication.UsePersonList{}
 	if data != nil && len(*data) > 0 {
 		for _, v := range *data {
@@ -129,7 +131,8 @@ func UsePersonList(this *entmanageapplication.UsePersonListReq) *entmanageapplic
 }
 
 func BuyProductList(this *entmanageapplication.BuyProductListReq) *entmanageapplication.BuyProductListResp {
-	data := JyMysql.Find(EntnicheWaitEmpower, map[string]interface{}{"ent_id": this.EntId}, "", "create_time desc", 0, 0)
+	nowTime := time.Now().Format("2006-01-02 15:04:05")
+	data := JyMysql.SelectBySql(`select * from `+EntnicheWaitEmpower+` where ent_id = ? and end_time >= ? order by create_time desc`, this.EntId, nowTime)
 	arr := []*entmanageapplication.BuyProductList{}
 	if data != nil && len(*data) > 0 {
 		for _, v := range *data {