-
Notifications
You must be signed in to change notification settings - Fork 1
/
level.go
31 lines (26 loc) · 1019 Bytes
/
level.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package customer
import (
"fmt"
"github.com/webx-top/db"
"github.com/webx-top/db/lib/factory"
"github.com/admpub/nging/v5/application/library/fileupdater/listener"
"github.com/admpub/webx/application/dbschema"
)
func init() {
// - official_customer_level
listener.New(func(m factory.Model) (tableID string, content string, property *listener.Property) {
fm := m.(*dbschema.OfficialCustomerLevel)
tableID = fmt.Sprint(fm.Id)
content = fm.IconImage
property = listener.NewPropertyWith(fm, db.Cond{`id`: fm.Id})
return
}, false).SetTable(`official_customer_level`, `icon_image`).ListenDefault()
// - official_customer_group_package
listener.New(func(m factory.Model) (tableID string, content string, property *listener.Property) {
fm := m.(*dbschema.OfficialCustomerGroupPackage)
tableID = fmt.Sprint(fm.Id)
content = fm.IconImage
property = listener.NewPropertyWith(fm, db.Cond{`id`: fm.Id})
return
}, false).SetTable(`official_customer_group_package`, `icon_image`).ListenDefault()
}