model

package
v0.0.0-...-d4ad7b1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DelAdvert

func DelAdvert(ids []int64) int64

删除广告,返回受影响行数

func DelAreaType

func DelAreaType(ids []int64) int64

删除面积分类,返回受影响行数

func DelCarousel

func DelCarousel(ids []int64) int64

删除轮播,返回受影响行数

func DelDepartments

func DelDepartments(ids []int64) int64

删除部门,返回受影响行数

func DelEmployee

func DelEmployee(ids []int64) int64

删除员工,返回受影响行数

func DelIndustry

func DelIndustry(ids []int64) int64

删除行业类型,返回受影响行数

func DelMebus

func DelMebus(ids []int64) int64

删除菜单,返回受影响行数

func DelPayInfo

func DelPayInfo(ids []int64) int64

删除付款,返回受影响行数

func DelPayMethond

func DelPayMethond(ids []int64) int64

删除付款方式,返回受影响行数

func DelPosts

func DelPosts(ids []int64) int64

删除岗位,返回受影响行数

func DelRentType

func DelRentType(ids []int64) int64

删除面积分类,返回受影响行数

func DelRoles

func DelRoles(ids []int64) int64

删除角色,返回受影响行数

func DelStoreType

func DelStoreType(ids []int64) int64

删除店铺类型,返回受影响行数

func QueryProInfoDynamic

func QueryProInfoDynamic() (count1 int, count2 int, count3 int)

最新动态

func QueryPropertyInfoRelationAreaType

func QueryPropertyInfoRelationAreaType(ids []int64) bool

查询物业信息是否关联面积分类

func QueryPropertyInfoRelationIndustry

func QueryPropertyInfoRelationIndustry(ids []int64) bool

查询物业信息是否关联行业

func QueryPropertyInfoRelationRentType

func QueryPropertyInfoRelationRentType(ids []int64) bool

查询物业信息是否关联租金分类

func QueryPropertyInfoRelationStoreTypeID

func QueryPropertyInfoRelationStoreTypeID(ids []int64) bool

查询物业信息是否关联店铺类型

func QueryRoleByMenuID

func QueryRoleByMenuID(ids []int64) bool

查询角色是否关联菜单

func QueryUserByDepartmentID

func QueryUserByDepartmentID(ids []int64) bool

查询用户信息是否关联部门

func QueryUserByPostID

func QueryUserByPostID(ids []int64) bool

查询用户信息是否关联岗位

func QueryUserByRoleID

func QueryUserByRoleID(ids []int64) bool

查询用户信息是否关联角色

Types

type Advert struct {
	Model
	Sort           int64     `json:"sort"`                // 显示排序
	StartTime      time.Time `json:"start_time"`          // 展示开始时间
	EndTime        time.Time `json:"end_time"`            // 展示结束时间
	Hot            bool      `json:"hot"`                 // 首页最热推广
	Floor          bool      `json:"floor"`               // F楼
	Type           string    `gorm:"size:1;" json:"type"` // 信息列表推广 1-一栏四分之一图片广告 | 2-二栏四分之一图片广告 | 3-三栏重点推荐 | 4-五栏框架广告
	TypeName       string    `json:"type_name"`           // 信息列表推广 1-一栏四分之一图片广告 | 2-二栏四分之一图片广告 | 3-三栏重点推荐 | 4-五栏框架广告
	PropertyInfoID int64     `json:"property_info_id"`    // 物业ID
	Enable         bool      `json:"enable"`              // 是否已审核
}

广告

func QueryAdvert

func QueryAdvert(pageSize int, page int, args map[string]interface{}) (count int, adverts []Advert)

查询广告

func (*Advert) AddAdvert

func (a *Advert) AddAdvert() error

添加广告

func (*Advert) EditAdvertByID

func (a *Advert) EditAdvertByID(args map[string]interface{}) error

修改广告

func (*Advert) QueryAdvertByID

func (a *Advert) QueryAdvertByID() error

查询广告详情

func (*Advert) QueryAdvertByProID

func (a *Advert) QueryAdvertByProID() error

查询广告详情

type AreaType

type AreaType struct {
	Model
	MinArea float64 `json:"min_area"` // 最小面积(单位:平方米)
	MaxArea float64 `json:"max_area"` // 最大面积(单位:平方米)
}

基础数据

AreaType 面积分类

func (*AreaType) AddAreaType

func (a *AreaType) AddAreaType() error

添加面积分类

func (*AreaType) EditAreaType

func (a *AreaType) EditAreaType(args map[string]interface{}) error

修改面积分类

func (*AreaType) QueryAreaType

func (a *AreaType) QueryAreaType() (AreaTypes []AreaType)

查询面积分类

func (*AreaType) QueryAreaTypeByArea

func (a *AreaType) QueryAreaTypeByArea(area float64) error

查询面积所在分组

func (*AreaType) QueryAreaTypeByID

func (a *AreaType) QueryAreaTypeByID() error

查询面积分类详情

func (*AreaType) QueryMaxArea

func (a *AreaType) QueryMaxArea() error

查询已添加面积范围最大值

type Carousel struct {
	Model
	Url  string `json:"url"`  // 图片地址
	Link string `json:"link"` // 跳转链接
	Sort int64  `json:"sort"` // 排序 越大越靠前
}

轮播图

func QueryCarousel

func QueryCarousel(pageSize int, page int) (count int, carousels []Carousel)

查询所有轮播

func (*Carousel) AddCarousel

func (c *Carousel) AddCarousel() error

添加轮播图

func (*Carousel) EditCarousel

func (c *Carousel) EditCarousel(args map[string]interface{}) error

修改轮播

func (*Carousel) QueryCarouselByID

func (c *Carousel) QueryCarouselByID() error

轮播详情

type City

type City struct {
	Model
	Name         string `gorm:"not null;size:10;" json:"name"`          // 城市名称
	Code         string `gorm:"not null;unique;size:10;" json:"code"`   // 城市代码
	ProvinceCode string `gorm:"not null;size:10;" json:"province_code"` // 省代码
}

基础数据

City 城市

func (*City) QueryCitysByCode

func (c *City) QueryCitysByCode() error

根据城市代码查询城市

func (*City) QueryCitysByCodeAndPro

func (c *City) QueryCitysByCodeAndPro() error

根据省代码和城市代码查询城市

func (*City) QueryCitysByProvinceCode

func (c *City) QueryCitysByProvinceCode() (citys []City)

根据省代码查询城市

type Department

type Department struct {
	Model
	Name     string `gorm:"size:50;unique" json:"name"` // 部门名称
	Sort     int64  `json:"sort"`                       // 显示排序
	Leading  string `gorm:"size:50;" json:"leading"`    // 负责人
	Phone    string `gorm:"size:20;" json:"phone"`      // 联系电话
	Email    string `gorm:"size:30;" json:"email"`      // 邮箱
	Enable   bool   `json:"enable"`                     // 是否启用
	ParentID int64  `gorm:"default:0" json:"parent_id"` // 上级ID 0为最顶级
}

部门

func QueryDepartments

func QueryDepartments(pageSize int, page int, name string, enable string) (count int, departments []Department)

查询所有部门

func QueryEnableDepartments

func QueryEnableDepartments() (departments []Department)

查询已启用部门

func (*Department) AddDepartment

func (d *Department) AddDepartment() error

添加部门

func (*Department) EditDepartmentByID

func (d *Department) EditDepartmentByID(args map[string]interface{}) error

修改部门 by ID

func (*Department) QueryDepartmentByID

func (d *Department) QueryDepartmentByID() error

查看部门详情 by id

func (*Department) QueryDepartmentByNameAndParentID

func (d *Department) QueryDepartmentByNameAndParentID() error

查询上级部门下的部门详情 by name and parent_id

type District

type District struct {
	Model
	Name     string `gorm:"not null;size:10;" json:"name"`        // 区名称
	Code     string `gorm:"not null;unique;size:10;" json:"code"` // 区代码
	CityCode string `gorm:"not null;size:10;" json:"city_code"`   // 城市代码
}

基础数据

District 区

func (*District) QueryDistrict

func (d *District) QueryDistrict() (districts []District)

查找所有区

func (*District) QueryDistrictByCityCode

func (d *District) QueryDistrictByCityCode() (districts []District)

根据城市代码查找区

func (*District) QueryDistrictByCode

func (d *District) QueryDistrictByCode() error

根据区代码查找区

func (*District) QueryDistrictByCodeAndCity

func (d *District) QueryDistrictByCodeAndCity() error

根据区代码和城市代码查找区

type Industry

type Industry struct {
	Model
	Name     string `gorm:"not null;unique;size:20;" json:"name"` // 行业名称
	Sort     int64  `json:"sort"`                                 // 行业排序 越大越靠前
	IsEnable bool   `json:"is_enable"`                            // 是否启用 true | false
	ParentID int64  `gorm:"not null;default:0;" json:"parent_id"` // 父类型ID
}

基础数据

Industry 行业

func QueryEnableIndustryByParentID

func QueryEnableIndustryByParentID() (industrys []Industry)

查询已启用最上级行业类型

func QueryIndustry

func QueryIndustry(pageSize int, page int, name string, enable string) (count int, industrys []Industry)

查询所有行业类型

func (*Industry) AddIndustry

func (i *Industry) AddIndustry() error

添加行业

func (*Industry) EditIndustry

func (i *Industry) EditIndustry(args map[string]interface{}) error

修改行业

func (*Industry) QueryEnableIndustry

func (i *Industry) QueryEnableIndustry() (industrys []Industry)

查询已启用行业类型

func (*Industry) QueryIndustryByID

func (i *Industry) QueryIndustryByID() error

查询行业 by id

func (*Industry) QueryIndustryByName

func (i *Industry) QueryIndustryByName() error

查询行业 by name

func (*Industry) QueryIndustryByParentID

func (i *Industry) QueryIndustryByParentID() (industrys []Industry)

查询下级行业类型

type IndustryRange

type IndustryRange struct {
	ID             int64
	IndustryID     int64  `json:"industry_id"`    // 行业ID
	IndustryName   string `json:"industry_name"`  // 行业名称
	PropertyInfoID int64  `gorm:"INDEX" json:"-"` // 物业信息ID
}

IndustryRange 适合经营范围

type LeaveMessage

type LeaveMessage struct {
	Model
	Content   string `gorm:"size:200;" json:"content"`  // 留言内容
	Address   string `gorm:"size:100;" json:"address"`  // 详细地址
	Telephone string `gorm:"size:20;" json:"telephone"` // 联系手机
	Nickname  string `gorm:"size:20;" json:"nickname"`  // 联系人
}

LeaveMessage 留言

func QueryLeaveMessage

func QueryLeaveMessage(pageSize int, page int) (count int, leaveMessages []LeaveMessage)

查看留言

func (*LeaveMessage) AddLeaveMessage

func (l *LeaveMessage) AddLeaveMessage() error

添加留言

func (*LeaveMessage) QueryLeaveMessageByID

func (l *LeaveMessage) QueryLeaveMessageByID() error

查看留言详情

type Link struct {
	ID             int64  `json:"-"`                    // ID
	Name           string `gorm:"size:50;" json:"name"` // 链接网站名称
	Url            string `gorm:"size:200;" json:"url"` // 链接网站URL
	SystemConfigID int64  `gorm:"INDEX" json:"-"`       // 网站信息配置ID
}

友情链接

type Lot

type Lot struct {
	ID             int64
	DistrictCode   string `json:"district_code"`  // 区代码
	DistrictName   string `json:"district_name"`  // 区名
	PropertyInfoID int64  `gorm:"INDEX" json:"-"` // 物业信息ID
}
type Menu struct {
	Model
	Title      string `gorm:"size:30;" json:"title"`      // 菜单标题
	Sort       int64  `json:"sort"`                       // 显示排序
	Icon       string `gorm:"size:50" json:"icon"`        // 菜单图标
	RouterName string `gorm:"size:50" json:"router_name"` // 路由名称
	RouterUrl  string `gorm:"size:100" json:"router_url"` // 路由地址
	Enable     bool   `json:"enable"`                     // 是否启用
	ParentID   int64  `gorm:"default:0" json:"parent_id"` // 上级ID 0为最顶级
}

菜单

func QueryMenuByUser

func QueryMenuByUser(id int64) (count int, menus []Menu)

查询用户所拥有的角色菜单

func QueryMenus

func QueryMenus() (menus []Menu)

获取所有菜单

func (m *Menu) AddMenu() error

创建菜单

func (m *Menu) EditMenu(args map[string]interface{}) error

修改菜单

func (m *Menu) QueryMenuByID() error

获取菜单详情

type MenuPower struct {
	ID        int64  `json:"id"`                         // ID
	MenuID    int64  `json:"menu_id"`                    // 菜单ID
	MenuTitle string `gorm:"size:30;" json:"menu_title"` // 菜单标题
	RoleID    int64  `json:"-"`                          // 角色ID
}

角色菜单权限

type Model

type Model struct {
	ID        int64      `gorm:"primary_key" json:"id"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at"`
}

gorm.Model

type News

type News struct {
	Model
	Title   string `gorm:"size:150;unique" json:"title"` // 标题
	Source  string `gorm:"size:20" json:"source"`        // 来源
	Content string `gorm:"size:5000" json:"content"`     // 内容
}

行业资讯

type PayInfo

type PayInfo struct {
	Model
	Name             string    `json:"name"`              // 收款人
	PayeeID          int64     `json:"payee_id"`          // 业绩归属ID
	Payee            string    `json:"payee"`             // 业绩归属人名称
	PayMethondID     int64     `json:"pay_methond_id"`    // 付款方式ID
	PayMethond       string    `json:"pay_methond"`       // 付款方式名称
	PayTime          time.Time `json:"pay_time"`          // 收款时间
	PayStatus        string    `json:"pay_status"`        // 收款情况
	ActualAmount     float64   `json:"actual_amount"`     // 实收金额
	ReceivableAmount float64   `json:"receivable_amount"` // 应收金额
	Invoice          bool      `json:"invoice"`           // 发票
	Remake           string    `json:"remake"`            // 备注说明
	ProInfoID        int64     `json:"pro_info_id"`       // 物业ID
	ProInfoTitle     string    `json:"pro_info_title"`    // 物业标题
	ProInfoNickname  string    `json:"nickname"`          // 联系人
}

付款

func QueryPayInfo

func QueryPayInfo(pageSize int, page int, args map[string]interface{}) (count int, payInfos []PayInfo)

收款列表

func (*PayInfo) AddPayInfo

func (p *PayInfo) AddPayInfo() error

添加收款

func (*PayInfo) EditPayInfo

func (p *PayInfo) EditPayInfo(args map[string]interface{}) error

修改收款

func (*PayInfo) QueryPayInfoByID

func (p *PayInfo) QueryPayInfoByID() error

查询收款详情

func (*PayInfo) QueryPayInfoByProInfoID

func (p *PayInfo) QueryPayInfoByProInfoID() error

查询收款详情

type PayMethond

type PayMethond struct {
	Model
	Name string `json:"name"` // 付款方式名称
	Card string `json:"card"` // 付款卡号
}

付款方式

func QueryPayMethond

func QueryPayMethond() (payMethonds []PayMethond)

查询所有付款方式

func (*PayMethond) AddPayMethond

func (p *PayMethond) AddPayMethond() error

添加付款方式

func (*PayMethond) EditPayMethond

func (p *PayMethond) EditPayMethond(args map[string]interface{}) error

修改付款方式

func (*PayMethond) QueryPayMethondByID

func (p *PayMethond) QueryPayMethondByID() error

付款方式详情

type Picture

type Picture struct {
	ID             int64
	Url            string `json:"url"`            // 店铺图
	PropertyInfoID int64  `gorm:"INDEX" json:"-"` // 物业信息ID
}

图片

func (*Picture) AddPicture

func (p *Picture) AddPicture() error

上传图片

func (*Picture) DelPicturre

func (p *Picture) DelPicturre() error

删除图集图片

type Post

type Post struct {
	Model
	Name   string `gorm:"size:50;unique" json:"name"` // 岗位名称
	Code   string `gorm:"size:50;unique" json:"code"` // 岗位编码
	Sort   int64  `json:"sort"`                       // 显示排序
	Enable bool   `json:"enable"`                     // 是否启用
}

岗位

func QueryPosts

func QueryPosts(pageSize int, page int, args map[string]interface{}) (count int, posts []Post)

查询所有岗位

func (*Post) AddPost

func (p *Post) AddPost() error

添加岗位

func (*Post) EditPost

func (p *Post) EditPost(args map[string]interface{}) error

修改岗位

func (*Post) QueryPostByCode

func (p *Post) QueryPostByCode() error

查询岗位信息 by code

func (*Post) QueryPostByID

func (p *Post) QueryPostByID() error

查询岗位信息 by id

func (*Post) QueryPostByName

func (p *Post) QueryPostByName() error

查询岗位信息 by name

type ProInfoLog

type ProInfoLog struct {
	Model
	Content   string `json:"content"`                   // 跟单内容
	WithID    int64  `json:"with_id"`                   // 跟单人ID
	WithName  string `gorm:"size:50;" json:"with_name"` // 跟单人姓名
	ProInfoID int64  `json:"pro_info_id"`               // 物业信息ID
}

店铺转让跟单记录

func QueryByProInfoID

func QueryByProInfoID(id int64) (logs []ProInfoLog)

查看跟单记录

func (*ProInfoLog) AddProInfoLog

func (s *ProInfoLog) AddProInfoLog() error

添加跟单记录

type PropertyInfo

type PropertyInfo struct {
	Model
	IndustryID     int64           `json:"industry_id"`                                                                          // 经营业态ID
	Title          string          `gorm:"not null;size:255;" json:"title"`                                                      // 标题
	Nickname       string          `gorm:"size:50;" json:"nickname"`                                                             // 联系人
	Telephone      string          `gorm:"not null;size:30;" json:"telephone"`                                                   // 联系手机
	ShopName       string          `gorm:"size:100;" json:"shop_name"`                                                           // 店名(后台录入)
	Image          string          `gorm:"size:200;" json:"image"`                                                               // 图片
	Video          string          `json:"video"`                                                                                // 视频(后台录入)
	BusType        int64           `gorm:"size:1;" json:"bus_type"`                                                              // 业务类型(后台录入)0-商铺 | 1-写字楼 | 2-厂房仓库
	ModelType      int64           `gorm:"size:1;" json:"model_type"`                                                            // 模型类型(后台录入)0-转让 | 1-出售 | 3-出租 | 4-求租 | 5-求购
	ProvinceCode   string          `gorm:"size:10;" json:"province_code"`                                                        // 省代码
	CityCode       string          `gorm:"size:10;" json:"city_code"`                                                            // 城市代码
	DistrictCode   string          `gorm:"size:10;" json:"district_code"`                                                        // 区代码
	StreetCode     string          `gorm:"size:10;" json:"street_code"`                                                          // 街道代码
	Address        string          `json:"address"`                                                                              // 详细地址
	StoreTypeID    int64           `json:"store_type_id"`                                                                        // 店铺类型ID
	AreaTypeID     int64           `json:"area_type_id"`                                                                         // 面积分类ID (后台录入或者自动判断)
	RentTypeID     int64           `json:"rent_type_id"`                                                                         // 租金分类ID (后台录入或者自动判断)
	MinArea        float64         `json:"min_area"`                                                                             // 最小面积(单位:平方米)
	MaxArea        float64         `json:"max_area"`                                                                             // 最大面积(单位:平方米)
	MinRent        float64         `json:"min_rent"`                                                                             // 最低租金(单位:元/月)
	MaxRent        float64         `json:"max_rent"`                                                                             // 最高租金(单位:元/月)
	Lots           []Lot           `gorm:"foreignkey:PropertyInfoID;association_foreignkey:ID" json:"lots,omitempty"`            // 考虑地段
	Idling         bool            `json:"idling"`                                                                               // 可否空转
	InOperation    int64           `json:"in_operation"`                                                                         // 是否营业中 0-新铺 | 1-空置中 | 2-营业中
	Area           float64         `json:"area"`                                                                                 // 面积(单位:平方米)
	Rent           float64         `json:"rent"`                                                                                 // 租金(单位:元/月)
	TransferFee    float64         `json:"transfer_fee"`                                                                         // 转让费用(单位:万元 不录入则前台显示为面议)
	IndustryRanges []IndustryRange `gorm:"foreignkey:PropertyInfoID;association_foreignkey:ID" json:"industry_ranges,omitempty"` // 适合经营范围
	Description    string          `json:"description"`                                                                          // 详细描述
	ExplicitTel    bool            `json:"explicit_tel"`                                                                         // 是否外显号码 true:客户号码 | false:发布者号码
	Tel1           string          `gorm:"size:30;" json:"tel1"`                                                                 // 外显号码1
	Tel2           string          `gorm:"size:30;" json:"tel2"`                                                                 // 外显号码2
	Audit          bool            `json:"audit"`                                                                                // 是否审核 true:已审核 | false:待审核 (后台录入)
	AuditID        int64           `json:"audit_id"`                                                                             // 审核人ID (后台录入)
	Protect        bool            `json:"protect"`                                                                              // 是否保护 true:已保护 | false:未保护 (后台录入)
	QuotedPrice    float64         `json:"quoted_price"`                                                                         // 报价(后台录入,保护时显示)
	Pictures       []Picture       `gorm:"foreignkey:PropertyInfoID;association_foreignkey:ID" json:"pictures,omitempty"`        // 店图集(后台录入)
	Status         bool            `json:"status"`                                                                               // 是否成功 true:已成功 | false:未成功 (后台录入)
	SourceID       int64           `json:"source_id"`                                                                            // 来源ID
	SourceInfo     string          `gorm:"size:200" json:"source_info"`                                                          // 来源描述
	Remake         string          `gorm:"size:200" json:"remake"`                                                               // 跟进备注
	Views          int64           `json:"views"`                                                                                // 浏览次数
}

PropertyInfo 物业信息

func (*PropertyInfo) CreatePropertyInfo

func (p *PropertyInfo) CreatePropertyInfo() error

添加物业信息

func (*PropertyInfo) DelProInfo

func (p *PropertyInfo) DelProInfo() error

删除物业信息 By ID

func (*PropertyInfo) EditPropertyInfoByID

func (p *PropertyInfo) EditPropertyInfoByID(args map[string]interface{}) error

修改物业信息 by id

func (*PropertyInfo) QueryPropertyInfoByUserID

func (p *PropertyInfo) QueryPropertyInfoByUserID() (propertyInfoScans []PropertyInfoScan)

查询物业信息 by source_id

type PropertyInfoScan

type PropertyInfoScan struct {
	PropertyInfo
	IndustryName  string  `json:"industry_name"`   // 行业名称
	ProvinceName  string  `json:"province_name"`   // 省名称
	CityName      string  `json:"city_name"`       // 城市名称
	DistrictName  string  `json:"district_name"`   // 区名称
	StreetName    string  `json:"street_name"`     // 街道名称
	StoreTypeName string  `json:"store_type_name"` // 店铺类型名称
	AreaType_name string  `json:"area_type_name"`  // 面积分类名称
	RentTypeName  string  `json:"rent_type_name"`  // 租金分类名称
	AuditName     string  `json:"audit_name"`      // 审核人
	SourceName    string  `json:"source_name"`     // 来源人
	ActualAmount  float64 `json:"actual_amount"`   // 实收金额
}

PropertyInfoScan 物业信息详细

func QueryPropertyInfo

func QueryPropertyInfo(pageSize int, page int, args map[string]interface{}) (propertyInfoScans []PropertyInfoScan, count int)

根据条件查看物业信息

func (*PropertyInfoScan) QueryPropertyInfoByID

func (p *PropertyInfoScan) QueryPropertyInfoByID() error

查询物业信息 by id

type Province

type Province struct {
	Model
	Name string `gorm:"not null;unique;size:10;" json:"name"` // 省名称
	Code string `gorm:"not null;unique;size:10;" json:"code"` // 省代码
}

基础数据

Province 省

func (*Province) QueryProvinceByCode

func (p *Province) QueryProvinceByCode() error

根据省代码查询省

func (*Province) QueryProvinces

func (p *Province) QueryProvinces() (provinces []Province)

查询省

type RentType

type RentType struct {
	Model
	MinRent float64 `json:"min_rent"` // 最低租金(单位:元/月)
	MaxRent float64 `json:"max_rent"` // 最高租金(单位:元/月)
}

基础数据

RentType 租金分类

func (*RentType) AddRentType

func (r *RentType) AddRentType() error

添加租金分类

func (*RentType) EditRentType

func (r *RentType) EditRentType(args map[string]interface{}) error

修改租金分类

func (*RentType) QueryMaxRent

func (r *RentType) QueryMaxRent() error

查询已添加面积范围最大值

func (*RentType) QueryRentType

func (r *RentType) QueryRentType() (rentTypes []RentType)

查询租金分类

func (*RentType) QueryRentTypeByRent

func (r *RentType) QueryRentTypeByRent(rent float64) error

查询租金所在分组

func (*RentType) QueryRentTypeInfoById

func (r *RentType) QueryRentTypeInfoById() error

查询租金分类 by id

type Report

type Report struct {
	Model
	UserID       int64  `json:"user_id"`                  // 举报者ID
	Nickname     string `gorm:"size:50;" json:"nickname"` // 举报者
	ProInfoID    int64  `json:"property_info_id"`         // 物业信息ID
	ProInfoTitle string `gorm:"size:255;" json:"title"`   // 标题
	Content      string `gorm:"size:255;" json:"content"` // 举报内容
}

举报信息

func QueryReport

func QueryReport(pageSize int, page int) (count int, reports []Report)

查看举报信息

func (*Report) AddReport

func (r *Report) AddReport() error

添加举报信息

func (*Report) QueryReportByID

func (r *Report) QueryReportByID() error

查看举报信息详情

type Role

type Role struct {
	Model
	Name       string      `gorm:"size:50;unique" json:"name"`                                     // 角色名称
	Sort       int64       `json:"sort"`                                                           // 显示排序
	Enable     bool        `json:"enable"`                                                         // 是否启用
	MenuPowers []MenuPower `gorm:"foreignkey:RoleID;association_foreignkey:ID" json:"menu_powers"` // 菜单权限
}

角色

func QueryRole

func QueryRole(pageSize int, page int, name string, enable string) (count int, roles []Role)

查询角色

func (*Role) AddRole

func (r *Role) AddRole() error

创建角色

func (*Role) EditRole

func (r *Role) EditRole(args map[string]interface{}) error

修改角色信息

func (*Role) QueryRoleByID

func (r *Role) QueryRoleByID() error

查询角色详情 by id

func (*Role) QueryRoleByName

func (r *Role) QueryRoleByName() error

查询角色详情 by name

type StoreType

type StoreType struct {
	Model
	Name     string `gorm:"not null;unique;size:20;" json:"name"` // 类型名称
	Sort     int64  `json:"sort"`                                 // 类型排序 越大越靠前
	IsEnable bool   `json:"is_enable"`                            // 是否启用 true | false
}

基础数据

StoreTypeType 店铺类型

func QueryStoreType

func QueryStoreType(pageSize int, page int, name string, enable string) (count int, storeTypes []StoreType)

查询所有店铺类型

func (*StoreType) AddStoreType

func (s *StoreType) AddStoreType() error

添加店铺类型

func (*StoreType) EditStoreType

func (s *StoreType) EditStoreType(args map[string]interface{}) error

修改店铺类型

func (*StoreType) QueryEnableStoreType

func (s *StoreType) QueryEnableStoreType() (storeTypes []StoreType)

查询已启用店铺类型

func (*StoreType) QueryStoreTypeByID

func (s *StoreType) QueryStoreTypeByID() error

查询店铺 by id

func (*StoreType) QueryStoreTypeByName

func (s *StoreType) QueryStoreTypeByName() error

查询店铺 by name

type Street

type Street struct {
	Model
	Name         string `gorm:"not null;size:10;" json:"name"`          // 街道名称
	Code         string `gorm:"not null;unique;size:10;" json:"code"`   // 街道代码
	DistrictCode string `gorm:"not null;size:10;" json:"district_code"` // 区代码
}

基础数据

street 街道

func QueryStreet

func QueryStreet() (count int, streers []Street)

获取所有街道

func (*Street) QueryStreetByCode

func (s *Street) QueryStreetByCode() error

根据街道代码找街道

func (*Street) QueryStreetByCodeAndDist

func (s *Street) QueryStreetByCodeAndDist() error

根据街道代码和区代码找街道

func (*Street) QueryStreetByDistrictCode

func (s *Street) QueryStreetByDistrictCode() (streets []Street)

根据区查找街道

type SystemConfig

type SystemConfig struct {
	Model
	Favicon      string `gorm:"size:60;" json:"favicon"`                                          // 网站logo
	Hotline      string `gorm:"size:20;" json:"hotline"`                                          // 服务热线
	CusSerPhone  string `json:"cus_ser_phone"`                                                    // 客服手机号码
	Street       string `json:"street"`                                                           // 公司地址
	Advertphone  string `gorm:"size:20;" json:"advertphone"`                                      // 广告联系电话
	Copyright    string `json:"copyright"`                                                        // 版权所有
	CopyrightUrl string `gorm:"size:200;" json:"copyright_url"`                                   // 版权所有URL
	CaseNumber   string `json:"case_number"`                                                      // 备案号
	Links        []Link `gorm:"foreignkey:SystemConfigID;association_foreignkey:ID" json:"links"` // 友情链接
	IsDefault    bool   `json:"is_default"`                                                       // 是否设置默认
}

网站信息配置

func QuerySystemConfig

func QuerySystemConfig(pageSize int, page int) (count int, systemConfigs []SystemConfig)

配置列表

func (*SystemConfig) AddSystemConfig

func (s *SystemConfig) AddSystemConfig() error

添加配置信息

func (*SystemConfig) EditDefaultSystemConfig

func (s *SystemConfig) EditDefaultSystemConfig() error

设置默认

func (*SystemConfig) EditSystemConfig

func (s *SystemConfig) EditSystemConfig(args map[string]interface{}) error

修改配置信息

func (*SystemConfig) QuerySystemConfigByDefault

func (s *SystemConfig) QuerySystemConfigByDefault() error

获取默认配置 by is_default

func (*SystemConfig) QuerySystemConfigByID

func (s *SystemConfig) QuerySystemConfigByID() error

配置详情 by id

type User

type User struct {
	Model
	Username       string    `gorm:"not null;unique;size:30;" json:"username"`                               // 登录用户名(默认为注册手机号码)
	Telephone      string    `gorm:"not null;unique;size:30;" json:"telephone"`                              // 手机号码
	Password       string    `gorm:"size:50;" json:"-"`                                                      // 登录密码 (6-15位字符)
	Nickname       string    `gorm:"size:50;" json:"nickname"`                                               // 姓名
	Sex            string    `gorm:"size:1;" json:"sex"`                                                     // 性别 0:未知 | 1:男 | 2:女 (空或其他默认未知)
	Landlinenumber string    `gorm:"size:30;" json:"landlinenumber"`                                         // 座机号码
	QQ             string    `gorm:"size:30;" json:"QQ"`                                                     // QQ
	Email          string    `gorm:"size:30;" json:"email"`                                                  // 邮箱
	IP             string    `gorm:"size:30;" json:"ip"`                                                     // 登录IP
	Token          string    `json:"token"`                                                                  // 授权令牌
	UUID           uuid.UUID `gorm:"size:50;" json:"uuid"`                                                   // 客户标识
	Type           string    `gorm:"size:1;" json:"-"`                                                       // 账号类型 0:用户 | 1:管理员
	UserInfo       UserInfo  `gorm:"foreignkey:UserID;association_foreignkey:ID" json:"user_info,omitempty"` // 账号类型为管理员时,绑定其岗位、角色等信息
	IsEnable       bool      `json:"is_enable"`                                                              // 是否禁用(默认false,用户发布不良信息可禁用账号,并且所有信息对外不可见)
}

User 用户表

func QueryUser

func QueryUser(pageSize int, page int, args map[string]interface{}) (count int, users []User)

查询员工信息

func (*User) Edit

func (u *User) Edit(args map[string]interface{}) error

修改用户信息

param id

func (*User) QueryByPhone

func (u *User) QueryByPhone() error

查询用户信息 by telephone

param telephone

func (*User) QueryByToken

func (u *User) QueryByToken() error

查询用户信息 by token

param token
return user,error

func (*User) QueryByUsername

func (u *User) QueryByUsername() error

查询用户信息 by username

param username

func (*User) QueryByUsernameOrPhone

func (u *User) QueryByUsernameOrPhone() error

查询用户信息 by telephone or username

param telephone or username

func (*User) QueryEmployeeById

func (u *User) QueryEmployeeById() error

查询员工信息 by id

param telephone

func (*User) QueryUserByID

func (u *User) QueryUserByID() error

查询用户信息 by id

param telephone

func (*User) Register

func (u *User) Register() error

用户注册

type UserInfo

type UserInfo struct {
	ID             int64  `json:"-"`                                         // ID
	UserID         int64  `gorm:"INDEX" json:"-"`                            // 用户ID
	DepartmentID   int64  `json:"department_id,omitempty"`                   // 部门ID
	DepartmentName string `gorm:"size:50;" json:"department_name,omitempty"` // 部门名称
	PostID         int64  `json:"post_id,omitempty"`                         // 岗位ID
	PostName       string `gorm:"size:50;" json:"post_name,omitempty"`       // 岗位名称
	RoleID         int64  `json:"role_id"`                                   // 角色ID
	RoleName       string `gorm:"size:50;" json:"role_name"`                 // 角色名称
}

用户信息表

type Verificationcode

type Verificationcode struct {
	Tel        string // 手机号码
	CreateTime int64  // 创建时间戳
	Code       string // 生成的验证码
}

验证码

func (*Verificationcode) AddVerificationcode

func (v *Verificationcode) AddVerificationcode() error

添加验证码信息

func (*Verificationcode) DeleteVerificationcode

func (v *Verificationcode) DeleteVerificationcode()

删除验证码信息

func (*Verificationcode) GetVerificationcode

func (v *Verificationcode) GetVerificationcode() error

获取验证码信息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL