/// <summary> /// 添加数据备份 /// </summary> public static bool Add() { try { string backpath = ShopCache.GetBaseConfig().DataBase_BackPath; string backname = ShopCache.GetBaseConfig().DataBase_BackName; if (backpath.IndexOf("/") == 0) { backpath = System.Web.HttpRuntime.AppDomainAppPath + "/" + backpath; } if (!Directory.Exists(backpath)) { Directory.CreateDirectory(backpath); } if (!backname.Contains(".")) { backname = "." + backname; } backname = System.DateTime.Now.ToString("yyyyMMddhhmmss") + backname; backpath = backpath + "/" + backname; Regex r = new Regex(@"//*/", RegexOptions.Singleline);//目的:防止类似“///”“////”“//////”的情况 backpath = r.Replace(backpath, "/"); string sql = "exec p_backupdb @bkfname='" + backpath + "'"; Common.ExecuteSql(sql); Log.Add("备份数据库");//添加操作记录 return(true); } catch (Exception ex) { Log.Add("备份数据库异常:", ex.Message);//添加操作记录 return(false); } }
protected ShopControl() { SYS = ShopCache.GetBaseConfig(); //CurrentLanguage_ = B_Lebi_Language.GetList("Code='CN'", "").FirstOrDefault(); //CurrentTheme_ = new Lebi_Theme(); CurrentUser = EX_User.CurrentUser(); CurrentUserLevel = B_Lebi_UserLevel.GetModel("id=" + CurrentUser.UserLevel_id + ""); if (CurrentUserLevel == null) { CurrentUserLevel = B_Lebi_UserLevel.GetList("", "Grade desc").FirstOrDefault(); if (CurrentUserLevel == null) { CurrentUserLevel = new Lebi_UserLevel(); Log.Add("会员分组有误", "User_id=" + CurrentUser.id.ToString()); } } WebPath = RequestTool.GetConfigKey("WebPath"); WebPath = WebPath == "/" ? "" : WebPath; if (WebPath != "") { int h = WebPath.Length; if (WebPath.LastIndexOf("/") == h - 1) { WebPath = WebPath.Remove(h - 1); } } }
/// <summary> /// 生成SiteMap字符串 /// </summary> /// <returns></returns> public static string GenerateSiteMapString() { BaseConfig bc = ShopCache.GetBaseConfig(); StringBuilder sb = new StringBuilder(); sb.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?> "); sb.AppendLine("<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"> "); string domain = WebConfig.Instrance.MainDomain;// bc.Domain; string page = ""; foreach (PageInfo pi in url) { page = ShopCache.GetBaseConfig().HTTPServer + "://" + domain + pi.loc; page = page.Replace("&", "&"); sb.AppendLine("<url>"); sb.AppendLine(string.Format("<loc>{0}</loc>", page)); sb.AppendLine(string.Format("<lastmod>{0}</lastmod> ", pi.lastmod.ToString("yyyy-MM-dd"))); //sb.AppendLine(string.Format("<changefreq>{0}</changefreq> ", pi.changefreq)); sb.AppendLine(string.Format("<priority>{0}</priority> ", pi.priority)); sb.AppendLine("</url>"); } sb.AppendLine("</urlset>"); return(sb.ToString()); }
public AdminBase() { if (("," + SYS.PluginUsed + ",").Contains(",Lebi.ERP,")) { IsEditStock = false; } config = ShopCache.GetBaseConfig(); site = new Site(); CurrentLanguage = Language.AdminCurrentLanguage(); CurrentAdminLanguage = Language.AdminCurrentLanguage(); DefaultCurrency = Language.DefaultCurrency(); //page = RequestTool.RequestInt("page", 1); langs = Language.AdminLanguages(); if (CurrentAdminGroup == null) { CurrentAdminGroup = new Lebi_Admin_Group(); } if (site.SiteCount > 1) { //if (Shop.LebiAPI.Service.Instanse.Check("domain3admin")) //{ domain3admin = true; //} } }
/// <summary> /// 订单发货 /// </summary> /// <param name="user"></param> /// <param name="order"></param> /// <param name="torder"></param> public static void Push_ordershipping(Lebi_User user, Lebi_Order order, Lebi_Transport_Order torder) { BaseConfig conf = ShopCache.GetBaseConfig(); if (conf.APPPush_sendmode.Contains("ordershipping")) { if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string list = ""; List <TransportProduct> tps = new List <TransportProduct>(); JavaScriptSerializer jss = new JavaScriptSerializer(); try { tps = jss.Deserialize <List <TransportProduct> >(torder.Product); } catch (Exception) { tps = new List <TransportProduct>(); } foreach (TransportProduct pro in tps) { list += "" + Language.Tag("商品编号", user.Language) + ":" + pro.Product_Number + ";" + Language.Tag("商品", user.Language) + ":" + Language.Content(pro.Product_Name, user.Language) + ";" + Language.Tag("发货数量", user.Language) + ":" + pro.Count + ";"; } string content = Language.Content(conf.SMSTPL_ordershipping, user.Language); content = ReplaceSMSTag(content, user, conf); content = content.Replace("{$OrderNO}", order.Code); content = content.Replace("{$ExpressCompany}", torder.Transport_Name); content = content.Replace("{$ExpressNumber}", torder.Code); content = content.Replace("{$Order}", list); Push(user.Device_system, user.Device_id, content); } }
/// <summary> /// 取得插件设置 /// </summary> /// <returns></returns> public static List <PluginConfig> GetPluginConfig() { List <PluginConfig> ps = new List <PluginConfig>(); string path = System.Web.HttpRuntime.AppDomainAppPath + "/config/"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } DirectoryInfo mydir = new DirectoryInfo(path); FileInfo[] files = mydir.GetFiles(); foreach (FileInfo f in files) { try { string xmlpath = path + f.Name; PluginConfig model = new PluginConfig(); model = (PluginConfig)SerializationHelper.Load(model.GetType(), xmlpath); if (!("," + ShopCache.GetBaseConfig().PluginUsed + ",").Contains("," + model.Assembly + ",")) { continue; } ps.Add(model); //Response.Write(model.Assembly); } catch { continue; } } return(ps); }
public TimeWork() { conf = ShopCache.GetBaseConfig(); licensecheck_start(); orderReceived_start(); cardcheck_start(); AutoAction_10_start(); }
/// <summary> /// 自定义内容 /// </summary> /// <param name="user"></param> public static void SendSMS_custom(string SMScontent, string SMSphone) { BaseConfig conf = ShopCache.GetBaseConfig(); string content = SMScontent; content = ReplaceSMSTag(content, null, conf); Send(SMSphone, content); }
public Site() { BaseConfig bcf = ShopCache.GetBaseConfig(); if (!Shop.LebiAPI.Service.Instanse.Check("managelicenese")) { _SiteName = "LebiShop多语言网店系统"; _title = "LebiShop多语言网店系统"; } else { Lebi_Site s = ShopCache.GetMainSite(); _SiteName = Language.Content(s.Name, "CN"); _title = Language.Content(s.Title, "CN"); } _WebPath = RequestTool.GetConfigKey("WebPath"); _SupplierPath = RequestTool.GetConfigKey("SupplierPath"); _WebPath = _WebPath.TrimEnd('/'); _adminpath = _WebPath + RequestTool.GetConfigKey("AdminPath"); _adminjspath = _WebPath + "/theme/system/systempage/admin/js"; _admincsspath = _WebPath + "/theme/system/systempage/admin/css"; _adminimagepath = _WebPath + "/theme/system/systempage/admin/images"; if (!Shop.LebiAPI.Service.Instanse.Check("lebilicense")) { _SiteName = "LebiShop多语言网店系统"; //Language.Content(bcf.Name, Language.CurrentLanguage().Code); _title = _SiteName; } if (Shop.LebiAPI.Service.Instanse.Check("domain3")) { _SiteCount = B_Lebi_Site.Counts(""); _SiteCount = _SiteCount > 30 ? 30 : 30; //_SiteCount; // _SiteCount; } else if (Shop.LebiAPI.Service.Instanse.Check("domain20")) { _SiteCount = B_Lebi_Site.Counts(""); _SiteCount = _SiteCount > 20 ? 20 : 20; //_SiteCount; // _SiteCount; } else if (Shop.LebiAPI.Service.Instanse.Check("domain10")) { _SiteCount = B_Lebi_Site.Counts(""); _SiteCount = _SiteCount > 10 ? 10 : 10; //_SiteCount; // _SiteCount; } //else if (Shop.LebiAPI.Service.Instanse.Check("domain2")) //{ // _SiteCount = B_Lebi_Site.Counts(""); // _SiteCount = _SiteCount > 2 ? 2 : _SiteCount; // _SiteCount; //} else { _SiteCount = 2; } if (_SiteCount == 0) { _SiteCount = 2; } }
public PageBase() { SYS = ShopCache.GetBaseConfig(); refPage = RequestTool.GetUrlReferrer(); reqPage = RequestTool.GetRequestUrl(); WebPath = RequestTool.GetConfigKey("WebPath").Trim().TrimEnd('/'); WebPath = WebPath == "/" ? "" : WebPath; ImageServer = RequestTool.GetConfigKey("ImageServer").Trim(); CurrentDomain = RequestTool.GetRequestDomain(); webconfig = Shop.Bussiness.WebConfig.Instrance; }
public static string GetUrlToken(string url) { try { return(Shop.Bussiness.EX_User.MD5(ShopCache.GetBaseConfig().InstallCode + url)); } catch { return(""); } }
/// <summary> /// 后台使用的语言 /// </summary> /// <returns></returns> public static List <Lebi_Language_Code> AdminLanguages() { string langs = ShopCache.GetBaseConfig().AdminLanguages; langs = langs == "" ? "CN" : langs; langs = langs.Replace(",", "','"); langs = "'" + langs + "'"; List <Lebi_Language_Code> tmodels = B_Lebi_Language_Code.GetList("Code in (" + langs + ")", "Code asc"); return(tmodels); }
/// <summary> /// 发送手机验证码 /// </summary> /// <param name="user"></param> public static void SendSMS_checkcode(Lebi_User user) { BaseConfig conf = ShopCache.GetBaseConfig(); string content = Language.Content(conf.SMSTPL_checkcode, user.Language); string code = Common.GetRnd(6, true, false, false, false, ""); HttpContext.Current.Session["phonecheckcode"] = user.MobilePhone + code; content = ReplaceSMSTag(content, user, conf); content = content.Replace("{$CheckCode}", code); Send(user.MobilePhone, content); }
/// <summary> /// 生成域名绑定规则 /// </summary> public static void CreateURLRewrite_shop() { HtmlEngine save = new HtmlEngine(); StringBuilder sb = new StringBuilder(); StringBuilder sb1 = new StringBuilder(); string str = HtmlEngine.ReadTxt("httpd.ini"); string str1 = HtmlEngine.ReadTxt(".htaccess"); if (str == "") { sb.AppendLine("[ISAPI_Rewrite]"); } else { sb.AppendLine(HtmlEngine.ReadTxt("httpd.ini")); } if (str1 == "") { sb1.AppendLine("RewriteEngine On"); sb1.AppendLine("RewriteCompatibility2 On"); sb1.AppendLine("RepeatLimit 200"); sb1.AppendLine("RewriteBase"); } else { sb1.AppendLine(HtmlEngine.ReadTxt(".htaccess")); } List <Lebi_Supplier> models = B_Lebi_Supplier.GetList("Domain!=''", ""); if (models.Count == 0) { return; } //RewriteCond %{HTTP_HOST} ^www.shop0769.top$ //RewriteRule ^(.*)$ http://www.shop0769.com/shop/?id=11 Lebi_Site site = B_Lebi_Site.GetModel("1=1 order by Sort desc"); if (site != null) { foreach (Lebi_Supplier model in models) { //sb1.AppendLine(@"RewriteRule //" + model.Domain + "(.*)$ /shop/?id=" + model.id + " [NC,N]"); //sb.AppendLine(@"RewriteRule //" + model.Domain + "/(.*) /$1/shop/?id=" + model.id + " [N,I]"); sb.AppendLine(@"RewriteCond Host ^" + model.Domain + "$"); sb.AppendLine(@"RewriteRule (.*) " + ShopCache.GetBaseConfig().HTTPServer + "://" + site.Domain + "/shop/?id=" + model.id + "$ [N,I]"); sb1.AppendLine(@"RewriteCond %{HTTP_HOST} ^" + model.Domain + "$"); sb1.AppendLine(@"RewriteRule ^(.*)$ " + ShopCache.GetBaseConfig().HTTPServer + "://" + site.Domain + "/shop/?id=" + model.id + " [NC,N]"); } } save.CreateFile("httpd.ini", sb.ToString(), "ascii"); save.CreateFile(".htaccess", sb1.ToString(), "ascii"); }
public static string GetRequestUrlNonDomainToken() { try { return(EX_User.MD5(ShopCache.GetBaseConfig().InstallCode + System.Web.HttpContext.Current.Request.Url.PathAndQuery)); } catch { return(""); } }
/// <summary> /// 保存原始图片的方法 /// 290 成功 /// 291 文件已经存在,请重命名后上传 /// 292 没有可上传的文件 /// 293 格式不支持 /// 294 修剪尺寸不能是0 /// 295 文件不存在 /// 296 异常 /// 297 长度超限 /// </summary> /// <param name="FileUpload"></param> /// <param name="path"></param> /// <param name="fileName"></param> /// <returns></returns> public static int UPLoad(HttpPostedFile FileUpload, string Path, string FileName) { Path = ServerPath + Path + "/"; if (!File.Exists(Path)) //如果路径不存在,则创建 { System.IO.Directory.CreateDirectory(Path); } if (FileUpload.ContentLength > 1) //如果是true,则表示该控件有文件要上传 { string fileContentType = FileUpload.ContentType; string name = FileUpload.FileName; //返回文件在客户端的完全路径(包括文件名全称) FileInfo file = new FileInfo(name); //FileInfo对象表示磁盘或网络位置上的文件。提供文件的路径,就可以创建一个FileInfo对象: string webFilePath = Path + FileName; //完整的存储路径 if (FileUpload.ContentLength > Convert.ToDecimal(ShopCache.GetBaseConfig().UpLoadLimit) * 1024 * 1024) { return(297); } if (File.Exists(webFilePath)) { File.Delete(webFilePath); } try { FileUpload.SaveAs(webFilePath); if (!IsAllowedExtension(webFilePath)) { File.Delete(webFilePath); return(296); } //bool flag = CheckPictureSafe(webFilePath); //if (flag) return(290); //else // return 296; } catch (Exception ex) { return(296); //Msg = ex.Message; } //else //{ // return 291; // //Msg = "文件已经存在,请重命名后上传!"; //} } else { return(292); //Msg = "没有可上传的文件"; } }
public Site_Agent() { BaseConfig bcf = ShopCache.GetBaseConfig(); _WebPath = RequestTool.GetConfigKey("WebPath"); _WebPath = _WebPath.TrimEnd('/'); _adminpath = _WebPath + "/agent"; _adminjspath = _adminpath + "/js"; _admincsspath = _adminpath + "/css"; _adminimagepath = _adminpath + "/images"; }
/// <summary> /// /// </summary> /// <param name="user"></param> /// <param name="money"></param> /// <param name="type"></param> /// <param name="admin"></param> /// <param name="description"></param> /// <param name="remark"></param> /// <param name="fanxian">是否包含返现款消费</param> public static void AddMoney(Lebi_User user, decimal money, int type, Lebi_Administrator admin, string description, string remark, bool fanxian = true) { if (money == 0) { return; } Lebi_User_Money mo = new Lebi_User_Money(); if (admin != null) { mo.Admin_id = admin.id; mo.Admin_UserName = admin.UserName; } mo.Money = money; mo.Type_id_MoneyStatus = 181; mo.Type_id_MoneyType = type; mo.User_id = user.id; mo.User_UserName = user.UserName; mo.User_RealName = user.RealName; mo.Description = description; mo.Remark = remark; //string money_ = B_Lebi_User_Money.GetValue("sum(Money)", "User_id=" + user.id + " and Type_id_MoneyStatus=181"); //decimal Money = 0; //Decimal.TryParse(money_, out Money); if (type == 195)//返现 { user.Money_fanxian = user.Money_fanxian + money; } if (type == 192 && fanxian == true)//消费 { user.Money_fanxian = user.Money_fanxian + money; if (user.Money_fanxian < 0) { user.Money_fanxian = 0; } } user.Money = user.Money + money; B_Lebi_User.Update(user); mo.Money_after = user.Money; mo.Money_fanxian_after = user.Money_fanxian; B_Lebi_User_Money.Add(mo); //发送短信 if (ShopCache.GetBaseConfig().SMS_sendmode.Contains("SMSTPL_balance")) { SMS.SendSMS_balance(user); } }
/// <summary> /// 订单留言 /// </summary> /// <param name="user"></param> public static void SendSMS_ordercomment(Lebi_User user, Lebi_Comment model) { BaseConfig conf = ShopCache.GetBaseConfig(); int IsAdminSms = 0; int IsSupplierSms = 0; if (conf.SMS_sendmode.Contains("SMSTPL_Admin_ordercomment")) { IsAdminSms = 1; } Lebi_Order order = B_Lebi_Order.GetModel(model.Keyid); if (order == null) { order = new Lebi_Order(); } if (order.Supplier_id > 0) { Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(order.Supplier_id); if (supplier.IsSupplierTransport == 0) //商家发货 { if (ShopCache.GetBaseConfig_Supplier(order.Supplier_id).SMS_sendmode.Contains("SMSTPL_Admin_ordercomment")) { IsSupplierSms = 1; } } } if (IsAdminSms == 0 && IsSupplierSms == 0) { return; } if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string Admin_content = Language.Content(conf.SMSTPL_Admin_ordercomment, user.Language); Admin_content = ReplaceSMSTag(Admin_content, user, conf); Admin_content = Admin_content.Replace("{$Content}", model.Content); Admin_content = Admin_content.Replace("{$OrderNO}", order.Code); if (IsAdminSms == 1) { Send(conf.SMS_reciveno, Admin_content); } if (IsSupplierSms == 1) { BaseConfig_Supplier config_supplier = ShopCache.GetBaseConfig_Supplier(order.Supplier_id); Send(config_supplier.SMS_reciveno, Admin_content); } }
/// <summary> /// 商品咨询 /// </summary> /// <param name="user"></param> /// <param name="model"></param> public static void SendSMS_ask(Lebi_User user, Lebi_Comment model) { BaseConfig conf = ShopCache.GetBaseConfig(); int IsAdminSms = 0; int IsSupplierSms = 0; if (conf.SMS_sendmode.Contains("SMSTPL_ask")) { IsAdminSms = 1; } Lebi_Product product = B_Lebi_Product.GetModel(model.Product_id); if (product == null) { product = new Lebi_Product(); } if (product.Supplier_id > 0) { Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(product.Supplier_id); if (supplier.IsSupplierTransport == 0) //商家发货 { if (ShopCache.GetBaseConfig_Supplier(product.Supplier_id).SMS_sendmode.Contains("SMSTPL_ask")) { IsSupplierSms = 1; } } } if (IsAdminSms == 0 && IsSupplierSms == 0) { return; } if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string list = "" + Language.Tag("商品名称", user.Language) + ":" + Language.Content(product.Name, user.Language) + ";" + Language.Tag("内容", user.Language) + ":" + model.Content + ";"; string Admin_content = Language.Content(conf.SMSTPL_Admin_ask, user.Language); Admin_content = ReplaceSMSTag(Admin_content, user, conf); Admin_content = Admin_content.Replace("{$Content}", list); if (IsAdminSms == 1) { Send(conf.SMS_reciveno, Admin_content); } if (IsSupplierSms == 1) { BaseConfig_Supplier config_supplier = ShopCache.GetBaseConfig_Supplier(product.Supplier_id); Send(config_supplier.SMS_reciveno, Admin_content); } }
/// <summary> /// 找回密码 /// </summary> /// <param name="user"></param> public static void SendSMS_forgetpwd(Lebi_User user) { BaseConfig conf = ShopCache.GetBaseConfig(); if (conf.SMS_sendmode.Contains("SMSTPL_getpwd")) { if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string content = Language.Content(conf.SMSTPL_getpwd, user.Language); content = ReplaceSMSTag(content, user, conf); Send(user.MobilePhone, content); } }
/// <summary> /// 处理区域代理过期 /// </summary> public static void AgentAreaEnd() { int d = 0; int.TryParse(ShopCache.GetBaseConfig().AgentEndDays, out d); d = 0 - d; List <Lebi_Agent_Area> areas = B_Lebi_Agent_Area.GetList("User_id>0 and Time_end<'" + System.DateTime.Now.Date.AddDays(d) + "')", ""); foreach (Lebi_Agent_Area area in areas) { area.User_id = 0; area.User_UserName = ""; B_Lebi_Agent_Area.Update(area); } }
/// <summary> /// 余额提醒 /// </summary> /// <param name="user"></param> public static void Push_balance(Lebi_User user) { BaseConfig conf = ShopCache.GetBaseConfig(); if (conf.APPPush_sendmode.Contains("balance")) { if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string content = Language.Content(conf.SMSTPL_balance, user.Language); content = ReplaceSMSTag(content, user, conf); content = content.Replace("{$Money}", Math.Round(user.Money, 2).ToString()); Push(user.Device_system, user.Device_id, content); } }
/// <summary> /// 处理商品代理过期 /// </summary> public static void AgentProductEnd() { int d = 0; int.TryParse(ShopCache.GetBaseConfig().AgentEndDays, out d); d = 0 - d; List <Lebi_Agent_Product_User> users = B_Lebi_Agent_Product_User.GetList("User_id>0 and Time_end<'" + System.DateTime.Now.Date.AddDays(d) + "'", ""); foreach (Lebi_Agent_Product_User user in users) { //user.IsFailure = 1; B_Lebi_Agent_Product_User.Delete(user.id); //清除代理商品绑定 Common.ExecuteSql("update [Lebi_Agent_Product] set User_id=0,User_UserName='' where User_id=" + user.id + ""); } }
public static void ThreadPush(string system, string token, string msg) { BaseConfig model = ShopCache.GetBaseConfig(); if (model.APPPush_state == "1") { if (system == "ios") { ApplePush(token, msg); } else { AndroidPush(token, msg); } } }
private int _SiteCount = 0;//用户的站点数量 public Site_Supplier() { BaseConfig bcf = ShopCache.GetBaseConfig(); if (!Shop.LebiAPI.Service.Instanse.Check("managelicenese")) { _SiteName = "LebiShop网上商店系统"; _title = "LebiShop网上商店系统"; } else { Lebi_Site s = ShopCache.GetMainSite(); _SiteName = Language.Content(s.Name, "CN"); _title = Language.Content(s.Title, "CN"); } _WebPath = RequestTool.GetConfigKey("WebPath"); _WebPath = _WebPath.TrimEnd('/'); _adminpath = RequestTool.GetConfigKey("SupplierPath"); _adminjspath = _WebPath + "/theme/system/systempage/supplier/js"; _admincsspath = _WebPath + "/theme/system/systempage/supplier/css"; _adminimagepath = _WebPath + "/theme/system/systempage/supplier/images"; _adminassetspath = _WebPath + "/system/systempage/supplier/assets"; _ThemeDomain = RequestTool.GetConfigKey("ThemeDomain"); _ThemeDomain = _ThemeDomain.TrimEnd('/'); if (!string.IsNullOrEmpty(_ThemeDomain)) { _adminjspath = _ThemeDomain + "/system/systempage/supplier/js"; _admincsspath = _ThemeDomain + "/system/systempage/supplier/css"; _adminimagepath = _ThemeDomain + "/system/systempage/supplier/images"; _adminassetspath = _ThemeDomain + "/system/systempage/supplier/assets"; } if (!Shop.LebiAPI.Service.Instanse.Check("lebilicense")) { _SiteName = Language.Content(bcf.Name, Language.CurrentLanguage().Code); _title = _SiteName; } if (!Shop.LebiAPI.Service.Instanse.Check("domain3")) { _SiteCount = 1; } else { _SiteCount = B_Lebi_Site.Counts(""); _SiteCount = _SiteCount > 3 ? 3 : _SiteCount; } }
/// <summary> /// 商品咨询管理员回复 /// </summary> /// <param name="model"></param> public static void SendSMS_askreply(Lebi_Comment model) { BaseConfig conf = ShopCache.GetBaseConfig(); if (conf.SMS_sendmode.Contains("SMSTPL_ask")) { Lebi_User user = B_Lebi_User.GetModel(model.User_id); if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string content = Language.Content(conf.SMSTPL_ask, user.Language); content = ReplaceSMSTag(content, user, conf); content = content.Replace("{$Content}", model.Content); Send(user.MobilePhone, content); } }
/// <summary> /// 预定商品到货 /// </summary> /// <param name="user"></param> /// <param name="order"></param> /// <param name="pro"></param> public static void Push_reserveok(Lebi_User user, Lebi_Order order, Lebi_Order_Product pro) { BaseConfig conf = ShopCache.GetBaseConfig(); if (conf.APPPush_sendmode.Contains("reserveok")) { if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string content = Language.Content(conf.SMSTPL_reserveok, user.Language); content = ReplaceSMSTag(content, user, conf); content = content.Replace("{$OrderNO}", order.Code); //content = content.Replace("{$OrderNO}", order.Code); Push(user.Device_system, user.Device_id, content); } }
/// <summary> /// 商品咨询管理员回复 /// </summary> /// <param name="model"></param> public static void Push_askreply(Lebi_Comment model) { BaseConfig conf = ShopCache.GetBaseConfig(); if (conf.APPPush_sendmode.Contains("ask")) { Lebi_User user = B_Lebi_User.GetModel(model.User_id); if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string content = Language.Content(conf.SMSTPL_ask, user.Language); content = ReplaceSMSTag(content, user, conf); content = content.Replace("{$Content}", model.Content); Push(user.Device_system, user.Device_id, content); } }
/// <summary> /// 预定商品到货 /// </summary> /// <param name="user"></param> /// <param name="order"></param> /// <param name="pro"></param> public static void SendSMS_reserveok(Lebi_User user, Lebi_Order order, Lebi_Order_Product pro) { BaseConfig conf = ShopCache.GetBaseConfig(); if (conf.SMS_sendmode.Contains("SMSTPL_reserveok")) { if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string content = Language.Content(conf.SMSTPL_reserveok, user.Language); content = ReplaceSMSTag(content, user, conf); content = content.Replace("{$OrderNO}", order.Code); //content = content.Replace("{$OrderNO}", order.Code); Send(user.MobilePhone, content); } }