final_supplier_punish_deduction.go 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. package final
  2. import (
  3. "fmt"
  4. "zhiyuan/pkg/db"
  5. "github.com/gin-gonic/gin"
  6. )
  7. type FinalSupplierPunishDeduction struct {
  8. ID int64 `json:"id" prop:"add:false"`
  9. SupplierId int64 `json:"supplierId" label:"材料商ID" type:"int" prop:"add" search:"="`
  10. PunishId int64 `json:"punishId" label:"处罚ID" type:"int" prop:"add" search:"="`
  11. SettleId int64 `json:"settleId" label:"结算ID" type:"int" prop:"add" search:"="`
  12. Amount float64 `json:"amount" label:"金额" type:"float" prop:"add" default:"0" search:"="`
  13. DeletedAt int64 `json:"deleted_at" prop:"add:false select:false"`
  14. CreatedAt int64 `json:"created_at" prop:"add:false"`
  15. UpdatedAt int64 `json:"updated_at" prop:"add:false"`
  16. db.BaseModel
  17. }
  18. func (FinalSupplierPunishDeduction) TableName() string {
  19. return "zy_final_supplier_punish_deduction"
  20. }
  21. func (FinalSupplierPunishDeduction) ListPrivilege(c *gin.Context, data map[string]interface{}, s *db.Select) bool {
  22. return true
  23. }
  24. func (FinalSupplierPunishDeduction) OnePrivilege(c *gin.Context, id int64) bool {
  25. return true
  26. }
  27. func (FinalSupplierPunishDeduction) AddPrivilege(c *gin.Context, data map[string]interface{}, post map[string]interface{}) error {
  28. return nil
  29. }
  30. func (FinalSupplierPunishDeduction) EditPrivilege(c *gin.Context, id int64, data map[string]interface{}, post map[string]interface{}) error {
  31. return nil
  32. }
  33. func (FinalSupplierPunishDeduction) DelPrivilege(c *gin.Context, id int64) error {
  34. return nil
  35. }
  36. func (FinalSupplierPunishDeduction) Page() bool {
  37. return false
  38. }
  39. func (FinalSupplierPunishDeduction) Count() bool {
  40. return true
  41. }
  42. func (FinalSupplierPunishDeduction) LeftJoin(data map[string]interface{}, s *db.Select) []db.JoinModel {
  43. return []db.JoinModel{}
  44. }
  45. type FinalSupplierPunishDeductionMobile struct {
  46. Explain string `json:"explain" type:"string" prop:"select:punish.explain"`
  47. FinalSupplierPunishDeduction
  48. }
  49. func (model FinalSupplierPunishDeductionMobile) GroupBy() string {
  50. return fmt.Sprintf("`%s`.`id`", model.TableName())
  51. }
  52. func (model FinalSupplierPunishDeductionMobile) ListPrivilege(c *gin.Context, data map[string]interface{}, s *db.Select) bool {
  53. return model.FinalSupplierPunishDeduction.ListPrivilege(c, data, s)
  54. }
  55. func (model FinalSupplierPunishDeductionMobile) LeftJoin(data map[string]interface{}, s *db.Select) []db.JoinModel {
  56. return append(model.FinalSupplierPunishDeduction.LeftJoin(data, s), db.JoinModel{
  57. Model: FinalSupplierPunish{},
  58. As: "punish",
  59. On: []string{
  60. fmt.Sprintf("`punish`.`id` = `%s`.`punishId`", model.TableName()),
  61. },
  62. })
  63. }