|
|
|
@@ -3,33 +3,33 @@ package main |
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
"log" |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
|
type crmdLead struct { |
|
|
|
ID string `json:"id,omitempty"` |
|
|
|
Name string `json:"name,omitempty"` |
|
|
|
Deleted bool `json:"deleted,omitempty"` |
|
|
|
SalutationName string `json:"salutationName,omitempty"` |
|
|
|
FirstName string `json:"firstName,omitempty"` |
|
|
|
LastName string `json:"lastName,omitempty"` |
|
|
|
Title string `json:"title,omitempty"` |
|
|
|
Status string `json:"status,omitempty"` |
|
|
|
Source string `json:"source,omitempty"` |
|
|
|
Industry string `json:"industry,omitempty"` |
|
|
|
OpportunityAmount int `json:"opportunityAmount,omitempty"` |
|
|
|
Website string `json:"website,omitempty"` |
|
|
|
AddressStreet string `json:"addressStreet,omitempty"` |
|
|
|
AddressCity string `json:"addressCity,omitempty"` |
|
|
|
AddressState string `json:"addressState,omitempty"` |
|
|
|
AddressCountry string `json:"addressCountry,omitempty"` |
|
|
|
AddressPostalCode string `json:"addresPostalCode,omitempty"` |
|
|
|
EmailAddress string `json:"emailAddress,omitempty"` |
|
|
|
PhoneNumber string `json:"phoneNumber,omitempty"` |
|
|
|
DoNotCall bool `json:"doNotCall,omitempty"` |
|
|
|
Description string `json:"description,omitempty"` |
|
|
|
CreatedAt string `json:"createdAt,omitempty"` |
|
|
|
ModifiedAt string `json:"ModifiedAt,omitempty"` |
|
|
|
crmdEntityBase |
|
|
|
//ID string `json:"id,omitempty"` |
|
|
|
//Name string `json:"name,omitempty"` |
|
|
|
//Deleted bool `json:"deleted,omitempty"` |
|
|
|
SalutationName string `json:"salutationName,omitempty"` |
|
|
|
FirstName string `json:"firstName,omitempty"` |
|
|
|
LastName string `json:"lastName,omitempty"` |
|
|
|
Title string `json:"title,omitempty"` |
|
|
|
Status string `json:"status,omitempty"` |
|
|
|
Source string `json:"source,omitempty"` |
|
|
|
Industry string `json:"industry,omitempty"` |
|
|
|
OpportunityAmount int `json:"opportunityAmount,omitempty"` |
|
|
|
Website string `json:"website,omitempty"` |
|
|
|
AddressStreet string `json:"addressStreet,omitempty"` |
|
|
|
AddressCity string `json:"addressCity,omitempty"` |
|
|
|
AddressState string `json:"addressState,omitempty"` |
|
|
|
AddressCountry string `json:"addressCountry,omitempty"` |
|
|
|
AddressPostalCode string `json:"addresPostalCode,omitempty"` |
|
|
|
EmailAddress string `json:"emailAddress,omitempty"` |
|
|
|
PhoneNumber string `json:"phoneNumber,omitempty"` |
|
|
|
DoNotCall bool `json:"doNotCall,omitempty"` |
|
|
|
//Description string `json:"description,omitempty"` |
|
|
|
//CreatedAt string `json:"createdAt,omitempty"` |
|
|
|
//ModifiedAt string `json:"ModifiedAt,omitempty"` |
|
|
|
AccountName string `json:"accountName,omitempty"` |
|
|
|
Password string `json:"password,omitempty"` |
|
|
|
WechatHitxyID string `json:"wechat_hitxy_id,omitempty"` |
|
|
|
@@ -48,12 +48,12 @@ type crmdLead struct { |
|
|
|
Primary bool `json:"primary,omitempty"` |
|
|
|
Type string `json:"type,omitempty"` |
|
|
|
} `json:"phoneNumberData,omitempty"` |
|
|
|
CreatedByID string `json:"createdById,omitempty"` |
|
|
|
CreatedByName string `json:"createdByName,omitempty"` |
|
|
|
ModifiedByID string `json:"modifiedById,omitempty"` |
|
|
|
ModifiedByName string `json:"modifiedByName,omitempty"` |
|
|
|
AssignedUserID string `json:"assignedUserId,omitempty"` |
|
|
|
AssignedUserName string `json:"assignedUserName,omitempty"` |
|
|
|
//CreatedByID string `json:"createdById,omitempty"` |
|
|
|
//CreatedByName string `json:"createdByName,omitempty"` |
|
|
|
//ModifiedByID string `json:"modifiedById,omitempty"` |
|
|
|
//ModifiedByName string `json:"modifiedByName,omitempty"` |
|
|
|
//AssignedUserID string `json:"assignedUserId,omitempty"` |
|
|
|
//AssignedUserName string `json:"assignedUserName,omitempty"` |
|
|
|
CampaignID string `json:"campaignId,omitempty"` |
|
|
|
CreatedAccountID string `json:"createdAccountId,omitempty"` |
|
|
|
CreatedContactID string `json:"createdContactId,omitempty"` |
|
|
|
@@ -67,34 +67,6 @@ type crmdSearchLead struct { |
|
|
|
List []crmdLead `json:"list"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *crmdLead) getCreatedAt() (r time.Time) { |
|
|
|
layout := m.getTimeLayout() |
|
|
|
r, _ = time.Parse(layout, m.CreatedAt) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func (m *crmdLead) setCreatedAt(v time.Time) string { |
|
|
|
layout := m.getTimeLayout() |
|
|
|
m.CreatedAt = v.Format(layout) |
|
|
|
return m.CreatedAt |
|
|
|
} |
|
|
|
|
|
|
|
func (m *crmdLead) getModifiedAt() (r time.Time) { |
|
|
|
layout := m.getTimeLayout() |
|
|
|
r, _ = time.Parse(layout, m.ModifiedAt) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func (m *crmdLead) setModifiedAt(v time.Time) string { |
|
|
|
layout := m.getTimeLayout() |
|
|
|
m.ModifiedAt = v.Format(layout) |
|
|
|
return m.ModifiedAt |
|
|
|
} |
|
|
|
|
|
|
|
func (m *crmdLead) getTimeLayout() string { |
|
|
|
return getCrmTimeLayout() |
|
|
|
} |
|
|
|
|
|
|
|
func crmFindOpenID(openID string) (info crmdLead, found bool, err error) { |
|
|
|
total, list, err := crmFindEntityByAttr("Lead", "wechat_hitxy_id", openID) |
|
|
|
if err != nil { |