upgrade_item.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package models
  2. import (
  3. _ "image/gif"
  4. _ "image/jpeg"
  5. _ "image/png"
  6. "zhiyuan/pkg/db"
  7. "github.com/gin-gonic/gin"
  8. )
  9. type UpgradeItem struct {
  10. ID int64 `json:"id" prop:"add:false"`
  11. PkgId int64 `json:"pkgid" type:"int" prop:"add" search:"="`
  12. Name string `json:"name" label:"名称" type:"string" prop:"edit" search:"like"`
  13. ControlPrice float64 `json:"control_price" label:"控价" type:"float" prop:"edit"`
  14. UpgradeControlPrice float64 `json:"upgrade_control_price" label:"升级控价" type:"float" prop:"edit"`
  15. Coefficient float64 `json:"coefficient" label:"免费系数" type:"float" prop:"edit"`
  16. LossCoefficient float64 `json:"loss_coefficient" label:"免费系数" type:"float" prop:"edit"`
  17. State int64 `json:"state" label:"状态" type:"int" prop:"add:false edit" default:"0" search:"="`
  18. DeletedAt int64 `json:"deleted_at" prop:"add:false select:false"`
  19. CreatedAt int64 `json:"created_at" prop:"add:false"`
  20. UpdatedAt int64 `json:"updated_at" prop:"add:false"`
  21. db.BaseModel
  22. }
  23. func (UpgradeItem) TableName() string {
  24. return "zy_upgrade_item"
  25. }
  26. func (model UpgradeItem) ListPrivilege(c *gin.Context, data map[string]interface{}, s *db.Select) bool {
  27. return true
  28. }
  29. func (model UpgradeItem) ListAfter(c *gin.Context, data map[string]interface{}, list []map[string]interface{}) []map[string]interface{} {
  30. return list
  31. }
  32. func (UpgradeItem) OnePrivilege(c *gin.Context, id int64) bool {
  33. return true
  34. }
  35. func (UpgradeItem) AddPrivilege(c *gin.Context, data map[string]interface{}, post map[string]interface{}) error {
  36. return nil
  37. }
  38. func (UpgradeItem) AddAfter(c *gin.Context, id int64, post map[string]interface{}, data map[string]interface{}) {
  39. }
  40. func (UpgradeItem) EditPrivilege(c *gin.Context, id int64, data map[string]interface{}, post map[string]interface{}) error {
  41. return nil
  42. }
  43. func (UpgradeItem) DelPrivilege(c *gin.Context, id int64) error {
  44. return nil
  45. }
  46. func (UpgradeItem) Page() bool {
  47. return false
  48. }
  49. func (UpgradeItem) Count() bool {
  50. return true
  51. }