|
@@ -64,7 +64,8 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
}
|
|
|
condition += limitString;
|
|
|
List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
|
|
|
- DataTable dt = CustomerSqlConn.dtable("SELECT DISTINCT s.Name,s.Id,s.Kind,s.Areas,s.Address,s.Popularity,s.Longitude,s.Latitude,s.ServicePhone,s.CertMerchantName,s.MerchantShortname,s.StoreEntrancePic,s.BusinessName,s.distance FROM(SELECT aa.*, FORMAT(ST_DISTANCE(POINT(aa.Longitude, aa.Latitude), POINT(" + Longitude + ", " + Latitude + ")),2) AS distance FROM (SELECT a.Id,1 Kind,a.Name,a.Areas,a.Address,a.Popularity,a.Longitude,a.Latitude,b.ServicePhone,b.CertMerchantName,b.MerchantShortname,b.StoreEntrancePic,b.QualificationType BusinessName FROM(SELECT Id,Name,Areas,Address,Popularity,Longitude,Latitude,Mobile FROM QrCodePlateMainServer.MerchantInfo WHERE IsAct=1 AND (Status=2 OR QueryCount=2))a LEFT JOIN (SELECT Id,ServicePhone,CertMerchantName,MerchantShortname,StoreEntrancePic,SalesScenesType,Qualifications,QualificationType,BizAddressCode,BizStoreAddress FROM QrCodePlateMainServer.MerchantAddInfo)b ON a.Id=b.Id UNION ALL SELECT a.Id,2 Kind,a.Name,a.Areas,a.Address,a.Popularity,a.Longitude,a.Latitude,b.ServicePhone,b.CertMerchantName,b.MerchantShortname,b.StoreEntrancePic,c.Name BusinessName FROM(SELECT Id,Name,Areas,Address,Popularity,Longitude,Latitude,Mobile FROM QrCodePlateMainServer2.MerchantInfo WHERE IsAct=1 AND (Status=2 OR QueryCount=2))a LEFT JOIN (SELECT Id,ServicePhone,CertMerchantName,MerchantShortname,StoreEntrancePic,BusinessId,BizAddressCode,BizStoreAddress FROM QrCodePlateMainServer2.MerchantAddInfo)b ON a.Id=b.Id LEFT JOIN (SELECT * FROM BusinessScope)c ON b.BusinessId=c.Id)aa)s" + condition, AppConfig.Base.SqlConnStr);
|
|
|
+ var aa = "SELECT DISTINCT s.Name,s.Id,s.Kind,s.Areas,s.Address,s.Popularity,s.Longitude,s.Latitude,s.ServicePhone,s.CertMerchantName,s.MerchantShortname,s.StoreEntrancePic,s.BusinessName,s.distance FROM(SELECT aa.*, FORMAT(ST_DISTANCE_SPHERE(POINT(aa.Longitude, aa.Latitude), POINT(" + Longitude + ", " + Latitude + ")),2) AS distance FROM (SELECT a.Id,1 Kind,a.Name,a.Areas,a.Address,a.Popularity,a.Longitude,a.Latitude,b.ServicePhone,b.CertMerchantName,b.MerchantShortname,b.StoreEntrancePic,b.QualificationType BusinessName FROM(SELECT Id,Name,Areas,Address,Popularity,Longitude,Latitude,Mobile FROM QrCodePlateMainServer.MerchantInfo WHERE IsAct=1 AND (Status=2 OR QueryCount=2))a LEFT JOIN (SELECT Id,ServicePhone,CertMerchantName,MerchantShortname,StoreEntrancePic,SalesScenesType,Qualifications,QualificationType,BizAddressCode,BizStoreAddress FROM QrCodePlateMainServer.MerchantAddInfo)b ON a.Id=b.Id UNION ALL SELECT a.Id,2 Kind,a.Name,a.Areas,a.Address,a.Popularity,a.Longitude,a.Latitude,b.ServicePhone,b.CertMerchantName,b.MerchantShortname,b.StoreEntrancePic,c.Name BusinessName FROM(SELECT Id,Name,Areas,Address,Popularity,Longitude,Latitude,Mobile FROM QrCodePlateMainServer2.MerchantInfo WHERE IsAct=1 AND (Status=2 OR QueryCount=2))a LEFT JOIN (SELECT Id,ServicePhone,CertMerchantName,MerchantShortname,StoreEntrancePic,BusinessId,BizAddressCode,BizStoreAddress FROM QrCodePlateMainServer2.MerchantAddInfo)b ON a.Id=b.Id LEFT JOIN (SELECT * FROM BusinessScope)c ON b.BusinessId=c.Id)aa)s" + condition;
|
|
|
+ DataTable dt = CustomerSqlConn.dtable("SELECT DISTINCT s.Name,s.Id,s.Kind,s.Areas,s.Address,s.Popularity,s.Longitude,s.Latitude,s.ServicePhone,s.CertMerchantName,s.MerchantShortname,s.StoreEntrancePic,s.BusinessName,s.distance FROM(SELECT aa.*, FORMAT(ST_DISTANCE_SPHERE(POINT(aa.Longitude, aa.Latitude), POINT(" + Longitude + ", " + Latitude + ")),2) AS distance FROM (SELECT a.Id,1 Kind,a.Name,a.Areas,a.Address,a.Popularity,a.Longitude,a.Latitude,b.ServicePhone,b.CertMerchantName,b.MerchantShortname,b.StoreEntrancePic,b.QualificationType BusinessName FROM(SELECT Id,Name,Areas,Address,Popularity,Longitude,Latitude,Mobile FROM QrCodePlateMainServer.MerchantInfo WHERE IsAct=1 AND (Status=2 OR QueryCount=2))a LEFT JOIN (SELECT Id,ServicePhone,CertMerchantName,MerchantShortname,StoreEntrancePic,SalesScenesType,Qualifications,QualificationType,BizAddressCode,BizStoreAddress FROM QrCodePlateMainServer.MerchantAddInfo)b ON a.Id=b.Id UNION ALL SELECT a.Id,2 Kind,a.Name,a.Areas,a.Address,a.Popularity,a.Longitude,a.Latitude,b.ServicePhone,b.CertMerchantName,b.MerchantShortname,b.StoreEntrancePic,c.Name BusinessName FROM(SELECT Id,Name,Areas,Address,Popularity,Longitude,Latitude,Mobile FROM QrCodePlateMainServer2.MerchantInfo WHERE IsAct=1 AND (Status=2 OR QueryCount=2))a LEFT JOIN (SELECT Id,ServicePhone,CertMerchantName,MerchantShortname,StoreEntrancePic,BusinessId,BizAddressCode,BizStoreAddress FROM QrCodePlateMainServer2.MerchantAddInfo)b ON a.Id=b.Id LEFT JOIN (SELECT * FROM BusinessScope)c ON b.BusinessId=c.Id)aa)s" + condition, AppConfig.Base.SqlConnStr);
|
|
|
foreach (DataRow dr in dt.Rows)
|
|
|
{
|
|
|
Dictionary<string, object> curData = new Dictionary<string, object>();
|
|
@@ -107,6 +108,9 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
{
|
|
|
var merAddInfo = Services.Main.MerchantAddInfoService.Query(Id);
|
|
|
var merInfo = Services.Main.MerchantInfoService.Query(Id);
|
|
|
+ var info = maindb.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MainModels.MerchantInfo();
|
|
|
+ info.Popularity += 1;
|
|
|
+ maindb.SaveChanges();
|
|
|
BusinessName = merAddInfo.QualificationType;
|
|
|
|
|
|
string[] Atlas = new string[0];
|
|
@@ -130,6 +134,9 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
{
|
|
|
var merAddInfo = Services.Main2.MerchantAddInfoService.Query(Id);
|
|
|
var merInfo = Services.Main2.MerchantInfoService.Query(Id);
|
|
|
+ var info = maindb2.MerchantInfo.FirstOrDefault(m => m.Id == Id) ?? new MainModels2.MerchantInfo();
|
|
|
+ info.Popularity += 1;
|
|
|
+ maindb2.SaveChanges();
|
|
|
BusinessName = Services.Main2.BusinessScopeService.Query(merAddInfo.BusinessId).Name;
|
|
|
|
|
|
string[] Atlas = new string[0];
|
|
@@ -143,7 +150,7 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
Obj.Add("BusinessName", BusinessName); //经营类型
|
|
|
Obj.Add("BusinessHours", merInfo.BusinessHours == null ? "周一至周五 09:00-22:00" : "周一至周五 09:00 - 22:00"); //营业时间
|
|
|
Obj.Add("MerchantMobile", merInfo.Mobile); //商户电话
|
|
|
- Obj.Add("Introduction", merInfo.BriefIntroduction == null ? "待完善..." : "待完善..."); //商户简介
|
|
|
+ Obj.Add("Introduction", merInfo.BriefIntroduction == null ? "暂无信息..." : "暂无信息..."); //商户简介
|
|
|
Obj.Add("Longitude", merInfo.Longitude); //经度
|
|
|
Obj.Add("Latitude", merInfo.Latitude); //纬度
|
|
|
Obj.Add("StoreEntrancePic", Atlas[0]); //门店门头照片
|