(pid, status)
| 21 | } |
| 22 | |
| 23 | async handleListClass(pid, status) { |
| 24 | let result = await this.catModel.list(pid), |
| 25 | newResult = []; |
| 26 | for (let i = 0, item, list; i < result.length; i++) { |
| 27 | item = result[i].toObject(); |
| 28 | list = await this.interModel.listByInterStatus(item._id, status); |
| 29 | list = list.sort((a, b) => { |
| 30 | return a.index - b.index; |
| 31 | }); |
| 32 | if (list.length > 0) { |
| 33 | item.list = list; |
| 34 | newResult.push(item); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | return newResult; |
| 39 | } |
| 40 | |
| 41 | handleExistId(data) { |
| 42 | function delArrId(arr, fn) { |
no test coverage detected