/// <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> /// <param name="torder"></param> public static void SendSMS_orderrecive(Lebi_User user, Lebi_Transport_Order torder) { BaseConfig conf = ShopCache.GetBaseConfig(); int IsAdminSms = 0; int IsSupplierSms = 0; if (conf.SMS_sendmode.Contains("SMSTPL_Admin_orderrecive")) { IsAdminSms = 1; } Lebi_Order order = B_Lebi_Order.GetModel("id=" + torder.Order_id + ""); if (order.Supplier_id > 0) { if (ShopCache.GetBaseConfig_Supplier(order.Supplier_id).SMS_sendmode.Contains("SMSTPL_Admin_orderrecive")) { 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_orderrecive, user.Language); Admin_content = ReplaceSMSTag(Admin_content, user, conf); 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="order"></param> public static void SendSMS_ordersubmit(Lebi_User user, Lebi_Order order) { BaseConfig conf = ShopCache.GetBaseConfig(); int IsUserSms = 0; int IsUserSms2 = 0; int IsAdminSms = 0; int IsSupplierSms = 0; if (conf.SMS_sendmode.Contains("SMSTPL_ordersubmit")) { IsUserSms = 1; } if (conf.SMS_sendmode.Contains("SMSTPL_Admin_ordersubmit")) { IsAdminSms = 1; } if (conf.SMS_sendmode.Contains("SMSTPL_orderpickup")) { IsUserSms2 = 1; } if (order.Supplier_id > 0) { if (ShopCache.GetBaseConfig_Supplier(order.Supplier_id).SMS_sendmode.Contains("SMSTPL_Admin_ordersubmit")) { IsSupplierSms = 1; } } if (IsUserSms == 0 && IsUserSms2 == 0 && IsAdminSms == 0 && IsSupplierSms == 0) { return; } if (user.Language == "") { user.Language = Language.Languages().FirstOrDefault().Code; } string list = ""; List <Lebi_Order_Product> pros = B_Lebi_Order_Product.GetList("Order_id=" + order.id + "", ""); foreach (Lebi_Order_Product pro in pros) { 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 + ";"; } if (IsUserSms == 1) { string content = Language.Content(conf.SMSTPL_ordersubmit, user.Language); content = ReplaceSMSTag(content, user, conf); content = content.Replace("{$OrderNO}", order.Code); content = content.Replace("{$Money}", Language.FormatMoney(order.Money_Order, order.Currency_Code)); content = content.Replace("{$Order}", list); Send(order.T_MobilePhone, content); } if (IsAdminSms == 1 || IsSupplierSms == 1) { string Admin_content = Language.Content(conf.SMSTPL_Admin_ordersubmit, user.Language); Admin_content = ReplaceSMSTag(Admin_content, user, conf); Admin_content = Admin_content.Replace("{$OrderNO}", order.Code); Admin_content = Admin_content.Replace("{$Money}", Language.FormatMoney(order.Money_Order, order.Currency_Code)); Admin_content = Admin_content.Replace("{$Order}", list); string transport = "order.Transport_Name"; if (order.PickUp_Name != "") { transport += "|" + order.PickUp_Name + "|" + order.PickUp_Date.ToString("yyyy-MM-dd"); } Admin_content = Admin_content.Replace("{$Transport}", transport); 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); } } if (IsUserSms2 == 1) { string content = Language.Content(conf.SMSTPL_orderpickup, user.Language); content = ReplaceSMSTag(content, user, conf); content = content.Replace("{$OrderNO}", order.Code); content = content.Replace("{$Money}", Language.FormatMoney(order.Money_Order, order.Currency_Code)); content = content.Replace("{$Order}", list); content = content.Replace("{$PickUpStation}", order.PickUp_Name); content = content.Replace("{$PickUpTime}", order.PickUp_Date.ToString("yyyy-MM-dd")); Send(order.T_MobilePhone, content); } }