|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+import moment from 'moment';
|
|
|
2
|
+import dataUpdateStatus from '../../model/dataUpdateStatus.js';
|
|
|
3
|
+import phonics from '../../model/phonics.js';
|
|
|
4
|
+import config from '../../config/index.js';
|
|
|
5
|
+import _ from 'lodash';
|
|
|
6
|
+import axios from 'axios';
|
|
|
7
|
+import { getBufferMemory, setBufferMemory } from '../../util/bufferMemory.js';
|
|
|
8
|
+import { Encrypt, Decrypt } from '../../util/crypto/index.js';
|
|
|
9
|
+import { stringUtils } from '../../util/stringClass.js';
|
|
|
10
|
+import WXBizDataCrypt from '../../util/WXBizDataCrypt.js';
|
|
|
11
|
+
|
|
|
12
|
+export async function PhonicsLogin(ctx) {
|
|
|
13
|
+ let param = ctx.request.body;
|
|
|
14
|
+ if (param.param) {
|
|
|
15
|
+ const paramStr = Decrypt(param.param, config.urlSecrets.aes_key, config.urlSecrets.aes_iv);
|
|
|
16
|
+ //console.log("paramStr:"+paramStr);
|
|
|
17
|
+ param = JSON.parse(paramStr);
|
|
|
18
|
+ }
|
|
|
19
|
+ const code = param.Code;
|
|
|
20
|
+ //console.log("code:"+code);
|
|
|
21
|
+ const url = `https://api.weixin.qq.com/sns/jscode2session?appid=${config.wx.phonics_appid}&secret=${config.wx.phonics_appsecret}&js_code=${code}&grant_type=authorization_code`;
|
|
|
22
|
+
|
|
|
23
|
+ let result = await axios.get(url)
|
|
|
24
|
+ .then(res => {
|
|
|
25
|
+ const json = res.data;
|
|
|
26
|
+ //console.log("json:"+json);
|
|
|
27
|
+ if (json && json.openid) {
|
|
|
28
|
+ param.OpenID = json.openid;
|
|
|
29
|
+ param.sessionKey = json.session_key;
|
|
|
30
|
+ if (json.unionid)
|
|
|
31
|
+ param.UnionID = json.unionid;
|
|
|
32
|
+ return {errcode: 10000};
|
|
|
33
|
+ }
|
|
|
34
|
+ else {
|
|
|
35
|
+ return json;
|
|
|
36
|
+ }
|
|
|
37
|
+ })
|
|
|
38
|
+ .catch(err => {
|
|
|
39
|
+ return {errcode: 101, errStr: err};
|
|
|
40
|
+ });
|
|
|
41
|
+
|
|
|
42
|
+ if (result.errcode == 10000) {
|
|
|
43
|
+ delete param.Code;
|
|
|
44
|
+ if (param.sessionKey && param.iv && param.encryptedData){
|
|
|
45
|
+ //console.log("param.sessionKey:"+param.sessionKey);
|
|
|
46
|
+ const pc = new WXBizDataCrypt(config.wx.phonics_appid, param.sessionKey);
|
|
|
47
|
+ const dataUnionID = pc.decryptData(param.encryptedData , param.iv);
|
|
|
48
|
+ //console.log(dataUnionID);
|
|
|
49
|
+ param.UnionID = dataUnionID.unionId;
|
|
|
50
|
+ }
|
|
|
51
|
+
|
|
|
52
|
+ delete param.sessionKey;
|
|
|
53
|
+ delete param.iv;
|
|
|
54
|
+ delete param.encryptedData;
|
|
|
55
|
+
|
|
|
56
|
+ //todo
|
|
|
57
|
+ //param.OpenID="o4UHq4gaNlHfdTWxgl3fTgC1mFsI";
|
|
|
58
|
+
|
|
|
59
|
+ let userList = await phonics.GetUsersInfo(param);
|
|
|
60
|
+ if (userList.length > 0) {
|
|
|
61
|
+ param.LastLoginTime = new Date();
|
|
|
62
|
+ const time1 = moment(userList[0].ProductServiceTime).format('YYYY-MM-DD HH:mm:ss');
|
|
|
63
|
+ const time3 = moment().format('YYYY-MM-DD HH:mm:ss');
|
|
|
64
|
+ if (time1 < time3)
|
|
|
65
|
+ param.IsMember = 0;
|
|
|
66
|
+
|
|
|
67
|
+ delete param.Introducer;
|
|
|
68
|
+ delete param.UserSource;
|
|
|
69
|
+ delete param.SourceID;
|
|
|
70
|
+ //console.log(param.NickName);
|
|
|
71
|
+ if (param.NickName == "陌生用户") {
|
|
|
72
|
+ delete param.NickName;
|
|
|
73
|
+ delete param.AvatarUrl;
|
|
|
74
|
+ delete param.Language;
|
|
|
75
|
+ delete param.Gender;
|
|
|
76
|
+ delete param.City;
|
|
|
77
|
+ delete param.Province;
|
|
|
78
|
+ delete param.Country;
|
|
|
79
|
+ }
|
|
|
80
|
+
|
|
|
81
|
+ await phonics.UpdateUsers(param);
|
|
|
82
|
+ userList = await phonics.GetUsersInfo(param);
|
|
|
83
|
+ }
|
|
|
84
|
+ else {
|
|
|
85
|
+ param.NickName = "陌生用户";
|
|
|
86
|
+ param.AvatarUrl = "../images/userface_default.png";
|
|
|
87
|
+ param.CreateTime = new Date();
|
|
|
88
|
+ param.LastLoginTime = param.CreateTime;
|
|
|
89
|
+ param.ProductServiceTime = param.CreateTime;
|
|
|
90
|
+ const inseredID = await phonics.AddUsers(param);
|
|
|
91
|
+ userList = await phonics.GetUsersInfo(param);
|
|
|
92
|
+ }
|
|
|
93
|
+
|
|
|
94
|
+ delete userList[0].OpenID;
|
|
|
95
|
+ delete userList[0].UnionID;
|
|
|
96
|
+
|
|
|
97
|
+ result = {errcode: 10000, result: userList[0]};
|
|
|
98
|
+ }
|
|
|
99
|
+
|
|
|
100
|
+ ctx.body = result;
|
|
|
101
|
+}
|
|
|
102
|
+
|
|
|
103
|
+//新增自然拼读记录
|
|
|
104
|
+export async function AddPhonicsRecord(ctx) {
|
|
|
105
|
+ const param = ctx.request.body;
|
|
|
106
|
+ const inseredID = await phonics.AddPhonicsRecord(param);
|
|
|
107
|
+
|
|
|
108
|
+ ctx.body = {errcode: 10000, result: inseredID};
|
|
|
109
|
+}
|
|
|
110
|
+
|
|
|
111
|
+//更新自然拼读记录
|
|
|
112
|
+export async function UpdatePhonicsRecord(ctx) {
|
|
|
113
|
+ const param = ctx.request.body;
|
|
|
114
|
+ if (param.Content) {
|
|
|
115
|
+ param.Content = param.Content.replace(",undefined", "");
|
|
|
116
|
+ }
|
|
|
117
|
+ await phonics.UpdatePhonicsRecord(param);
|
|
|
118
|
+ ctx.body = {errcode: 10000};
|
|
|
119
|
+}
|
|
|
120
|
+
|
|
|
121
|
+//得到用户记录
|
|
|
122
|
+export async function GetPhonicsRecordData(ctx) {
|
|
|
123
|
+ const param = {
|
|
|
124
|
+ UserID: ctx.query.UserID || 0,
|
|
|
125
|
+ Version: ctx.query.Version || "1.0.0",
|
|
|
126
|
+ };
|
|
|
127
|
+ if (param.UserID === "undefined")
|
|
|
128
|
+ param.UserID = 0;
|
|
|
129
|
+
|
|
|
130
|
+ const result = await phonics.GetPhonicsRecordData(param);
|
|
|
131
|
+
|
|
|
132
|
+ if (param.UserID > 0 && result && result.length > 0) {
|
|
|
133
|
+ const userList = await phonics.GetUsersInfoByUserID(param);
|
|
|
134
|
+
|
|
|
135
|
+ //是否是首日
|
|
|
136
|
+ const timeCreateTime = moment(userList[0].CreateTime).format('YYYYMMDD');
|
|
|
137
|
+ const timeToday = moment().format('YYYYMMDD');
|
|
|
138
|
+ result[0].IsFirstDay = timeCreateTime === timeToday;
|
|
|
139
|
+
|
|
|
140
|
+ //得到分享新增用户数
|
|
|
141
|
+ let productServiceTime = moment(userList[0].ProductServiceTime).format('YYYYMMDD');
|
|
|
142
|
+ if (productServiceTime === "20991231") {
|
|
|
143
|
+ result[0].NewUserNumber = 999999;
|
|
|
144
|
+ } else {
|
|
|
145
|
+ const newUserNumber = await phonics.GetNewUserByUserID(param);
|
|
|
146
|
+ if (newUserNumber) {
|
|
|
147
|
+ result[0].NewUserNumber = newUserNumber.length;
|
|
|
148
|
+ //console.log("userList[0].ActivityTime:"+userList[0].ActivityTime);
|
|
|
149
|
+
|
|
|
150
|
+ productServiceTime = moment(userList[0].ProductServiceTime).format('YYYYMMDD');
|
|
|
151
|
+ const currentTime = moment().format('YYYYMMDD');
|
|
|
152
|
+
|
|
|
153
|
+ //如果推荐用户数超过6个,就改为增加3个月
|
|
|
154
|
+ if (newUserNumber.length >= 6 && !userList[0].ActivityTime && productServiceTime >= currentTime) {
|
|
|
155
|
+ const obj = {
|
|
|
156
|
+ ActivityTime: moment().format('YYYY-MM-DD HH:mm:ss'),
|
|
|
157
|
+ ProductServiceTime: moment(userList[0].ProductServiceTime).add(1, 'months').format('YYYY-MM-DD HH:mm:ss'),
|
|
|
158
|
+ OpenID: userList[0].OpenID,
|
|
|
159
|
+ };
|
|
|
160
|
+ await phonics.UpdateUsers(obj);
|
|
|
161
|
+ result[0].NewUserNumber = 999999;
|
|
|
162
|
+ }
|
|
|
163
|
+ }
|
|
|
164
|
+ }
|
|
|
165
|
+
|
|
|
166
|
+ result[0].IsMember = userList[0].IsMember;
|
|
|
167
|
+
|
|
|
168
|
+ if (productServiceTime < timeToday)
|
|
|
169
|
+ result[0].IsMember = 0;
|
|
|
170
|
+
|
|
|
171
|
+ const result2 = await phonics.GetPhonicsFinishedDataCount(param);
|
|
|
172
|
+
|
|
|
173
|
+ if (result2)
|
|
|
174
|
+ result[0].FinishedCount = result2[0].count;
|
|
|
175
|
+
|
|
|
176
|
+ const list2 = await phonics.GetPhonicsReviewList(param);
|
|
|
177
|
+ if (list2)
|
|
|
178
|
+ result[0].ReviewList = list2;
|
|
|
179
|
+
|
|
|
180
|
+ result[0].TestScoreMax = 0;
|
|
|
181
|
+ const list3 = await phonics.GetPhonicsTestScoreMax(param);
|
|
|
182
|
+ if (list3 && list3.length > 0)
|
|
|
183
|
+ result[0].TestScoreMax = list3[0].Score;
|
|
|
184
|
+
|
|
|
185
|
+ const param2 = {
|
|
|
186
|
+ ProgramID: 99,
|
|
|
187
|
+ Version: param.Version,
|
|
|
188
|
+ };
|
|
|
189
|
+ const result3 = await dataUpdateStatus.GetProductVersionList(param2);
|
|
|
190
|
+ if (result3) {
|
|
|
191
|
+ if ((param.Version === result3[0].Version && result3[0].IsShowPay <= 0)
|
|
|
192
|
+ || param.Version > result3[0].Version) {
|
|
|
193
|
+ result[0].IsShow = result3[0].IsShowPay;
|
|
|
194
|
+ } else {
|
|
|
195
|
+ result[0].IsShow = 1;
|
|
|
196
|
+ }
|
|
|
197
|
+
|
|
|
198
|
+ //针对iphone测试用户,永远是无支付状态
|
|
|
199
|
+ if (userList[0].Brand === 'iPhone' && userList[0].WXLanguage === 'en-US'
|
|
|
200
|
+ && userList[0].UserSource === '1001' && userList[0].IsPay === 0) {
|
|
|
201
|
+ result[0].IsShow = 0;
|
|
|
202
|
+ }
|
|
|
203
|
+ }
|
|
|
204
|
+
|
|
|
205
|
+ ctx.body = {"errcode": 10000, result: result[0]};
|
|
|
206
|
+ } else
|
|
|
207
|
+ ctx.body = {"errcode": 10000};
|
|
|
208
|
+}
|
|
|
209
|
+
|
|
|
210
|
+//得到文章列表
|
|
|
211
|
+export async function GetArticles(ctx) {
|
|
|
212
|
+ const param = {
|
|
|
213
|
+ IsAll: ctx.query.IsAll || 0,
|
|
|
214
|
+ };
|
|
|
215
|
+ const result = await phonics.GetArticles(param);
|
|
|
216
|
+ if (result && result.length > 0) {
|
|
|
217
|
+ for (let i = 0; i < result.length; i++) {
|
|
|
218
|
+ result[i].IsLocked = false;
|
|
|
219
|
+ if (i > 2)
|
|
|
220
|
+ result[i].IsLocked = true;
|
|
|
221
|
+ }
|
|
|
222
|
+ ctx.body = {"errcode": 10000, result: result};
|
|
|
223
|
+ }
|
|
|
224
|
+ else
|
|
|
225
|
+ ctx.body = {"errcode": 10000};
|
|
|
226
|
+}
|
|
|
227
|
+
|
|
|
228
|
+//得到文章信息
|
|
|
229
|
+export async function GetArticleInfo(ctx) {
|
|
|
230
|
+ const param = {
|
|
|
231
|
+ ID: ctx.query.ID || 0,
|
|
|
232
|
+ UserID: ctx.query.UserID || 0,
|
|
|
233
|
+ };
|
|
|
234
|
+ if (param.UserID === "undefined")
|
|
|
235
|
+ param.UserID = 0;
|
|
|
236
|
+
|
|
|
237
|
+ const result = await phonics.GetArticles(param);
|
|
|
238
|
+ if (result && result.length > 0) {
|
|
|
239
|
+ const info = result[0];
|
|
|
240
|
+ info.Content = stringUtils.ReplaceAllString(info.Content, "\r", " ");
|
|
|
241
|
+ info.Content = stringUtils.ReplaceAllString(info.Content, "\n", " ");
|
|
|
242
|
+ //info.Content = stringUtils.ReplaceAllString(info.Content,".\"",".\" ");
|
|
|
243
|
+ ctx.body = {"errcode": 10000, result: info};
|
|
|
244
|
+ }
|
|
|
245
|
+ else
|
|
|
246
|
+ ctx.body = {"errcode": 10000};
|
|
|
247
|
+}
|
|
|
248
|
+
|
|
|
249
|
+//新增或删除自然拼读完成结果
|
|
|
250
|
+export async function UpdatePhonicsFinished(ctx) {
|
|
|
251
|
+ const param = ctx.request.body;
|
|
|
252
|
+ if (param.Style === "undefined")
|
|
|
253
|
+ param.Style = "";
|
|
|
254
|
+ if (param.IsFinished) {
|
|
|
255
|
+ delete param.IsFinished;
|
|
|
256
|
+ if (param.UserID && param.Title) {
|
|
|
257
|
+ if (param.Category === "basic" || param.Category === "intermediate")
|
|
|
258
|
+ param.Category = "all";
|
|
|
259
|
+ await phonics.AddPhonicsFinished(param);
|
|
|
260
|
+ }
|
|
|
261
|
+ }
|
|
|
262
|
+ else {
|
|
|
263
|
+ delete param.IsFinished;
|
|
|
264
|
+ if (param.UserID) {
|
|
|
265
|
+ await phonics.DeletePhonicsFinished(param);
|
|
|
266
|
+ }
|
|
|
267
|
+ }
|
|
|
268
|
+ ctx.body = {errcode: 10000};
|
|
|
269
|
+}
|
|
|
270
|
+
|
|
|
271
|
+//得到用户完成记录
|
|
|
272
|
+export async function GetPhonicsFinishedData(ctx) {
|
|
|
273
|
+ const param = {
|
|
|
274
|
+ UserID: ctx.query.UserID || 0,
|
|
|
275
|
+ Category: ctx.query.Category || 0,
|
|
|
276
|
+ };
|
|
|
277
|
+ if (param.UserID === "undefined")
|
|
|
278
|
+ param.UserID = 0;
|
|
|
279
|
+
|
|
|
280
|
+ if (param.Category === "basic" || param.Category === "intermediate")
|
|
|
281
|
+ param.Category = "all";
|
|
|
282
|
+ const result = await phonics.GetPhonicsFinishedData(param);
|
|
|
283
|
+ if (result && result.length > 0)
|
|
|
284
|
+ ctx.body = {"errcode": 10000, result: result};
|
|
|
285
|
+ else
|
|
|
286
|
+ ctx.body = {"errcode": 10000};
|
|
|
287
|
+}
|
|
|
288
|
+
|
|
|
289
|
+//得到全部自然拼读数据
|
|
|
290
|
+export async function GetPhonicsAll(ctx) {
|
|
|
291
|
+ const param = {
|
|
|
292
|
+ UpdateTime: ctx.query.UpdateTime,
|
|
|
293
|
+ };
|
|
|
294
|
+
|
|
|
295
|
+ const updateTimeList = await dataUpdateStatus.GetDataUpdateStatus();
|
|
|
296
|
+ const updateTime = moment(updateTimeList[4].UpdateTime).format('YYYY.MM.DD HH:mm:ss');
|
|
|
297
|
+ //console.log(updateTime);
|
|
|
298
|
+ if (param.UpdateTime != updateTime) {
|
|
|
299
|
+ let result = getBufferMemory("GetPhonicsAll");
|
|
|
300
|
+ if (result == 0) {
|
|
|
301
|
+ //const arr = phonics.GetPhonicsAll();
|
|
|
302
|
+ //for (let i = 0; i < arr.length; i++) {
|
|
|
303
|
+ // const item = arr[i];
|
|
|
304
|
+ // item.Style=item.Soundmark;
|
|
|
305
|
+ //}
|
|
|
306
|
+
|
|
|
307
|
+ const arrTemp = await phonics.GetPhonicsAllSql();
|
|
|
308
|
+ const arr = [];
|
|
|
309
|
+ let temp;
|
|
|
310
|
+ const cards = [];
|
|
|
311
|
+ for (let i = 0; i < arrTemp.length; i++) {
|
|
|
312
|
+ const item = arrTemp[i];
|
|
|
313
|
+ if (i > 0 && ((temp.Title + temp.Soundmark) != (item.Title + item.Soundmark) || i == arrTemp.length - 1)) {
|
|
|
314
|
+ const islocked = temp.IsLocked == 1;
|
|
|
315
|
+
|
|
|
316
|
+ if (i == arrTemp.length - 1)
|
|
|
317
|
+ cards.push(item.Word);
|
|
|
318
|
+
|
|
|
319
|
+ const obj = {
|
|
|
320
|
+ "Title": temp.Title,
|
|
|
321
|
+ "Category": temp.Category,
|
|
|
322
|
+ "Category2": temp.Category2,
|
|
|
323
|
+ "Soundmark": temp.Soundmark,
|
|
|
324
|
+ "Style": temp.Soundmark,
|
|
|
325
|
+ "Example": temp.Example,
|
|
|
326
|
+ "IsLocked": islocked,
|
|
|
327
|
+ "Level": temp.Level,
|
|
|
328
|
+ "Cards": cards,
|
|
|
329
|
+ }
|
|
|
330
|
+ arr.push(obj);
|
|
|
331
|
+ cards.length = 0;
|
|
|
332
|
+ }
|
|
|
333
|
+ cards.push(item.Word);
|
|
|
334
|
+ temp = item;
|
|
|
335
|
+ }
|
|
|
336
|
+
|
|
|
337
|
+ result = JSON.stringify(arr);
|
|
|
338
|
+ result = Encrypt(result, config.urlSecrets.aes_key, config.urlSecrets.aes_iv);
|
|
|
339
|
+
|
|
|
340
|
+ setBufferMemory("GetPhonicsAll", result, config.BufferMemoryTimeHigh);
|
|
|
341
|
+ console.log("缓存");
|
|
|
342
|
+ }
|
|
|
343
|
+
|
|
|
344
|
+ const obj = {
|
|
|
345
|
+ List: result,
|
|
|
346
|
+ UpdateTime: updateTime
|
|
|
347
|
+ }
|
|
|
348
|
+
|
|
|
349
|
+ ctx.body = {"errcode": 10000, result: obj};
|
|
|
350
|
+ }
|
|
|
351
|
+ else {
|
|
|
352
|
+ ctx.body = {"errcode": 10000};
|
|
|
353
|
+ }
|
|
|
354
|
+}
|
|
|
355
|
+
|
|
|
356
|
+//新增自然拼读复习记录
|
|
|
357
|
+export async function UpdatePhonicsReview(ctx) {
|
|
|
358
|
+ const param = ctx.request.body;
|
|
|
359
|
+ if (param.Status === "add") {
|
|
|
360
|
+ delete param.Status;
|
|
|
361
|
+ if (param.UserID && param.Word) {
|
|
|
362
|
+ await phonics.AddPhonicsReview(param);
|
|
|
363
|
+ }
|
|
|
364
|
+ }
|
|
|
365
|
+ else if (param.Status === "delete") {
|
|
|
366
|
+ delete param.Status;
|
|
|
367
|
+ if (param.UserID && param.Word) {
|
|
|
368
|
+ await phonics.DeletePhonicsReview(param);
|
|
|
369
|
+ }
|
|
|
370
|
+ }
|
|
|
371
|
+
|
|
|
372
|
+ ctx.body = {errcode: 10000};
|
|
|
373
|
+}
|
|
|
374
|
+
|
|
|
375
|
+//得到用户完成记录
|
|
|
376
|
+export async function GetPhonicsReviewList(ctx) {
|
|
|
377
|
+ const param = {
|
|
|
378
|
+ UserID: ctx.query.UserID || 0,
|
|
|
379
|
+ };
|
|
|
380
|
+ if (param.UserID === "undefined")
|
|
|
381
|
+ param.UserID = 0;
|
|
|
382
|
+
|
|
|
383
|
+ const result = await phonics.GetPhonicsReviewList(param);
|
|
|
384
|
+ if (result && result.length > 0)
|
|
|
385
|
+ ctx.body = {"errcode": 10000, result: result};
|
|
|
386
|
+ else
|
|
|
387
|
+ ctx.body = {"errcode": 10000, result: []};
|
|
|
388
|
+}
|
|
|
389
|
+
|
|
|
390
|
+//新增自然拼读测试得分记录
|
|
|
391
|
+export async function AddPhonicsTestScore(ctx) {
|
|
|
392
|
+ const param = {
|
|
|
393
|
+ UserID: ctx.query.UserID || 0,
|
|
|
394
|
+ Score: ctx.query.Score,
|
|
|
395
|
+ };
|
|
|
396
|
+ if (param.UserID === "undefined")
|
|
|
397
|
+ param.UserID = 0;
|
|
|
398
|
+
|
|
|
399
|
+ let result = {
|
|
|
400
|
+ MaxScore: param.Score,
|
|
|
401
|
+ IsRecord: 1,
|
|
|
402
|
+ };
|
|
|
403
|
+
|
|
|
404
|
+ const inseredID = await phonics.AddPhonicsTestScore(param);
|
|
|
405
|
+ let param2;
|
|
|
406
|
+
|
|
|
407
|
+ const list = await phonics.GetPhonicsTestScoreMax(param);
|
|
|
408
|
+ if (list && list.length > 0) {
|
|
|
409
|
+ if (list[0].Score < Number(param.Score)) {
|
|
|
410
|
+ param2 = {
|
|
|
411
|
+ ID: list[0].ID,
|
|
|
412
|
+ IsMax: 0,
|
|
|
413
|
+ };
|
|
|
414
|
+ await phonics.UpdatePhonicsTestScore(param2);
|
|
|
415
|
+ param2 = {
|
|
|
416
|
+ ID: inseredID.insertId,
|
|
|
417
|
+ IsMax: 1,
|
|
|
418
|
+ }
|
|
|
419
|
+ await phonics.UpdatePhonicsTestScore(param2);
|
|
|
420
|
+ }
|
|
|
421
|
+ else {
|
|
|
422
|
+ result = {
|
|
|
423
|
+ MaxScore: list[0].Score,
|
|
|
424
|
+ IsRecord: 0,
|
|
|
425
|
+ }
|
|
|
426
|
+ }
|
|
|
427
|
+ }
|
|
|
428
|
+ else {
|
|
|
429
|
+ param2 = {
|
|
|
430
|
+ ID: inseredID.insertId,
|
|
|
431
|
+ IsMax: 1,
|
|
|
432
|
+ }
|
|
|
433
|
+ await phonics.UpdatePhonicsTestScore(param2);
|
|
|
434
|
+ }
|
|
|
435
|
+
|
|
|
436
|
+ ctx.body = {errcode: 10000, result: result};
|
|
|
437
|
+}
|