📄 yx_cms.txt
字号:
/// <param name="Cnum">内容显示的字数</param>
/// <param name="Tstyle">标题显示的标式名称,直接填写class名称</param>
/// <param name="Cstyle">内容显示的标式名称,直接填写class名称</param>
/// <returns></returns>
public string Hope_PagePro_List(int row, int Tnum, int start, string Par, int Cnum, string Tstyle, string Cstyle)
{
string strid = "";
//查询具体的类别的商品的传递参数:
int classid = 0;
//商品名称
string PtName = "";
string pagelinkurl = "";
if (HttpContext.Current.Request["PtName"] != null)
{
PtName = ClearInputString(HttpContext.Current.Request["PtName"].ToString(), HttpContext.Current.Request["PtName"].ToString().Length);
pagelinkurl += "&PtName=" + HttpContext.Current.Server.UrlEncode(PtName);
}
//关键字
string PtKey = "";
if (HttpContext.Current.Request["PtKey"] != null)
{
PtKey = ClearInputString(HttpContext.Current.Request["PtKey"].ToString(), HttpContext.Current.Request["PtKey"].ToString().Length);
pagelinkurl += "&PtKey=" + HttpContext.Current.Server.UrlEncode(PtKey);
}
//商品编码
string PtNum = "";
if (HttpContext.Current.Request["PtNum"] != null)
{
PtNum = ClearInputString(HttpContext.Current.Request["PtNum"].ToString(), HttpContext.Current.Request["PtNum"].ToString().Length);
pagelinkurl += "&PtNum=" + PtNum;
}
//商品说明
string PtRemark = "";
if (HttpContext.Current.Request["PtRemark"] != null)
{
PtRemark = ClearInputString(HttpContext.Current.Request["PtRemark"].ToString(), HttpContext.Current.Request["PtRemark"].ToString().Length);
pagelinkurl += "&PtRemark=" + HttpContext.Current.Server.UrlEncode(PtRemark);
}
//搜索关键字类别
string SearchKind = "";
string SearchText = "";
if (HttpContext.Current.Request["SearchText"] != null)
{
SearchText = HttpContext.Current.Request["SearchText"].ToString();
if (HttpContext.Current.Request["SearchKind"] != null)
{
SearchKind = HttpContext.Current.Request["SearchKind"].ToString();
if (SearchKind == "1")
{
PtName = ClearInputString(SearchText, SearchText.Length);
pagelinkurl += "&PtName=" + PtName;
}
else if (SearchKind == "2")
{
PtKey = ClearInputString(SearchText, SearchText.Length);
pagelinkurl += "&PtKey=" + PtKey;
}
else if (SearchKind == "4")
{
PtNum = ClearInputString(SearchText, SearchText.Length);
pagelinkurl += "&PtNum=" + PtNum;
}
else
{
PtRemark = ClearInputString(SearchText, SearchText.Length);
pagelinkurl += "&PtRemark=" + PtRemark;
}
}
}
string PtMade = "";
if (HttpContext.Current.Request["PtMade"] != null)
{
PtMade = ClearInputString(HttpContext.Current.Request["PtMade"].ToString(), HttpContext.Current.Request["PtMade"].ToString().Length);
pagelinkurl += "&PtMade=" + HttpContext.Current.Server.UrlEncode(PtMade);
}
//商品价格范围
string PtPrice = "";
if (HttpContext.Current.Request["PtPrice"] != null)
{
PtPrice = HttpContext.Current.Request["PtPrice"].ToString();
pagelinkurl += "&PtPrice=" + HttpContext.Current.Server.UrlEncode(PtPrice);
}
//商品上架时间
int days = 0;
if (HttpContext.Current.Request["days"] != null)
{
days = Convert.ToInt32(HttpContext.Current.Request["days"]);
pagelinkurl += "&days=" + days;
}
//商品热卖
string ReMai = "";
if (HttpContext.Current.Request["ReMai"] != null)
{
ReMai = HttpContext.Current.Request["ReMai"].ToString();
pagelinkurl += "&ReMai=" + ReMai;
}
//商品特价
string TeJia = "";
if (HttpContext.Current.Request["TeJia"] != null)
{
TeJia = HttpContext.Current.Request["TeJia"].ToString();
pagelinkurl += "&TeJia=" + TeJia;
}
//商品推荐
string TuiJian = "";
if (HttpContext.Current.Request["TuiJian"] != null)
{
TuiJian = HttpContext.Current.Request["TuiJian"].ToString();
pagelinkurl += "&TuiJian=" + TuiJian;
}
//商品品牌
int pinpaiid = 0;
if (HttpContext.Current.Request["pinpaiid"] != null)
{
pinpaiid = Convert.ToInt32(HttpContext.Current.Request["pinpaiid"]);
pagelinkurl += "&pinpaiid=" + pinpaiid;
}
//商品类别
if (HttpContext.Current.Request[Par] == "" || HttpContext.Current.Request[Par] == null)
{
classid = 0;
}
else
{
classid = Convert.ToInt32(HttpContext.Current.Request[Par].ToString());
strid = YX_ParentPath(classid);
}
int startnum = 0;
if (HttpContext.Current.Request["startnum"] != null)
{
startnum = Convert.ToInt32(HttpContext.Current.Request["startnum"].ToString());
} //初始化分页参数1(从记录中开始取数据的位置)
int pernum = row;
string ActionShow = "";
if (HttpContext.Current.Request["ActionShow"] != null)
{
ActionShow = HttpContext.Current.Request["ActionShow"].ToString();
}
string Action = "";
if (HttpContext.Current.Request["Action"] != null)
{
Action = HttpContext.Current.Request["Action"].ToString();
}
Exsql.Open();
string sql = "";
StringBuilder Sbuilder = new StringBuilder();
if (classid == 0)
{
sql = "select YX_ProCon,YX_ID,YX_Spic,YX_ProPrice,YX_Class,YX_ProductName,YX_ProDZ,YX_ProDw from YX_Product where YX_Veri=1 ";
}
else
{
sql = "select YX_ProCon,YX_ID,YX_Spic,YX_ProPrice,YX_Class,YX_ProductName,YX_ProDZ,YX_ProDw from YX_Product where YX_Veri=1 and YX_Class in (" + strid + ")";
}
if (pinpaiid != 0)
{
sql += " and yx_pinpai=" + pinpaiid + "";
}
if (PtName != "")
{
sql += " and YX_ProductName like '%" + PtName + "%' ";
}
if (PtKey != "")
{
sql += " and YX_keysword LIKE '%" + PtKey + "%' ";
}
if (PtMade != "")
{
sql += " and YX_ProCD LIKE '%" + PtMade + "%' ";
}
if (PtNum != "")
{
sql += " and YX_BMa like '%" + PtNum + "%'";
}
if (PtRemark != "")
{
sql += " and YX_ProXXCon LIKE '%" + PtRemark + "%'and YX_ProCon LIKE '%" + PtRemark + "%' ";
}
if (ReMai == "1")
{
sql += " and YX_Sm=1";
}
if (TeJia == "2")
{
sql += " and YX_TPrice=1";
}
if (TuiJian == "3")
{
sql += " and YX_Tj=1";
}
if (days != 0)
{
sql += " and getdate()-yx_addtime<=" + days + "";
}
if (PtPrice != "")
{
if (PtPrice == "1")
{
sql += " and YX_ProPrice < 100 ";
}
else if (PtPrice == "2")
{
sql += " and YX_ProPrice >= 100 and YX_ProPrice <= 200 ";
}
else if (PtPrice == "3")
{
sql += " and YX_ProPrice >= 200 and YX_ProPrice <= 500 ";
}
else if (PtPrice == "4")
{
sql += " and YX_ProPrice >= 500 and YX_ProPrice <= 1000 ";
}
else if (PtPrice == "5")
{
sql += " and YX_ProPrice >= 1000 and YX_ProPrice <= 2000 ";
}
else if (PtPrice == "6")
{
sql += " and YX_ProPrice >= 2000 and YX_ProPrice <= 3000 ";
}
else if (PtPrice == "7")
{
sql += " and YX_ProPrice >= 3000 ";
}
}
string sqlnum = sql.Replace("YX_ProCon,YX_ID,YX_Spic,YX_ProPrice,YX_Class,YX_ProductName,YX_ProDZ,YX_ProDw", "count(*)");
string displayaction = "全部显示";
if (Action == "")
{
switch (start)
{
case 0:
sql = sql + " order by YX_Addtime desc,YX_ID desc";
break;
case 1:
sql = sql + " and YX_Tj=1 order by YX_Addtime desc,YX_ID desc";
break;
case 2:
sql = sql + " and YX_TPrice=1 order by YX_Addtime desc,YX_ID desc";
break;
case 3:
sql = sql + " and YX_Sm=1 order by YX_Addtime desc,YX_ID desc";
break;
default:
sql = sql + " order by YX_Addtime desc,YX_ID desc";
break;
}
}
else
{
switch (Action)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -