wangfei 6 år sedan
förälder
incheckning
fde828fc15

+ 2
- 2
controllers/cases/key.go Visa fil

@@ -29,11 +29,11 @@ func (c *CaseController) GetKeyList() {
29 29
 // AddKeys 新增钥匙
30 30
 func (c *CaseController) AddKeys() {
31 31
 	caseid := c.GetString("caseid")
32
-	orgid := c.GetString("orgid")
32
+	org := c.Context.Get("org").(model.SysOrg)
33 33
 	beginnum, _ := c.GetInt("beginnum")
34 34
 	endnum, _ := c.GetInt("endnum")
35 35
 
36
-	err := c.dao.AddKeys(orgid, caseid, beginnum, endnum)
36
+	err := c.dao.AddKeys(org.OrgId, caseid, beginnum, endnum)
37 37
 	if err != nil {
38 38
 		c.ResponseError(err)
39 39
 	}

+ 1
- 1
controllers/statistics/cardcoupon.go Visa fil

@@ -293,5 +293,5 @@ func (c *StatisticsController) CardCouponVerifyStatisticsExcel() {
293 293
 			verifystatus,
294 294
 		})
295 295
 	}
296
-	c.SaveToExcel("卡券核销列表.xlsx", excel)
296
+	c.SaveToExcel("课程核销列表.xlsx", excel)
297 297
 }

+ 1
- 2
models/goods/goods.go Visa fil

@@ -54,8 +54,7 @@ func (m *GoodsDAO) GetGoodsListPageNavi(name, typeID, caseID string, limit []int
54 54
 	sql += `		
55 55
 		AND status > ` + strconv.Itoa(models.STATUS_DEL) + `
56 56
 		ORDER BY
57
-			type_id,
58
-			create_date
57
+			create_date desc
59 58
 	`
60 59
 
61 60
 	// sql += ` limit ` + strconv.Itoa(limit[0]) + ` OFFSET ` + strconv.Itoa(limit[1])

+ 1
- 0
models/statistics/goods.go Visa fil

@@ -235,6 +235,7 @@ func (m *StatisticsDAO) GetGoodsOrderStatisticsCount(status, usertype, caseids,
235 235
 	if status != "" {
236 236
 		sql = sql + ` and a.make_status='` + status + `'`
237 237
 	}
238
+	sql += ` order by a.create_date desc `
238 239
 	err := m.db.Sql(sql).Find(&orders)
239 240
 	return orders, err
240 241
 }

+ 1
- 4
models/vipcard/vipcard.go Visa fil

@@ -59,7 +59,7 @@ WHERE
59 59
 	if userName != "" {
60 60
 		sql = sql + ` and tc.customer_name like '%` + userName + `%'`
61 61
 	}
62
-	sql = sql + " order by vc.create_date, vip_card_child_code desc limit " + strconv.Itoa((page-1)*pageSize) + ", " + strconv.Itoa(pageSize)
62
+	sql = sql + " order by vc.create_date desc limit " + strconv.Itoa((page-1)*pageSize) + ", " + strconv.Itoa(pageSize)
63 63
 	err := m.db.Sql(sql).Find(&vipcards)
64 64
 	return vipcards, err
65 65
 }
@@ -168,7 +168,6 @@ func (m *VipcardDAO) GenerateChildCode() string {
168 168
 	return code
169 169
 }
170 170
 
171
-
172 171
 // GetVipCardListExcel 获取VIP卡列表 excel
173 172
 func (m *VipcardDAO) GetVipCardListExcel(caseids, cardNo, sellerName, userName string) ([]VipChild, error) {
174 173
 	var vipcards []VipChild
@@ -200,5 +199,3 @@ WHERE
200 199
 	err := m.db.Sql(sql).Find(&vipcards)
201 200
 	return vipcards, err
202 201
 }
203
-
204
-

+ 1
- 1
service/card/card.go Visa fil

@@ -289,7 +289,7 @@ func (s *CardServ) GiveCardTo(from *model.SysUser, to *model.TaCustomer, card *c
289 289
 		GiftId:     card.CardId,
290 290
 		GiftName:   card.CardName,
291 291
 		FromId:     from.UserId,
292
-		FromName:   from.UserName,
292
+		FromName:   from.RealName,
293 293
 		ToId:       to.CustomerId,
294 294
 		ToName:     to.CustomerName,
295 295
 		CreateDate: time.Now().Local(),

+ 3
- 0
service/cases/key.go Visa fil

@@ -52,6 +52,9 @@ func (s *CaseServ) GetKeysByCase(caseids, num string, page, pageSize int) (map[s
52 52
 
53 53
 // AddKeys 保存钥匙
54 54
 func (s *CaseServ) AddKeys(orgid, caseid string, beginnum, endnum int) error {
55
+	if caseid == "" {
56
+		return utils.LogError("请先选择案场!")
57
+	}
55 58
 	if endnum < beginnum {
56 59
 		return utils.LogError("锁柜编号起始编号不能大于截止编号!")
57 60
 	}

+ 1
- 1
service/coupon/coupon.go Visa fil

@@ -318,7 +318,7 @@ func (s *CouponServ) GiveCouponTo(from *model.SysUser, to *model.TaCustomer, cp
318 318
 		GiftId:     cp.CouponId,
319 319
 		GiftName:   cp.CouponName,
320 320
 		FromId:     from.UserId,
321
-		FromName:   from.UserName,
321
+		FromName:   from.RealName,
322 322
 		ToId:       to.CustomerId,
323 323
 		ToName:     to.CustomerName,
324 324
 		CreateDate: now,