胡轶钦 6 年 前
コミット
feb0083b12
共有6 個のファイルを変更した62 個の追加19 個の削除を含む
  1. 0
    5
      conf/app.conf
  2. 2
    2
      conf/db.conf
  3. 1
    1
      conf/log.conf
  4. 40
    0
      log/common.log
  5. 10
    10
      models/luckdrawlist/luckdrawlist.go
  6. 9
    1
      service/luckdrawlist/luckdrawlist.go

+ 0
- 5
conf/app.conf ファイルの表示

@@ -29,8 +29,3 @@ guest = "/guest/:org"
29 29
 common = "/common/:org"
30 30
 wechat = "/wechat/:org"
31 31
 
32
-
33
-postwechatInfo = http://testapi.chioy.com.cn/api/network/postwechatInfo
34
-qrcodePrefix = bodycheck_
35
-followText = 您正在使用悦琦设备进行体检~
36
-resultURL = http://dev.ycjcjy.com/bodyCheck

+ 2
- 2
conf/db.conf ファイルの表示

@@ -5,8 +5,8 @@ db_type      = mysql
5 5
 con_protocol = tcp
6 6
 
7 7
 ; 数据库地址,可以使用IP
8
-# db_addr      = 192.168.0.122
9
-db_addr      = localhost
8
+db_addr      = 192.168.0.122
9
+# db_addr      = localhost
10 10
 
11 11
 ; 端口
12 12
 db_port      = 3306

+ 1
- 1
conf/log.conf ファイルの表示

@@ -1,4 +1,4 @@
1 1
 [common]
2
-filename="E:\\GoProjects\\src\\spaceofcheng\\services\\log\\common.log"
2
+filename="E:\\GoProject\\src\\spaceofcheng\\services\\log\\common.log"
3 3
 # log level "emergency", "alert", "critical", "error", "warning", "notice", "info", "debug"
4 4
 level="debug"

+ 40
- 0
log/common.log ファイルの表示

@@ -48,3 +48,43 @@
48 48
 2018/09/17 02:33:39.117 [E]  查询分享列表失败: Error 1054: Unknown column 'a.case_id' in 'where clause'
49 49
 2018/09/17 02:34:07.419 [E]  用户没有设置默认案场
50 50
 2018/09/17 02:34:34.271 [E]  用户没有设置默认案场
51
+2018/09/17 02:35:49 [E] 用户没有设置默认案场
52
+2018/09/17 02:35:49 [E] 用户没有设置默认案场
53
+2018/09/17 02:35:49 [E] 查询分享列表失败: Error 1054: Unknown column 'a.case_id' in 'where clause'
54
+2018/09/17 02:35:49 [E] 入库 Token 失败: Error 1364: Field 'token_id' doesn't have a default value
55
+2018/09/17 02:36:57 [E] 用户没有设置默认案场
56
+2018/09/17 02:36:57 [E] 用户没有设置默认案场
57
+2018/09/17 02:36:57 [E] 入库 Token 失败: Error 1364: Field 'token_id' doesn't have a default value
58
+2018/09/17 02:36:57 [E] 入库 Token 失败: Error 1364: Field 'token_id' doesn't have a default value
59
+2018/09/17 02:39:38 [E] 用户没有设置默认案场
60
+2018/09/17 02:39:38 [E] 用户没有设置默认案场
61
+2018/09/17 02:41:10 [E] 用户没有设置默认案场
62
+2018/09/17 02:41:10 [E] 用户没有设置默认案场
63
+2018/09/17 02:41:27 [E] 用户没有设置默认案场
64
+2018/09/17 02:41:27 [E] 用户没有设置默认案场
65
+2018/09/17 02:43:21 [E] 用户没有设置默认案场
66
+2018/09/17 02:43:21 [E] 用户没有设置默认案场
67
+2018/09/17 02:44:08 [E] 用户没有设置默认案场
68
+2018/09/17 02:44:08 [E] 用户没有设置默认案场
69
+2018/09/17 02:46:30 [E] 用户没有设置默认案场
70
+2018/09/17 02:46:30 [E] 用户没有设置默认案场
71
+2018/09/17 02:46:55 [E] 用户没有设置默认案场
72
+2018/09/17 02:46:55 [E] 用户没有设置默认案场
73
+2018/09/17 02:47:04 [E] 用户没有设置默认案场
74
+2018/09/17 02:47:07 [E] 用户没有设置默认案场
75
+2018/09/17 02:49:44 [E] 初始化微信服务失败: 未找到微信配置
76
+2018/09/17 02:50:58 [I] 请求远程接口: %!(EXTRA string=https://api.weixin.qq.com/cgi-bin/token?appid=wx7320287e057bbeee&grant_type=client_credential&secret=6e844dc2ade439545c47569ba1707673)
77
+2018/09/17 02:50:58 [I] 远程请求结果:%!(EXTRA string={"access_token":"13_0QWo4t_jFJeIQiuFrmtbkXrv6GoHX0tx6D0z5wNsqUMOI2HB2X0_BBLzEOtMhogl-_Avjp3UW8CzsumpNWkeIRUoyJ4HhKuLw8wFlryRONnZiYKU53QNm1A7Gu8QyskMXrwDryFucDH1fqhwHDWgABADZS","expires_in":7200})
78
+2018/09/17 02:50:58 [I] 接口返回结果: %!(EXTRA map[string]interface {}=map[access_token:13_0QWo4t_jFJeIQiuFrmtbkXrv6GoHX0tx6D0z5wNsqUMOI2HB2X0_BBLzEOtMhogl-_Avjp3UW8CzsumpNWkeIRUoyJ4HhKuLw8wFlryRONnZiYKU53QNm1A7Gu8QyskMXrwDryFucDH1fqhwHDWgABADZS expires_in:7200])
79
+2018/09/17 02:51:25 [I] 请求远程接口: %!(EXTRA string=https://api.weixin.qq.com/cgi-bin/token?appid=wx7320287e057bbeee&grant_type=client_credential&secret=6e844dc2ade439545c47569ba1707673)
80
+2018/09/17 02:51:25 [I] 远程请求结果:%!(EXTRA string={"access_token":"13_LyA7QKMrFnxL3JD2_aDV-XhW8rSKS8MnqL8kVcQGwiYJ554IvvwwYwN6L79l2WCfDJ9i1mC5Ntt8YvAxaEPmgn_cJicNhucWqHyDiptbQpMDrqMbtykIaLUSYab3QOwf7K_qjL9GwYPnaDf6PKUiAAAAVF","expires_in":7200})
81
+2018/09/17 02:51:25 [I] 接口返回结果: %!(EXTRA map[string]interface {}=map[access_token:13_LyA7QKMrFnxL3JD2_aDV-XhW8rSKS8MnqL8kVcQGwiYJ554IvvwwYwN6L79l2WCfDJ9i1mC5Ntt8YvAxaEPmgn_cJicNhucWqHyDiptbQpMDrqMbtykIaLUSYab3QOwf7K_qjL9GwYPnaDf6PKUiAAAAVF expires_in:7200])
82
+2018/09/17 02:51:39 [E] 解析 Token 失败: token contains an invalid number of segments
83
+2018/09/17 02:51:40 [E] 解析 Token 失败: token contains an invalid number of segments
84
+2018/09/17 02:51:55 [I] 请求远程接口: %!(EXTRA string=https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=13_LyA7QKMrFnxL3JD2_aDV-XhW8rSKS8MnqL8kVcQGwiYJ554IvvwwYwN6L79l2WCfDJ9i1mC5Ntt8YvAxaEPmgn_cJicNhucWqHyDiptbQpMDrqMbtykIaLUSYab3QOwf7K_qjL9GwYPnaDf6PKUiAAAAVF&type=jsapi)
85
+2018/09/17 02:51:55 [I] 远程请求结果:%!(EXTRA string={"errcode":0,"errmsg":"ok","ticket":"sM4AOVdWfPE4DxkXGEs8VMZIQp6O6FZIcANLNjdLwVrzQNe5RU3oH_2KJJWbdJBgNeGPyHr0QcIeBnPM9eyr6Q","expires_in":7200})
86
+2018/09/17 02:51:55 [I] 接口返回结果: %!(EXTRA map[string]interface {}=map[expires_in:7200 errcode:0 errmsg:ok ticket:sM4AOVdWfPE4DxkXGEs8VMZIQp6O6FZIcANLNjdLwVrzQNe5RU3oH_2KJJWbdJBgNeGPyHr0QcIeBnPM9eyr6Q])
87
+2018/09/17 02:59:20 [E] 不存在课程信息!
88
+2018/09/17 03:04:16 [E] 不存在课程信息!
89
+2018/09/17 03:05:37 [E] 解析 Token 失败: token contains an invalid number of segments
90
+2018/09/17 03:07:51 [E] 解析 Token 失败: token contains an invalid number of segments

+ 10
- 10
models/luckdrawlist/luckdrawlist.go ファイルの表示

@@ -62,22 +62,22 @@ FROM
62 62
 
63 63
 }
64 64
 
65
-func (m *LuckdrawDAO) GetLuckShareList(fromPhone, toPhone string, filters []string, limit []int) ([]model.TaShareLuckyRecord, int64, error) {
65
+func (m *LuckdrawDAO) GetLuckShareList(fromPhone, toPhone string, filters string, limit []int) ([]model.TaShareLuckyRecord, int64, error) {
66 66
 	var luckShare []model.TaShareLuckyRecord
67
-	filterString := ""
68
-	if len(filters) > 0 {
69
-		filterString = strings.Join(filters, " and ")
70
-		filterString += " and "
71
-	}
72
-	sql := `select * from ta_share_lucky_record where %s 1=1`
67
+	// filterString := ""
68
+	// if len(filters) > 0 {
69
+	// 	filterString = strings.Join(filters, " and ")
70
+	// 	filterString += " and "
71
+	// }
72
+	sql := `select * from ta_share_lucky_record a where ` + filters
73 73
 	if fromPhone != "" {
74
-		sql += ` and from_customer_tel = '` + fromPhone + `'`
74
+		sql += ` and a.from_customer_tel = '` + fromPhone + `'`
75 75
 	}
76 76
 	if toPhone != "" {
77
-		sql += ` and to_customer_tel = '` + toPhone + `'`
77
+		sql += ` and a.to_customer_tel = '` + toPhone + `'`
78 78
 	}
79 79
 	sql += ` order by a.create_date desc `
80
-	total, err := utils.NewPageNaviEngine(m.ctx).GetPageList(&luckShare, fmt.Sprintf(sql, filterString), limit)
80
+	total, err := utils.NewPageNaviEngine(m.ctx).GetPageList(&luckShare, sql, limit)
81 81
 	if err != nil {
82 82
 		return nil, 0, err
83 83
 	}

+ 9
- 1
service/luckdrawlist/luckdrawlist.go ファイルの表示

@@ -24,15 +24,19 @@ func NewLuckdrawlistServ(ctx *utils.Context) *LuckdrawlistServ {
24 24
 	}
25 25
 }
26 26
 func (s *LuckdrawlistServ) GetLuckShareList(caseID, fromPhone, toPhone string, pagenavi ...int) ([]model.TaShareLuckyRecord, int64, error) {
27
-	filters := []string{}
27
+	filters := ""
28 28
 	if caseID != "" {
29 29
 		if err := utils.NewAuthEngine(s.ctx).CheckCase(caseID); err != nil {
30 30
 			return nil, 0, err
31 31
 		}
32 32
 
33
+<<<<<<< HEAD
33 34
 		filters = []string{
34 35
 			"case_id='" + caseID + "'",
35 36
 		}
37
+=======
38
+		filters = "a.case_id='" + caseID + "'"
39
+>>>>>>> f643ac3515ca8d062ef23fecb4d225165f2e3b76
36 40
 	} else {
37 41
 		casesRaw := s.ctx.Get("cases")
38 42
 		if casesRaw == nil {
@@ -45,9 +49,13 @@ func (s *LuckdrawlistServ) GetLuckShareList(caseID, fromPhone, toPhone string, p
45 49
 			caseIDs = append(caseIDs, cs.CaseId)
46 50
 		}
47 51
 
52
+<<<<<<< HEAD
48 53
 		filters = []string{
49 54
 			"case_id in ('" + strings.Join(caseIDs, "','") + "')",
50 55
 		}
56
+=======
57
+		filters = "a.case_id in ('" + strings.Join(caseIDs, "','") + "')"
58
+>>>>>>> f643ac3515ca8d062ef23fecb4d225165f2e3b76
51 59
 	}
52 60
 
53 61
 	limit := utils.GetPageNaviLimit(pagenavi...)