Przeglądaj źródła

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/services into dev

胡轶钦 6 lat temu
rodzic
commit
65a0c17c5e

+ 3
- 2
controllers/marketing/marketing.go Wyświetl plik

23
 func (c *MarketingController) GetMarketingList() {
23
 func (c *MarketingController) GetMarketingList() {
24
 	page, _ := c.GetInt("page")
24
 	page, _ := c.GetInt("page")
25
 	pageSize, _ := c.GetInt("pageSize")
25
 	pageSize, _ := c.GetInt("pageSize")
26
-
27
-	marketings, err := c.serv.GetMarketingList(page, pageSize)
26
+	cases := c.Context.Get("cases").([]model.SysUserCase)
27
+	caseIDs := c.GetCaseIDs(cases)
28
+	marketings, err := c.serv.GetMarketingList(caseIDs, page, pageSize)
28
 	if err != nil {
29
 	if err != nil {
29
 		c.ResponseError(err)
30
 		c.ResponseError(err)
30
 	}
31
 	}

+ 71
- 3
models/card/card.go Wyświetl plik

250
 				return nil, err
250
 				return nil, err
251
 			}
251
 			}
252
 			cards[inx].CustomerCard = cCards
252
 			cards[inx].CustomerCard = cCards
253
+		} else {
254
+			// 主管
255
+			num, err := m.GetCustomerCardVerifyNum(card.CardId)
256
+			if err != nil {
257
+				return nil, err
258
+			}
259
+			cards[inx].UsedCount = num
253
 		}
260
 		}
254
 		share, err := m.GetCardShareByCardID(card.CardId)
261
 		share, err := m.GetCardShareByCardID(card.CardId)
255
 		if err != nil {
262
 		if err != nil {
260
 	return cards, err
267
 	return cards, err
261
 }
268
 }
262
 
269
 
270
+// GetCustomerCardVerifyNum 获取卡核销数量
271
+func (m *CardDAO) GetCustomerCardVerifyNum(cardid string) (int, error) {
272
+	var customerCards []model.TaCustomerCard
273
+	err := m.db.Where("card_id=?", cardid).And("verify_status<>?", models.VERIFY_USEABLE).Find(&customerCards)
274
+	return len(customerCards), err
275
+}
276
+
263
 // GetCaseUsableCardCount 获取案场可用卡数量
277
 // GetCaseUsableCardCount 获取案场可用卡数量
264
 func (m *CardDAO) GetCaseUsableCardCount(caseid, userid string) (int, error) {
278
 func (m *CardDAO) GetCaseUsableCardCount(caseid, userid string) (int, error) {
265
 	var Coupons []CaseUsableCard
279
 	var Coupons []CaseUsableCard
275
 	return customerCards, err
289
 	return customerCards, err
276
 }
290
 }
277
 
291
 
292
+// 案场可用卡信息
293
+type CardDetailWithSales struct {
294
+	model.TaCouponCard `xorm:"extends"`
295
+	CustomerCard       []SalesWithCustomerCardNum
296
+}
297
+
298
+// SalesWithCustomerCardNum
299
+type SalesWithCustomerCardNum struct {
300
+	RealName   string
301
+	SalesId    string
302
+	ReceiveNum int
303
+	UsedNum    int
304
+}
305
+
278
 // GetCardDetail 获取卡详情
306
 // GetCardDetail 获取卡详情
279
-func (m *CardDAO) GetCardDetail(cardid string) (*CaseUsableCard, error) {
280
-	var card = new(CaseUsableCard)
307
+func (m *CardDAO) GetCardDetail(cardid string) (*CardDetailWithSales, error) {
308
+	var card = new(CardDetailWithSales)
281
 	sql := `select * from ta_coupon_card where card_id=? and status>?`
309
 	sql := `select * from ta_coupon_card where card_id=? and status>?`
282
 	_, err := m.db.Sql(sql, cardid, models.STATUS_DEL).Get(card)
310
 	_, err := m.db.Sql(sql, cardid, models.STATUS_DEL).Get(card)
283
 	if err != nil {
311
 	if err != nil {
286
 	if card == nil || card.CardId == "" {
314
 	if card == nil || card.CardId == "" {
287
 		return nil, errors.New("无卡信息")
315
 		return nil, errors.New("无卡信息")
288
 	}
316
 	}
289
-	ccards, err := m.GetCustomerCardByCard(cardid)
317
+	num, err := m.GetCustomerCardVerifyNum(card.CardId)
318
+	if err != nil {
319
+		return nil, err
320
+	}
321
+	card.UsedCount = num
322
+	ccards, err := m.GetCustomerCardByCardWithRealName(cardid)
290
 	if err != nil {
323
 	if err != nil {
291
 		return nil, err
324
 		return nil, err
292
 	}
325
 	}
294
 	return card, nil
327
 	return card, nil
295
 }
328
 }
296
 
329
 
330
+// GetSalesCardByCard 根据卡获取领取的用户信息
331
+func (m *CardDAO) GetSalesCardByCard(cardid string) ([]model.TaCustomerCard, error) {
332
+	var customerCards []model.TaCustomerCard
333
+	err := m.db.Where("card_id=?", cardid).And("status>?", models.STATUS_DEL).Find(&customerCards)
334
+	return customerCards, err
335
+}
336
+
337
+// GetCustomerCardByCardWithRealName 根据卡获取领取的用户信息
338
+func (m *CardDAO) GetCustomerCardByCardWithRealName(cardid string) ([]SalesWithCustomerCardNum, error) {
339
+	var customerCards []SalesWithCustomerCardNum
340
+	sql := `SELECT
341
+			b.real_name,
342
+			a.sales_id,
343
+			count(1) AS receive_num,
344
+			sum(
345
+				CASE
346
+				WHEN a.verify_status = 'useable' THEN
347
+					0
348
+				ELSE
349
+					1
350
+				END
351
+			) AS used_num
352
+		FROM
353
+			ta_customer_card a
354
+		INNER JOIN sys_user b ON a.sales_id = b.user_id
355
+		WHERE
356
+			a.card_id = ?
357
+		AND a. STATUS > ?
358
+		GROUP BY
359
+			b.real_name,
360
+			a.sales_id`
361
+	err := m.db.Sql(sql, cardid, models.STATUS_DEL).Find(&customerCards)
362
+	return customerCards, err
363
+}
364
+
297
 // GetCustomerCardByCard 根据卡获取领取的用户信息
365
 // GetCustomerCardByCard 根据卡获取领取的用户信息
298
 func (m *CardDAO) GetCustomerCardByCard(cardid string) ([]model.TaCustomerCard, error) {
366
 func (m *CardDAO) GetCustomerCardByCard(cardid string) ([]model.TaCustomerCard, error) {
299
 	var customerCards []model.TaCustomerCard
367
 	var customerCards []model.TaCustomerCard

+ 4
- 0
models/constant.go Wyświetl plik

172
 	QRCODE_TYPE_COURSE = "course"
172
 	QRCODE_TYPE_COURSE = "course"
173
 	QRCODE_TYPE_PRIZE  = "prize"
173
 	QRCODE_TYPE_PRIZE  = "prize"
174
 )
174
 )
175
+
176
+const (
177
+	ADMIN_ID = "1"
178
+)

+ 13
- 3
models/coupon/coupon.go Wyświetl plik

344
 }
344
 }
345
 
345
 
346
 // GetCouponDetail 获取优惠券详情
346
 // GetCouponDetail 获取优惠券详情
347
-func (m *CouponDAO) GetCouponDetail(couponid string) (*CaseCouponDetail, error) {
348
-	var coupon = new(CaseCouponDetail)
347
+func (m *CouponDAO) GetCouponDetail(couponid string) (*CaseCouponDetailWithRealName, error) {
348
+	var coupon = new(CaseCouponDetailWithRealName)
349
 	sql := `select * from ta_coupon where coupon_id=? and status>?`
349
 	sql := `select * from ta_coupon where coupon_id=? and status>?`
350
 	_, err := m.db.Sql(sql, couponid, models.STATUS_DEL).Get(coupon)
350
 	_, err := m.db.Sql(sql, couponid, models.STATUS_DEL).Get(coupon)
351
 	if err != nil {
351
 	if err != nil {
354
 	if coupon == nil || coupon.CouponId == "" {
354
 	if coupon == nil || coupon.CouponId == "" {
355
 		return nil, errors.New("无优惠券信息")
355
 		return nil, errors.New("无优惠券信息")
356
 	}
356
 	}
357
-	cCoupons, err := m.GetCustomerCouponByCoupon(couponid)
357
+	cCoupons, err := m.GetCustomerCouponByCouponWithRealName(couponid)
358
 	if err != nil {
358
 	if err != nil {
359
 		return nil, err
359
 		return nil, err
360
 	}
360
 	}
369
 	return customerCoupons, err
369
 	return customerCoupons, err
370
 }
370
 }
371
 
371
 
372
+// GetCustomerCouponByCouponWithRealName 根据优惠券与用户获取领取的用户信息
373
+func (m *CouponDAO) GetCustomerCouponByCouponWithRealName(couponid string) ([]SalesWithCustomerCouponNum, error) {
374
+	var customerCoupons []SalesWithCustomerCouponNum
375
+	sql := `select b.real_name,a.sales_id,count(1) as receive_num,sum(case when a.status=1 then 0 when a.status=2 then 1 end) as used_num
376
+	 from ta_customer_coupon a inner join sys_user b on a.sales_id = b.user_id where a.coupon_id=? and a.status>?
377
+	 GROUP BY b.real_name,a.sales_id`
378
+	err := m.db.Sql(sql, couponid, models.STATUS_DEL).Find(&customerCoupons)
379
+	return customerCoupons, err
380
+}
381
+
372
 // GetCustomerCouponByUser 根据用户获取领取的用户信息
382
 // GetCustomerCouponByUser 根据用户获取领取的用户信息
373
 func (m *CouponDAO) GetCustomerCouponByUser(caseid, userid string) ([]model.TaCustomerCoupon, error) {
383
 func (m *CouponDAO) GetCustomerCouponByUser(caseid, userid string) ([]model.TaCustomerCoupon, error) {
374
 	var customerCoupons []model.TaCustomerCoupon
384
 	var customerCoupons []model.TaCustomerCoupon

+ 16
- 1
models/coupon/types.go Wyświetl plik

20
 	ChannelId      string
20
 	ChannelId      string
21
 }
21
 }
22
 
22
 
23
-// CaseUsableCoupon 案场可用优惠券信息
23
+// CaseCouponDetail 案场可用优惠券信息
24
 type CaseCouponDetail struct {
24
 type CaseCouponDetail struct {
25
 	model.TaCoupon `xorm:"extends"`
25
 	model.TaCoupon `xorm:"extends"`
26
 	CustomerCoupon []model.TaCustomerCoupon
26
 	CustomerCoupon []model.TaCustomerCoupon
27
 	Share          *model.TaCouponShare
27
 	Share          *model.TaCouponShare
28
 }
28
 }
29
 
29
 
30
+// CaseCouponDetailWithRealName
31
+type CaseCouponDetailWithRealName struct {
32
+	model.TaCoupon `xorm:"extends"`
33
+	CustomerCoupon []SalesWithCustomerCouponNum
34
+	Share          *model.TaCouponShare
35
+}
36
+
37
+// SalesWithCustomerCouponNum
38
+type SalesWithCustomerCouponNum struct {
39
+	RealName   string
40
+	SalesId    string
41
+	ReceiveNum int
42
+	UsedNum    int
43
+}
44
+
30
 // CustomerCoupon 用户优惠券
45
 // CustomerCoupon 用户优惠券
31
 type CustomerCoupon struct {
46
 type CustomerCoupon struct {
32
 	model.TaCustomerCoupon `xorm:"extends"`
47
 	model.TaCustomerCoupon `xorm:"extends"`

+ 9
- 4
models/luckdraw/luckdraw.go Wyświetl plik

123
 	record.UserHeadImg = user.Headimgurl
123
 	record.UserHeadImg = user.Headimgurl
124
 	record.LuckdrawId = luckdraw.Id
124
 	record.LuckdrawId = luckdraw.Id
125
 	_, err = m.SaveRecord(record)
125
 	_, err = m.SaveRecord(record)
126
+	if err != nil {
127
+		utils.LogError("保存中奖纪录失败:", err)
128
+		return nil, nil, err
129
+	}
126
 	// var detail = model.TaPrizeDetail{}
130
 	// var detail = model.TaPrizeDetail{}
127
 	// if len(details) > 0 {
131
 	// if len(details) > 0 {
128
 	// 	// 更新中奖纪录明细
132
 	// 	// 更新中奖纪录明细
145
 		prize.Remainder = prize.Remainder - 1
149
 		prize.Remainder = prize.Remainder - 1
146
 		err = m.UpdateStock(prize)
150
 		err = m.UpdateStock(prize)
147
 		if err != nil {
151
 		if err != nil {
152
+			utils.LogError("更新库存失败:", err)
148
 			return nil, nil, err
153
 			return nil, nil, err
149
 		}
154
 		}
150
 		stockprizes, err := m.GetPrizeStock(id)
155
 		stockprizes, err := m.GetPrizeStock(id)
254
 	cols := []string{
259
 	cols := []string{
255
 		"end_date",
260
 		"end_date",
256
 	}
261
 	}
257
-	_, err := m.db.Update(luckdraw, cols, "id=?", id)
262
+	_, err := m.db.Cols(cols...).Where("id=?", id).Update(luckdraw)
258
 	return err
263
 	return err
259
 }
264
 }
260
 
265
 
270
 	cols := []string{
275
 	cols := []string{
271
 		"remainder",
276
 		"remainder",
272
 	}
277
 	}
273
-	_, err := m.db.Update(prize, cols, "id=?", prize.Id)
278
+	_, err := m.db.Cols(cols...).Where("id=?", prize.Id).Update(prize)
274
 	return err
279
 	return err
275
 }
280
 }
276
 
281
 
320
 		"receive_id",
325
 		"receive_id",
321
 		"receive_date",
326
 		"receive_date",
322
 	}
327
 	}
323
-	_, err := m.db.Update(detail, cols, "id=?", detail.Id)
328
+	_, err := m.db.Cols(cols...).Where("id=?", detail.Id).Update(detail)
324
 	return err
329
 	return err
325
 }
330
 }
326
 
331
 
332
 		"status",
337
 		"status",
333
 		"writeoff_date",
338
 		"writeoff_date",
334
 	}
339
 	}
335
-	_, err := m.db.Update(record, cols, "id=?", record.Id)
340
+	_, err := m.db.Cols(cols...).Where("id=?", record.Id).Update(record)
336
 	return err
341
 	return err
337
 }
342
 }
338
 
343
 

+ 7
- 4
models/marketing/marketing.go Wyświetl plik

5
 	"spaceofcheng/services/models/model"
5
 	"spaceofcheng/services/models/model"
6
 	"spaceofcheng/services/utils"
6
 	"spaceofcheng/services/utils"
7
 	"strconv"
7
 	"strconv"
8
+	"strings"
8
 	"time"
9
 	"time"
9
 
10
 
10
 	"github.com/go-xorm/xorm"
11
 	"github.com/go-xorm/xorm"
49
 }
50
 }
50
 
51
 
51
 // GetMarketingList 查询所有
52
 // GetMarketingList 查询所有
52
-func (m *MarketingDAO) GetMarketingList(page int, pageSize int) ([]MarketingInfo, error) {
53
+func (m *MarketingDAO) GetMarketingList(caseids string, page int, pageSize int) ([]MarketingInfo, error) {
53
 
54
 
54
 	var news []MarketingInfo
55
 	var news []MarketingInfo
55
 	//sql := `select * from sys_activity new order by new.create_date desc limit ` + strconv.Itoa((page-1)*pageSize) + ", " + strconv.Itoa(pageSize)
56
 	//sql := `select * from sys_activity new order by new.create_date desc limit ` + strconv.Itoa((page-1)*pageSize) + ", " + strconv.Itoa(pageSize)
56
-	sql := `SELECT sc.case_name,sa.*,sas.action_id,sas.active_type,sas.resource_type,sas.resource_desc from sys_activity sa LEFT JOIN sys_activity_action sas on sa.activity_id = sas.activity_id LEFT JOIN sys_case sc on sa.case_id = sc.case_id where sa.status != -1 order by sa.create_date desc limit ` + strconv.Itoa((page-1)*pageSize) + ", " + strconv.Itoa(pageSize)
57
+	sql := `SELECT sc.case_name,sa.*,sas.action_id,sas.active_type,sas.resource_type,sas.resource_desc from sys_activity sa 
58
+	LEFT JOIN sys_activity_action sas on sa.activity_id = sas.activity_id LEFT JOIN sys_case sc on sa.case_id = sc.case_id 
59
+	where sa.status != -1 and sa.case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `') order by sa.create_date desc limit ` + strconv.Itoa((page-1)*pageSize) + ", " + strconv.Itoa(pageSize)
57
 
60
 
58
 	err := m.db.Sql(sql).Find(&news)
61
 	err := m.db.Sql(sql).Find(&news)
59
 	return news, err
62
 	return news, err
61
 }
64
 }
62
 
65
 
63
 // GetMarketingCount 获取总数
66
 // GetMarketingCount 获取总数
64
-func (m *MarketingDAO) GetMarketingCount() (int64, error) {
67
+func (m *MarketingDAO) GetMarketingCount(caseids string) (int64, error) {
65
 	var total []int64
68
 	var total []int64
66
-	sql := `select count(*) as total from sys_activity where status>` + strconv.Itoa(models.STATUS_DEL)
69
+	sql := `select count(*) as total from sys_activity where case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `') and status>` + strconv.Itoa(models.STATUS_DEL)
67
 	err := m.db.Sql(sql).Cols("total").Find(&total)
70
 	err := m.db.Sql(sql).Cols("total").Find(&total)
68
 	if err != nil {
71
 	if err != nil {
69
 
72
 

+ 2
- 2
models/system/user.go Wyświetl plik

41
 	sql := `select user.*,c.user_type_names from sys_user user left join (
41
 	sql := `select user.*,c.user_type_names from sys_user user left join (
42
 		select a.user_id,GROUP_CONCAT(b.type_name) as user_type_names from sys_user_type a
42
 		select a.user_id,GROUP_CONCAT(b.type_name) as user_type_names from sys_user_type a
43
 		INNER join td_user_type b on a.type_id = b.type_id
43
 		INNER join td_user_type b on a.type_id = b.type_id
44
-		group by a.user_id) c on user.user_id = c.user_id where user.user_id != '0' and
44
+		group by a.user_id) c on user.user_id = c.user_id where user.user_id != '` + models.ADMIN_ID + `' and
45
 		(status> ` + strconv.Itoa(models.STATUS_DEL) + ` and user_name like '%` + username + `%' and user.user_id in 
45
 		(status> ` + strconv.Itoa(models.STATUS_DEL) + ` and user_name like '%` + username + `%' and user.user_id in 
46
 		(select user_id from sys_user_case where case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `')))`
46
 		(select user_id from sys_user_case where case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `')))`
47
 
47
 
60
 	sql := `select user.*,c.user_type_names from sys_user user left join (
60
 	sql := `select user.*,c.user_type_names from sys_user user left join (
61
 		select a.user_id,GROUP_CONCAT(b.type_name) as user_type_names from sys_user_type a
61
 		select a.user_id,GROUP_CONCAT(b.type_name) as user_type_names from sys_user_type a
62
 		INNER join td_user_type b on a.type_id = b.type_id
62
 		INNER join td_user_type b on a.type_id = b.type_id
63
-		group by a.user_id) c on user.user_id = c.user_id where user.user_id != '0' and
63
+		group by a.user_id) c on user.user_id = c.user_id where user.user_id != '` + models.ADMIN_ID + `' and
64
 		(status> ` + strconv.Itoa(models.STATUS_DEL) + ` and user_name like '%` + username + `%' and user.user_id in 
64
 		(status> ` + strconv.Itoa(models.STATUS_DEL) + ` and user_name like '%` + username + `%' and user.user_id in 
65
 		(select user_id from sys_user_case where case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `')))`
65
 		(select user_id from sys_user_case where case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `')))`
66
 
66
 

+ 1
- 1
service/card/card.go Wyświetl plik

358
 }
358
 }
359
 
359
 
360
 // GetCardWithCustomer 获取体验卡明细
360
 // GetCardWithCustomer 获取体验卡明细
361
-func (s *CardServ) GetCardWithCustomer(cardid string) (*card.CaseUsableCard, error) {
361
+func (s *CardServ) GetCardWithCustomer(cardid string) (*card.CardDetailWithSales, error) {
362
 	if cardid == "" {
362
 	if cardid == "" {
363
 		return nil, errors.New("没有卡信息!")
363
 		return nil, errors.New("没有卡信息!")
364
 	}
364
 	}

+ 15
- 0
service/cases/cases.go Wyświetl plik

106
 			utils.LogError("保存案场信息失败: " + err.Error())
106
 			utils.LogError("保存案场信息失败: " + err.Error())
107
 			return nil, errors.New("保存案场信息失败")
107
 			return nil, errors.New("保存案场信息失败")
108
 		}
108
 		}
109
+		// 新增管理员对应案场
110
+		if newInfo.CreateUser != "1" {
111
+			var userCase = model.SysUserCase{
112
+				CaseId:    newInfo.CaseId,
113
+				UserId:    models.ADMIN_ID,
114
+				CaseName:  newInfo.CaseName,
115
+				IsBelong:  0,
116
+				IsCreated: 0,
117
+			}
118
+			err = s.userdao.SaveUserCase(userCase)
119
+			if err != nil {
120
+				utils.LogError("保存案场信息失败: " + err.Error())
121
+				return nil, errors.New("保存案场信息失败")
122
+			}
123
+		}
109
 		// 新增案场配置信息
124
 		// 新增案场配置信息
110
 		var conf = model.SysCaseConf{
125
 		var conf = model.SysCaseConf{
111
 			CaseId:   newInfo.CaseId,
126
 			CaseId:   newInfo.CaseId,

+ 1
- 1
service/coupon/coupon.go Wyświetl plik

402
 }
402
 }
403
 
403
 
404
 // GetCouponWithCustomer 获取优惠券明细
404
 // GetCouponWithCustomer 获取优惠券明细
405
-func (s *CouponServ) GetCouponWithCustomer(couponid string) (*coupon.CaseCouponDetail, error) {
405
+func (s *CouponServ) GetCouponWithCustomer(couponid string) (*coupon.CaseCouponDetailWithRealName, error) {
406
 	if couponid == "" {
406
 	if couponid == "" {
407
 		return nil, errors.New("没有券信息!")
407
 		return nil, errors.New("没有券信息!")
408
 	}
408
 	}

+ 1
- 0
service/luckdraw/luckdraw.go Wyświetl plik

37
 func (s *LuckdrawServ) LuckDraw(id string, user *model.TaCustomer) (*model.TaLuckdrawPrize, *model.TaPrizeDetail, error) {
37
 func (s *LuckdrawServ) LuckDraw(id string, user *model.TaCustomer) (*model.TaLuckdrawPrize, *model.TaPrizeDetail, error) {
38
 	prize, prizeDetail, err := s.dao.LuckDraw(id, user)
38
 	prize, prizeDetail, err := s.dao.LuckDraw(id, user)
39
 	if err != nil {
39
 	if err != nil {
40
+		utils.LogError("抽奖失败:", err)
40
 		return nil, nil, err
41
 		return nil, nil, err
41
 	}
42
 	}
42
 	return prize, prizeDetail, nil
43
 	return prize, prizeDetail, nil

+ 3
- 3
service/marketing/marketing.go Wyświetl plik

31
 }
31
 }
32
 
32
 
33
 // GetMarketingList 获取活动列表
33
 // GetMarketingList 获取活动列表
34
-func (s *MarketingServ) GetMarketingList(page int, pageSize int) (map[string]interface{}, error) {
34
+func (s *MarketingServ) GetMarketingList(caseids string, page int, pageSize int) (map[string]interface{}, error) {
35
 
35
 
36
 	if pageSize == 0 {
36
 	if pageSize == 0 {
37
 		pageSize = service.PAGENUM
37
 		pageSize = service.PAGENUM
40
 		page = 1
40
 		page = 1
41
 	}
41
 	}
42
 
42
 
43
-	list, err := s.dao.GetMarketingList(page, pageSize)
43
+	list, err := s.dao.GetMarketingList(caseids, page, pageSize)
44
 	if err != nil {
44
 	if err != nil {
45
 		beego.Error(err)
45
 		beego.Error(err)
46
 		return nil, err
46
 		return nil, err
47
 	}
47
 	}
48
 
48
 
49
-	total, err := s.dao.GetMarketingCount()
49
+	total, err := s.dao.GetMarketingCount(caseids)
50
 
50
 
51
 	return map[string]interface{}{
51
 	return map[string]interface{}{
52
 		"list":     list,
52
 		"list":     list,