|
|
@@ -0,0 +1,56 @@ |
|
|
|
package implement |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.fnuoos.com/zhimeng/model.git/src/super/dao" |
|
|
|
"code.fnuoos.com/zhimeng/model.git/src/super/model" |
|
|
|
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
|
func NewWxOpenThirdPartyAppListDb(engine *xorm.Engine) dao.WxOpenThirdPartyAppListDao { |
|
|
|
return &WxOpenThirdPartyAppListDb{Db: engine} |
|
|
|
} |
|
|
|
|
|
|
|
type WxOpenThirdPartyAppListDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (w WxOpenThirdPartyAppListDb) GetWxOpenThirdPartyAppListByAppId(appid string) (m *model.WxOpenThirdPartyAppList, err error) { |
|
|
|
m = new(model.WxOpenThirdPartyAppList) |
|
|
|
has, err := w.Db.Where("appid =?", appid).Get(m) |
|
|
|
if err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
if has == false { |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
return m, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (w WxOpenThirdPartyAppListDb) GetWxOpenThirdPartyAppList(masterId int) (m *model.WxOpenThirdPartyAppList, err error) { |
|
|
|
m = new(model.WxOpenThirdPartyAppList) |
|
|
|
has, err := w.Db.Where("uuid =?", masterId).Get(m) |
|
|
|
if err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
if has == false { |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
return m, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (w WxOpenThirdPartyAppListDb) WxOpenThirdPartyAppListInsert(m *model.WxOpenThirdPartyAppList) (int64, error) { |
|
|
|
insertAffected, err := w.Db.InsertOne(m) |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
} |
|
|
|
return insertAffected, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (w WxOpenThirdPartyAppListDb) UpdateWxOpenThirdPartyAppList(m *model.WxOpenThirdPartyAppList, columns ...string) (int64, error) { |
|
|
|
affected, err := w.Db.Where("id =?", m.Id).Cols(columns...).Update(m) |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
} |
|
|
|
return affected, nil |
|
|
|
} |