fix
add the return parameters
| | |
| | | "is_first": { |
| | | "type": "boolean" |
| | | }, |
| | | "member": { |
| | | "$ref": "#/definitions/model.User" |
| | | }, |
| | | "member_id": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "is_first": { |
| | | "type": "boolean" |
| | | }, |
| | | "member": { |
| | | "$ref": "#/definitions/model.User" |
| | | }, |
| | | "member_id": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "description": "The date when the item was deleted\nexample: 2023-08-10 15:48:25", |
| | | "type": "string" |
| | | }, |
| | | "client": { |
| | | "$ref": "#/definitions/model.Client" |
| | | }, |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "id": { |
| | | "description": "The ID of the item\nexample: 1", |
| | | "type": "integer" |
| | | }, |
| | | "member": { |
| | | "$ref": "#/definitions/model.User" |
| | | }, |
| | | "memberId": { |
| | | "type": "integer" |
| | |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "client_status": { |
| | | "$ref": "#/definitions/model.ClientStatus" |
| | | }, |
| | | "client_status_id": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "record": { |
| | | "type": "string" |
| | | }, |
| | | "sale_chance": { |
| | | "$ref": "#/definitions/model.SaleChance" |
| | | }, |
| | | "sale_chance_id": { |
| | | "type": "integer" |
| | | }, |
| | | "sales_leads": { |
| | | "$ref": "#/definitions/model.SalesLeads" |
| | | }, |
| | | "sales_leads_id": { |
| | | "type": "integer" |
| | |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "member": { |
| | | "$ref": "#/definitions/model.User" |
| | | }, |
| | | "member_id": { |
| | | "type": "integer" |
| | |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "member": { |
| | | "$ref": "#/definitions/model.User" |
| | | }, |
| | | "member_id": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "items": { |
| | | "$ref": "#/definitions/model.Product" |
| | | } |
| | | }, |
| | | "quotation_status": { |
| | | "$ref": "#/definitions/model.QuotationStatus" |
| | | }, |
| | | "quotation_status_id": { |
| | | "type": "integer" |
| | |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "masterOrder": { |
| | | "$ref": "#/definitions/model.MasterOrder" |
| | | }, |
| | | "masterOrderId": { |
| | | "type": "integer" |
| | | }, |
| | | "member": { |
| | | "$ref": "#/definitions/model.User" |
| | | }, |
| | | "memberId": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "is_first": { |
| | | "type": "boolean" |
| | | }, |
| | | "member": { |
| | | "$ref": "#/definitions/model.User" |
| | | }, |
| | | "member_id": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "is_first": { |
| | | "type": "boolean" |
| | | }, |
| | | "member": { |
| | | "$ref": "#/definitions/model.User" |
| | | }, |
| | | "member_id": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "description": "The date when the item was deleted\nexample: 2023-08-10 15:48:25", |
| | | "type": "string" |
| | | }, |
| | | "client": { |
| | | "$ref": "#/definitions/model.Client" |
| | | }, |
| | | "clientId": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "id": { |
| | | "description": "The ID of the item\nexample: 1", |
| | | "type": "integer" |
| | | }, |
| | | "member": { |
| | | "$ref": "#/definitions/model.User" |
| | | }, |
| | | "memberId": { |
| | | "type": "integer" |
| | |
| | | "client_id": { |
| | | "type": "integer" |
| | | }, |
| | | "client_status": { |
| | | "$ref": "#/definitions/model.ClientStatus" |
| | | }, |
| | | "client_status_id": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "record": { |
| | | "type": "string" |
| | | }, |
| | | "sale_chance": { |
| | | "$ref": "#/definitions/model.SaleChance" |
| | | }, |
| | | "sale_chance_id": { |
| | | "type": "integer" |
| | | }, |
| | | "sales_leads": { |
| | | "$ref": "#/definitions/model.SalesLeads" |
| | | }, |
| | | "sales_leads_id": { |
| | | "type": "integer" |
| | |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "member": { |
| | | "$ref": "#/definitions/model.User" |
| | | }, |
| | | "member_id": { |
| | | "type": "integer" |
| | |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "member": { |
| | | "$ref": "#/definitions/model.User" |
| | | }, |
| | | "member_id": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | "items": { |
| | | "$ref": "#/definitions/model.Product" |
| | | } |
| | | }, |
| | | "quotation_status": { |
| | | "$ref": "#/definitions/model.QuotationStatus" |
| | | }, |
| | | "quotation_status_id": { |
| | | "type": "integer" |
| | |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "masterOrder": { |
| | | "$ref": "#/definitions/model.MasterOrder" |
| | | }, |
| | | "masterOrderId": { |
| | | "type": "integer" |
| | | }, |
| | | "member": { |
| | | "$ref": "#/definitions/model.User" |
| | | }, |
| | | "memberId": { |
| | | "type": "integer" |
| | | }, |
| | |
| | | type: integer |
| | | is_first: |
| | | type: boolean |
| | | member: |
| | | $ref: '#/definitions/model.User' |
| | | member_id: |
| | | type: integer |
| | | name: |
| | |
| | | type: integer |
| | | is_first: |
| | | type: boolean |
| | | member: |
| | | $ref: '#/definitions/model.User' |
| | | member_id: |
| | | type: integer |
| | | name: |
| | |
| | | The date when the item was deleted |
| | | example: 2023-08-10 15:48:25 |
| | | type: string |
| | | client: |
| | | $ref: '#/definitions/model.Client' |
| | | clientId: |
| | | type: integer |
| | | created_at: |
| | |
| | | The ID of the item |
| | | example: 1 |
| | | type: integer |
| | | member: |
| | | $ref: '#/definitions/model.User' |
| | | memberId: |
| | | type: integer |
| | | number: |
| | |
| | | $ref: '#/definitions/model.Client' |
| | | client_id: |
| | | type: integer |
| | | client_status: |
| | | $ref: '#/definitions/model.ClientStatus' |
| | | client_status_id: |
| | | type: integer |
| | | contact: |
| | |
| | | type: string |
| | | record: |
| | | type: string |
| | | sale_chance: |
| | | $ref: '#/definitions/model.SaleChance' |
| | | sale_chance_id: |
| | | type: integer |
| | | sales_leads: |
| | | $ref: '#/definitions/model.SalesLeads' |
| | | sales_leads_id: |
| | | type: integer |
| | | topic: |
| | |
| | | type: string |
| | | id: |
| | | type: integer |
| | | member: |
| | | $ref: '#/definitions/model.User' |
| | | member_id: |
| | | type: integer |
| | | money: |
| | |
| | | type: string |
| | | id: |
| | | type: integer |
| | | member: |
| | | $ref: '#/definitions/model.User' |
| | | member_id: |
| | | type: integer |
| | | number: |
| | |
| | | items: |
| | | $ref: '#/definitions/model.Product' |
| | | type: array |
| | | quotation_status: |
| | | $ref: '#/definitions/model.QuotationStatus' |
| | | quotation_status_id: |
| | | type: integer |
| | | sale_chance: |
| | |
| | | type: integer |
| | | id: |
| | | type: integer |
| | | masterOrder: |
| | | $ref: '#/definitions/model.MasterOrder' |
| | | masterOrderId: |
| | | type: integer |
| | | member: |
| | | $ref: '#/definitions/model.User' |
| | | memberId: |
| | | type: integer |
| | | number: |
| | |
| | | Position string `json:"position" gorm:"column:position;type:varchar(255);comment:职位"` |
| | | Phone string `json:"phone" gorm:"column:phone;type:varchar(255);comment:电话"` |
| | | MemberId int `json:"member_id" gorm:"column:member_id;type:int(11);comment:负责人ID"` |
| | | Member User `json:"member" gorm:"foreignKey:MemberId"` |
| | | IsFirst bool `json:"is_first" gorm:"column:is_first;type:tinyint(1);comment:是否首要联系人"` |
| | | Wechat string `json:"wechat" gorm:"column:wechat;type:varchar(255);comment:微信"` |
| | | Birthday *CustomTime `json:"birthday" gorm:"column:birthday;type:datetime;comment:生日"` |
| | |
| | | db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) |
| | | } |
| | | |
| | | err := db.Preload("FollowRecord").Preload("Client").Preload("Country").Preload("Province").Preload("City").Preload("Region").Order("id desc").Find(&records).Error |
| | | err := db.Preload("Member").Preload("FollowRecord").Preload("Client").Preload("Country").Preload("Province").Preload("City").Preload("Region").Order("id desc").Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |
| | |
| | | Contract struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | ClientId int `json:"clientId" gorm:"column:client_id;type:int;comment:客户id"` |
| | | Client Client `json:"client" gorm:"foreignKey:ClientId"` |
| | | MemberId int `json:"memberId" gorm:"column:member_id;type:int;comment:负责人id"` |
| | | Member User `json:"member" gorm:"foreignKey:MemberId"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:合同编号"` |
| | | QuotationId int `json:"quotationId" gorm:"column:quotation_id;type:int;comment:报价单id"` |
| | | Quotation Quotation `json:"quotation" gorm:"foreignKey:QuotationId;references:Id"` |
| | |
| | | db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) |
| | | } |
| | | |
| | | err := db.Preload("Quotation").Order("id desc").Find(&records).Error |
| | | err := db.Preload("Client").Preload("Member").Preload("Quotation").Order("id desc").Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |
| | |
| | | |
| | | type ( |
| | | FollowRecord struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | ClientId int `json:"client_id" gorm:"column:client_id;type:int(11);comment:客户id"` |
| | | ClientStatusId int `json:"client_status_id" gorm:"column:client_status_id;type:int(11);comment:客户状态id"` |
| | | MemberId int `json:"member_id" gorm:"column:member_id;type:int(11);comment:跟进人id"` |
| | | Member User `json:"member" gorm:"foreignKey:MemberId"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:跟进编号"` |
| | | ContactId int `json:"contact_id" gorm:"column:contact_id;type:int(11);comment:联系人id"` |
| | | Topic string `json:"topic" gorm:"column:topic;type:varchar(255);comment:跟进主题"` |
| | | Record string `json:"record" gorm:"column:record;type:MEDIUMTEXT;comment:跟进记录"` |
| | | SaleChanceId int `json:"sale_chance_id" gorm:"column:sale_chance_id;type:int(11);comment:销售机会id"` |
| | | SalesLeadsId int `json:"sales_leads_id" gorm:"column:sales_leads_id;type:int(11);comment:销售线索id"` |
| | | ContactInformationId int `json:"contact_information_id" gorm:"column:contact_information_id;type:int(11);comment:联系方式id"` |
| | | FollowTime *CustomTime `json:"follow_time" gorm:"column:follow_time;type:datetime;comment:跟进时间"` |
| | | NextFollowTime *CustomTime `json:"next_follow_time" gorm:"column:next_follow_time;type:datetime;comment:下次跟进时间"` |
| | | Purpose string `json:"purpose" gorm:"column:purpose;type:varchar(255);comment:跟进目的"` |
| | | Content string `json:"content" gorm:"column:content;type:MEDIUMTEXT;comment:跟进内容"` |
| | | Client Client `json:"client" gorm:"foreignKey:ClientId"` |
| | | Contact Contact `json:"contact" gorm:"foreignKey:ContactId"` |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | ClientId int `json:"client_id" gorm:"column:client_id;type:int(11);comment:客户id"` |
| | | ClientStatusId int `json:"client_status_id" gorm:"column:client_status_id;type:int(11);comment:客户状态id"` |
| | | ClientStatus ClientStatus `json:"client_status" gorm:"foreignKey:ClientStatusId"` |
| | | MemberId int `json:"member_id" gorm:"column:member_id;type:int(11);comment:跟进人id"` |
| | | Member User `json:"member" gorm:"foreignKey:MemberId"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:跟进编号"` |
| | | ContactId int `json:"contact_id" gorm:"column:contact_id;type:int(11);comment:联系人id"` |
| | | Topic string `json:"topic" gorm:"column:topic;type:varchar(255);comment:跟进主题"` |
| | | Record string `json:"record" gorm:"column:record;type:MEDIUMTEXT;comment:跟进记录"` |
| | | SaleChanceId int `json:"sale_chance_id" gorm:"column:sale_chance_id;type:int(11);comment:销售机会id"` |
| | | SaleChance SaleChance `json:"sale_chance" gorm:"foreignKey:SaleChanceId"` |
| | | SalesLeadsId int `json:"sales_leads_id" gorm:"column:sales_leads_id;type:int(11);comment:销售线索id"` |
| | | SalesLeads SalesLeads `json:"sales_leads" gorm:"foreignKey:SalesLeadsId"` |
| | | ContactInformationId int `json:"contact_information_id" gorm:"column:contact_information_id;type:int(11);comment:联系方式id"` |
| | | FollowTime *CustomTime `json:"follow_time" gorm:"column:follow_time;type:datetime;comment:跟进时间"` |
| | | NextFollowTime *CustomTime `json:"next_follow_time" gorm:"column:next_follow_time;type:datetime;comment:下次跟进时间"` |
| | | Purpose string `json:"purpose" gorm:"column:purpose;type:varchar(255);comment:跟进目的"` |
| | | Content string `json:"content" gorm:"column:content;type:MEDIUMTEXT;comment:跟进内容"` |
| | | Client Client `json:"client" gorm:"foreignKey:ClientId"` |
| | | Contact Contact `json:"contact" gorm:"foreignKey:ContactId"` |
| | | gorm.Model `json:"-"` |
| | | } |
| | | |
| | |
| | | db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) |
| | | } |
| | | |
| | | err := db.Preload("Client").Preload("Contact").Order("id desc").Find(&records).Error |
| | | err := db.Preload("SalesLeads").Preload("SaleChance").Preload("ClientStatus").Preload("Member").Preload("Client").Preload("Contact").Order("id desc").Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |
| | |
| | | ClientId int `json:"client_id" gorm:"column:client_id;type:int;comment:客户id"` |
| | | Client Client `json:"client" gorm:"foreignKey:ClientId"` |
| | | MemberId int `json:"member_id" gorm:"column:member_id;type:int;comment:负责人id"` |
| | | Member User `json:"member" gorm:"foreignKey:MemberId"` |
| | | StartTime *CustomTime `json:"start_time" gorm:"column:start_time;type:datetime;comment:开始时间"` |
| | | EndTime *CustomTime `json:"end_time" gorm:"column:end_time;type:datetime;comment:结束时间"` |
| | | Money float64 `json:"money" gorm:"column:money;type:decimal(10,2);comment:总金额"` |
| | |
| | | db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) |
| | | } |
| | | |
| | | if slf.PageNum > 0 && slf.PageSize > 0 { |
| | | db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) |
| | | } |
| | | |
| | | err := db.Preload("Client").Order("id desc").Find(&records).Error |
| | | err := db.Preload("Member").Preload("Client").Order("id desc").Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |
| | |
| | | type ( |
| | | // Quotation 报价单 |
| | | Quotation struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | ClientId int `json:"client_id" gorm:"column:client_id;type:int;comment:客户id"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:报价单号"` |
| | | QuotationStatusId int `json:"quotation_status_id" gorm:"column:quotation_status_id;type:int;comment:报价单状态id"` |
| | | ValidityDate *CustomTime `json:"validity_date" gorm:"column:validity_date;type:datetime;comment:有效期"` |
| | | ContactId int `json:"contact_id" gorm:"column:contact_id;type:int;comment:联系人id"` |
| | | MemberId int `json:"member_id" gorm:"column:member_id;type:int;comment:负责人id"` |
| | | SaleChanceId int `json:"sale_chance_id" gorm:"column:sale_chance_id;type:int;comment:销售机会id"` |
| | | Conditions string `json:"conditions" gorm:"column:conditions;type:text;comment:报价条件"` |
| | | File string `json:"file" gorm:"column:file;type:varchar(255);comment:附件"` |
| | | Client Client `json:"client" gorm:"foreignKey:ClientId"` |
| | | Contact Contact `json:"contact" gorm:"foreignKey:ContactId"` |
| | | SaleChance SaleChance `json:"sale_chance" gorm:"foreignKey:SaleChanceId"` |
| | | Products []Product `json:"products" gorm:"many2many:quotation_product"` |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | ClientId int `json:"client_id" gorm:"column:client_id;type:int;comment:客户id"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:报价单号"` |
| | | QuotationStatusId int `json:"quotation_status_id" gorm:"column:quotation_status_id;type:int;comment:报价单状态id"` |
| | | QuotationStatus QuotationStatus `json:"quotation_status" gorm:"foreignKey:QuotationStatusId"` |
| | | ValidityDate *CustomTime `json:"validity_date" gorm:"column:validity_date;type:datetime;comment:有效期"` |
| | | ContactId int `json:"contact_id" gorm:"column:contact_id;type:int;comment:联系人id"` |
| | | MemberId int `json:"member_id" gorm:"column:member_id;type:int;comment:负责人id"` |
| | | Member User `json:"member" gorm:"foreignKey:MemberId"` |
| | | SaleChanceId int `json:"sale_chance_id" gorm:"column:sale_chance_id;type:int;comment:销售机会id"` |
| | | Conditions string `json:"conditions" gorm:"column:conditions;type:text;comment:报价条件"` |
| | | File string `json:"file" gorm:"column:file;type:varchar(255);comment:附件"` |
| | | Client Client `json:"client" gorm:"foreignKey:ClientId"` |
| | | Contact Contact `json:"contact" gorm:"foreignKey:ContactId"` |
| | | SaleChance SaleChance `json:"sale_chance" gorm:"foreignKey:SaleChanceId"` |
| | | Products []Product `json:"products" gorm:"many2many:quotation_product"` |
| | | gorm.Model `json:"-"` |
| | | } |
| | | |
| | |
| | | db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) |
| | | } |
| | | |
| | | err := db.Preload("Client").Preload("Contact").Order("id desc").Find(&records).Error |
| | | err := db.Preload("Member").Preload("QuotationStatus").Preload("Client").Preload("Contact").Order("id desc").Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |
| | |
| | | db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) |
| | | } |
| | | |
| | | err := db.Preload("Province").Preload("City").Preload("FollowRecord").Order("id desc").Find(&records).Error |
| | | err := db.Preload("Member").Preload("Province").Preload("City").Preload("FollowRecord").Order("id desc").Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |
| | |
| | | db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) |
| | | } |
| | | |
| | | err := db.Preload("Products").Order("id desc").Find(&records).Error |
| | | err := db.Preload("BankAccount").Preload("PaymentType").Preload("Member").Preload("Products").Order("id desc").Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |
| | |
| | | db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) |
| | | } |
| | | |
| | | err := db.Preload("Products").Order("id desc").Find(&records).Error |
| | | err := db.Preload("Member").Preload("Client").Preload("Products").Order("id desc").Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |
| | |
| | | |
| | | type ( |
| | | SubOrder struct { |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | ClientId int `json:"clientId" gorm:"column:client_id;type:int;comment:客户id"` |
| | | Client Client `json:"client" gorm:"foreignKey:ClientId"` |
| | | MemberId int `json:"memberId" gorm:"column:member_id;type:int;comment:负责人id"` |
| | | MasterOrderId int `json:"masterOrderId" gorm:"column:master_order_id;type:int;comment:销售总单id"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:销售子单号"` |
| | | Products []Product `json:"products" gorm:"many2many:subOrder_product;"` |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | ClientId int `json:"clientId" gorm:"column:client_id;type:int;comment:客户id"` |
| | | Client Client `json:"client" gorm:"foreignKey:ClientId"` |
| | | MemberId int `json:"memberId" gorm:"column:member_id;type:int;comment:负责人id"` |
| | | Member User `json:"member" gorm:"foreignKey:MemberId"` |
| | | MasterOrderId int `json:"masterOrderId" gorm:"column:master_order_id;type:int;comment:销售总单id"` |
| | | MasterOrder MasterOrder `json:"masterOrder" gorm:"foreignKey:MasterOrderId"` |
| | | Number string `json:"number" gorm:"column:number;type:varchar(255);comment:销售子单号"` |
| | | Products []Product `json:"products" gorm:"many2many:subOrder_product;"` |
| | | gorm.Model `json:"-"` |
| | | } |
| | | |
| | |
| | | db = db.Limit(slf.PageSize).Offset((slf.PageNum - 1) * slf.PageSize) |
| | | } |
| | | |
| | | err := db.Preload("Products").Preload("Client").Order("id desc").Find(&records).Error |
| | | err := db.Preload("MasterOrder").Preload("Member").Preload("Products").Preload("Client").Order("id desc").Find(&records).Error |
| | | return records, total, err |
| | | } |
| | | |