wangxingcheng 3 éve
szülő
commit
9afe053a42

+ 18 - 3
opms_parent/app/model/cust/cust_customer.go

@@ -6,6 +6,7 @@ package cust
 
 import (
 	"dashoo.cn/opms_libary/request"
+	"github.com/gogf/gf/os/gtime"
 
 	"dashoo.cn/micro/app/model/cust/internal"
 )
@@ -52,9 +53,23 @@ type Information struct {
 
 //返回信息
 type CustList struct {
-	*CustCustomer
-	CuctName  string `p:"cuctName"      json:"cuctName"`
-	TelePhone string `p:"telePhone"      json:"telePhone"`
+	Id           int                  `orm:"id,primary"     json:"id"`           // 主键
+	CustCode     string               `orm:"cust_code"      json:"custCode"`     // 客户编号
+	CustName     string               `orm:"cust_name"      json:"custName"`     // 客户名称
+	AbbrName     string               `orm:"abbr_name"      json:"abbrName"`     // 助记名
+	CustLocation string               `orm:"cust_location"  json:"custLocation"` // 所在地区
+	CustAddress  string               `orm:"cust_address"   json:"custAddress"`  // 详细地址
+	CustStatus   string               `orm:"cust_status"    json:"custStatus"`   // 客户状态(10正常20)
+	DeptId       int                  `orm:"dept_id"        json:"deptId"`       // 所属部门ID
+	DeptName     string               `orm:"dept_name"      json:"deptName"`     // 所属部门
+	SalesId      int                  `orm:"sales_id"       json:"salesId"`      // 所属销售ID
+	FollowUpDate *gtime.Time          `orm:"follow_up_date" json:"followUpDate"` // 最后跟进时间
+	Contact      *CustCustomerContact `orm:"with:cust_id=id"`
+	CuctName     string               `p:"cuctName"      json:"cuctName"`
+	TelePhone    string               `p:"telePhone"      json:"telePhone"`
+	DistName     string               `p:"distName"      json:"distName"`
+	DistLevel    string               `p:"distLevel"      json:"distLevel"` //商机评级
+	Product      string               `p:"product"      json:"product"`     //产品样品
 }
 
 //转移客户参数

+ 23 - 25
opms_parent/app/model/cust/internal/cust_customer.go

@@ -6,33 +6,31 @@ package internal
 
 import (
 	"github.com/gogf/gf/os/gtime"
-
-	"dashoo.cn/micro/app/model/base"
 )
 
 // CustCustomer is the golang structure for table cust_customer.
 type CustCustomer struct {
-	Id           int                   `orm:"id,primary"     json:"id"`           // 主键
-	CustCode     string                `orm:"cust_code"      json:"custCode"`     // 客户编号
-	CustName     string                `orm:"cust_name"      json:"custName"`     // 客户名称
-	AbbrName     string                `orm:"abbr_name"      json:"abbrName"`     // 助记名
-	CustLocation string                `orm:"cust_location"  json:"custLocation"` // 所在地区
-	CustAddress  string                `orm:"cust_address"   json:"custAddress"`  // 详细地址
-	CustStatus   string                `orm:"cust_status"    json:"custStatus"`   // 客户状态(10正常20)
-	IsPublic     string                `orm:"is_public"      json:"isPublic"`     // 公海客户(10是20否)
-	DeptId       int                   `orm:"dept_id"        json:"deptId"`       // 所属部门ID
-	DeptName     string                `orm:"dept_name"      json:"deptName"`     // 所属部门
-	SalesId      int                   `orm:"sales_id"       json:"salesId"`      // 所属销售ID
-	SalesName    string                `orm:"sales_name"     json:"salesName"`    // 所属销售
-	FollowUpDate *gtime.Time           `orm:"follow_up_date" json:"followUpDate"` // 最后跟进时间
-	Remark       string                `orm:"remark"         json:"remark"`       // 备注
-	CreatedBy    int                   `orm:"created_by"     json:"createdBy"`    // 创建者
-	CreatedName  string                `orm:"created_name"   json:"createdName"`  // 创建人
-	CreatedTime  *gtime.Time           `orm:"created_time"   json:"createdTime"`  // 创建时间
-	UpdatedBy    int                   `orm:"updated_by"     json:"updatedBy"`    // 更新者
-	UpdatedName  string                `orm:"updated_name"   json:"updatedName"`  // 更新人
-	UpdatedTime  *gtime.Time           `orm:"updated_time"   json:"updatedTime"`  // 更新时间
-	DeletedTime  *gtime.Time           `orm:"deleted_time"   json:"deletedTime"`  // 删除时间
-	Distributor  *base.BaseDistributor `orm:"with:belong_sale_id = sales_id"`     //
-	Contact      *CustCustomerContact  `orm:"with: id= cust_id"`
+	Id           int         `orm:"id,primary"     json:"id"`           // 主键
+	CustCode     string      `orm:"cust_code"      json:"custCode"`     // 客户编号
+	CustName     string      `orm:"cust_name"      json:"custName"`     // 客户名称
+	AbbrName     string      `orm:"abbr_name"      json:"abbrName"`     // 助记名
+	CustLocation string      `orm:"cust_location"  json:"custLocation"` // 所在地区
+	CustAddress  string      `orm:"cust_address"   json:"custAddress"`  // 详细地址
+	CustStatus   string      `orm:"cust_status"    json:"custStatus"`   // 客户状态(10正常20)
+	IsPublic     string      `orm:"is_public"      json:"isPublic"`     // 公海客户(10是20否)
+	DeptId       int         `orm:"dept_id"        json:"deptId"`       // 所属部门ID
+	DeptName     string      `orm:"dept_name"      json:"deptName"`     // 所属部门
+	SalesId      int         `orm:"sales_id"       json:"salesId"`      // 所属销售ID
+	SalesName    string      `orm:"sales_name"     json:"salesName"`    // 所属销售
+	FollowUpDate *gtime.Time `orm:"follow_up_date" json:"followUpDate"` // 最后跟进时间
+	Remark       string      `orm:"remark"         json:"remark"`       // 备注
+	CreatedBy    int         `orm:"created_by"     json:"createdBy"`    // 创建者
+	CreatedName  string      `orm:"created_name"   json:"createdName"`  // 创建人
+	CreatedTime  *gtime.Time `orm:"created_time"   json:"createdTime"`  // 创建时间
+	UpdatedBy    int         `orm:"updated_by"     json:"updatedBy"`    // 更新者
+	UpdatedName  string      `orm:"updated_name"   json:"updatedName"`  // 更新人
+	UpdatedTime  *gtime.Time `orm:"updated_time"   json:"updatedTime"`  // 更新时间
+	DeletedTime  *gtime.Time `orm:"deleted_time"   json:"deletedTime"`  // 删除时间
+	//Distributor  *base.BaseDistributor `orm:"with:belong_sale_id =sales_id"`      //
+	Contact *CustCustomerContact `orm:"with:cust_id=id"`
 }

+ 2 - 1
opms_parent/app/service/cust/cust_customer.go

@@ -135,7 +135,8 @@ func (c *customerService) GetList(req *model.CustCustomerSearchReq) (total int,
 		req.PageNum = 1
 	}
 	fields := "c.*,ct.cuct_name,ct.telephone"
-	err = Model.Fields(fields).Page(req.PageNum, req.PageSize).Order("id asc").Scan(&customerList)
+	err = Model.Fields(fields).Page(req.PageNum, req.PageSize).Order("c.id asc").Scan(&customerList)
+	
 	return
 }