1 | View Code Duplication | const DB = require('../../libraries/db') |
|
0 ignored issues
–
show
Duplication
introduced
by
![]() |
|||
2 | const ModelBase = require('../../model/base') |
||
3 | |||
4 | const table = 'mist_seller' |
||
5 | |||
6 | module.exports = { |
||
7 | add: async function (data) { |
||
8 | let res = ModelBase.execInsert(table, data) |
||
9 | return await res; |
||
10 | }, |
||
11 | |||
12 | list: async function (kid) { |
||
13 | |||
14 | let result = DB.readMysql.select( |
||
15 | '*' |
||
16 | ) |
||
17 | .from(table) |
||
18 | .where('kid', kid) |
||
19 | .where('status', '!=', -1) |
||
20 | |||
21 | return await result |
||
22 | |||
23 | }, |
||
24 | |||
25 | first: async function (id) { |
||
26 | |||
27 | let result = DB.readMysql.first( |
||
28 | '*' |
||
29 | ) |
||
30 | .from(table) |
||
31 | .where('seller_id', id) |
||
32 | |||
33 | return await result |
||
34 | |||
35 | }, |
||
36 | |||
37 | edit: async function (data, where, notWhere = {}) { |
||
38 | let result = ModelBase.execUpdate(table, data, where, notWhere) |
||
39 | |||
40 | return await result |
||
41 | } |
||
42 | |||
43 | } |
||
44 |