|
|
@@ -0,0 +1,28 @@ |
|
|
|
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" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
|
func NewPlayletTotalDb(engine *xorm.Engine) dao.PlayletTotalDao { |
|
|
|
return &PlayletTotalDb{Db: engine} |
|
|
|
} |
|
|
|
|
|
|
|
type PlayletTotalDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (p PlayletTotalDb) GetPlayletTotal(uid, date string) (m *model.PlayletTotal, err error) { |
|
|
|
m = new(model.PlayletTotal) |
|
|
|
has, err := p.Db.Where("uid=? and date=?", uid, date).Get(m) |
|
|
|
if err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
if has == false { |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
return m, nil |
|
|
|
} |