瀏覽代碼

update

master
shenjiachi 6 小時之前
父節點
當前提交
20bf9e0d7f
共有 2 個檔案被更改,包括 10 行新增0 行删除
  1. +1
    -0
      src/dao/egg_energy_available_energy_flow_dao.go
  2. +9
    -0
      src/implement/egg_energy_available_energy_flow_implement.go

+ 1
- 0
src/dao/egg_energy_available_energy_flow_dao.go 查看文件

@@ -8,4 +8,5 @@ import (
type EggEnergyAvailableEnergyFlowDao interface {
EggEnergyAvailableEnergyFlowFindAndCount(kind, page, pageSize int, startAt, endAt string) ([]*model.EggEnergyAvailableEnergyFlow, int64, error)
EggEnergyAvailableEnergyFlowInsertBySession(session *xorm.Session, eggEnergyAvailableEnergyFlow *model.EggEnergyAvailableEnergyFlow) (int64, error)
EggEnergyAvailableEnergyFlowGetSumByKind(kind int) (float64, error)
}

+ 9
- 0
src/implement/egg_energy_available_energy_flow_implement.go 查看文件

@@ -41,3 +41,12 @@ func (e EggEnergyAvailableEnergyFlowDb) EggEnergyAvailableEnergyFlowFindAndCount
}
return m, total, nil
}

func (e EggEnergyAvailableEnergyFlowDb) EggEnergyAvailableEnergyFlowGetSumByKind(kind int) (float64, error) {
var m model.EggEnergyAvailableEnergyFlow
sum, err := e.Db.Where("kind = ?", kind).Sum(m, "amount")
if err != nil {
return 0, zhios_order_relate_logx.Error(err.Error())
}
return sum, nil
}

Loading…
取消
儲存