Exemplo n.º 1
0
        public static string ChannelcompanyOrderlocation(string comid, int pageindex, int pagesize, string key, int channelcompanyid = 0, string channelcompanytype = "0,1,3,4", string openid = "", string n1 = "", string e1 = "")
        {
            try
            {
                int totalcount = 0;
                var crmdata    = new B2bCrmData();

                List <Member_Channel_company> list = new MemberChannelcompanyData().ChannelcompanyOrderlocation(comid, pageindex, pagesize, key, out totalcount, channelcompanyid, channelcompanytype, n1, e1);

                IEnumerable result = "";
                if (list != null)
                {
                    result = from pro in list
                             //orderby pro.Distance
                             select new
                    {
                        Id                  = pro.Id,
                        Com_id              = pro.Com_id,
                        Companyname         = pro.Companyname,
                        Issuetype           = pro.Issuetype,
                        Whethercreateqrcode = pro.Whethercreateqrcode,
                        Companyaddress      = pro.Companyaddress,
                        Companyphone        = pro.Companyphone,
                        CompanyCoordinate   = pro.CompanyCoordinate,
                        CompanyLocate       = pro.CompanyLocate,
                        Companyimgurl       = FileSerivce.GetImgUrl(pro.Companyimg),
                        Companyintro        = pro.Companyintro,
                        Companyproject      = pro.Companyproject,
                        Distance            = crmdata.CalculateTheCoordinates(openid, pro.Id),
                        m = new WxSubscribeSourceData().GetWXSourceByChannelcompanyid(pro.Id)
                    }
                }


                ;
                return(JsonConvert.SerializeObject(new { type = 100, totalcount = totalcount, msg = result }));
            }
            catch (Exception ex)
            {
                return(JsonConvert.SerializeObject(new { type = 1, msg = ex.Message }));

                throw;
            }
        }