/**
* Get Customer List By Query [Rows]
 */
Get Customer List By Query [Rows]
/ ** * Get Customer List By Query [ Rows ] * /
func (this *CustomerModel) GetCustomListByRows(list []*Customer, rows *sql.Rows) []*Customer {
	for rows.Next() {
		c := &Customer{
			Agent:            &Agent{Manager: &Account{}},
			Account:          &Account{},
			Province:         &Province{},
			City:             &City{},
			EntYesterdayInfo: &EntYesterdayInfo{},
			Tags:             make([]*Tag, 0),
		}
		var last_follow_time, account_id, account_name sql.NullString
		err := rows.Scan(&c.CustomerId, &c.EntName, &c.RTXNum, &c.Contacts, &c.Phone, &c.Mobile, &c.QQ,
			&c.Mail, &c.Agent.AgentId, &c.Timex, &c.Assign_status, &last_follow_time, &c.Note,
			&c.Agent.Name, &account_id, &c.City.Id, &c.City.Name, &c.Province.Id, &c.Province.Name, &account_name)
		if err != nil {
			beego.Error(err)
			return list
		}
		lft := GetNullString(last_follow_time)
		c.LastFollowTime = &lft
		c.Account.AccountId = GetNullString(account_id)
		c.Account.Name = GetNullString(account_name)
		c.Tags = this.GetTagList(c.CustomerId)
		c_info := customerCache.GetCustomInfo(c.RTXNum)
		c.Staff = int(c_info.Staff)
		c.Active = int(c_info.Active)
		c.EntYesterdayInfo = customerCache.GetCustomYesInfo(c.RTXNum)
		list = append(list, c)
	}
	rows.Close()
	return list
}
func ( this * CustomerModel ) GetCustomListByRows ( list [ ] * Customer , rows * sql . Rows ) [ ] * Customer { for rows . Next ( ) { c := & Customer { Agent : & Agent { Manager : & Account { } } , Account : & Account { } , Province : & Province { } , City : & City { } , EntYesterdayInfo : & EntYesterdayInfo { } , Tags : make ( [ ] * Tag , 0 ) , } var last_follow_time , account_id , account_name sql . NullString err := rows . Scan ( & c . CustomerId , & c . EntName , & c . RTXNum , & c . Contacts , & c . Phone , & c . Mobile , & c . QQ , & c . Mail , & c . Agent . AgentId , & c . Timex , & c . Assign_status , & last_follow_time , & c . Note , & c . Agent . Name , & account_id , & c . City . Id , & c . City . Name , & c . Province . Id , & c . Province . Name , & account_name ) if err != nil { beego . Error ( err ) return list } lft := GetNullString ( last_follow_time ) c . LastFollowTime = & lft c . Account . AccountId = GetNullString ( account_id ) c . Account . Name = GetNullString ( account_name ) c . Tags = this . GetTagList ( c . CustomerId ) c_info := customerCache . GetCustomInfo ( c . RTXNum ) c . Staff = int ( c_info . Staff ) c . Active = int ( c_info . Active ) c . EntYesterdayInfo = customerCache . GetCustomYesInfo ( c . RTXNum ) list = append ( list , c ) } rows . Close ( ) return list }
Get Customer List By Query [Rows]
Get Customer List By Query [ Rows ]