|
@@ -1,7 +1,9 @@ |
|
|
package implement |
|
|
|
|
|
|
|
|
package implement |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" |
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/dao" |
|
|
|
|
|
"code.fnuoos.com/go_rely_warehouse/zyos_model.git/src/models" |
|
|
|
|
|
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_model.git/utils/logx" |
|
|
"xorm.io/xorm" |
|
|
"xorm.io/xorm" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
@@ -12,3 +14,26 @@ type HoneyDividendBasicDb struct { |
|
|
func NewHoneyDividendBasicDb(engine *xorm.Engine) dao.HoneyDividendBasicDao { |
|
|
func NewHoneyDividendBasicDb(engine *xorm.Engine) dao.HoneyDividendBasicDao { |
|
|
return &HoneyDividendBasicDb{Db: engine} |
|
|
return &HoneyDividendBasicDb{Db: engine} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (i HoneyDividendBasicDb) GetHoneyDividendBasicByCoinIdSess(sess *xorm.Session, coinId int) (m *models.HoneyDividendBasic, err error) { |
|
|
|
|
|
m = new(models.HoneyDividendBasic) |
|
|
|
|
|
has, err := sess.Where("coin_id =?", coinId).Get(m) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
|
|
} |
|
|
|
|
|
if has == false { |
|
|
|
|
|
return nil, nil |
|
|
|
|
|
} |
|
|
|
|
|
return m, nil |
|
|
|
|
|
} |
|
|
|
|
|
func (i HoneyDividendBasicDb) GetHoneyDividendBasicByCoinId(coinId int) (m *models.HoneyDividendBasic, err error) { |
|
|
|
|
|
m = new(models.HoneyDividendBasic) |
|
|
|
|
|
has, err := i.Db.Where("coin_id =?", coinId).Get(m) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
|
|
} |
|
|
|
|
|
if has == false { |
|
|
|
|
|
return nil, nil |
|
|
|
|
|
} |
|
|
|
|
|
return m, nil |
|
|
|
|
|
} |