|
|
@@ -0,0 +1,26 @@ |
|
|
|
package implement |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" |
|
|
|
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" |
|
|
|
"fmt" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
|
func NewPlatformActiveDataDb(engine *xorm.Engine) dao.PlatformActiveDataDao { |
|
|
|
return &PlatformActiveDataDb{Db: engine} |
|
|
|
} |
|
|
|
|
|
|
|
type PlatformActiveDataDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (p PlatformActiveDataDb) PlatformActiveDataGetOneByParams(params map[string]interface{}) (*model.PlatformActiveData, error) { |
|
|
|
var m model.PlatformActiveData |
|
|
|
var query = fmt.Sprintf("%s = ?", params["key"]) |
|
|
|
if has, err := p.Db.Where(query, params["value"]).Get(&m); err != nil || has == false { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
return &m, nil |
|
|
|
} |