用户消费统计 标题筛选逻辑优化
This commit is contained in:
1 parent
fe39437968
commit
35240505e3
10 files changed
+712
-239
No files matched your search
@@ -1050,9 +1050,9 @@ namespace KJD_Web.BLL.WXXD
|
||||
string spu_id = RegexUtils.GetStringQuery(ref inputData, "spu_id")?.Replace("'", "\\'");
|
||||
string product_name = RegexUtils.GetStringQuery(ref inputData, "product_name")?.Replace("'", "\\'");
|
||||
int? commission_rate = RegexUtils.GetStringQuery(ref inputData, "commission_rate").ParseToNullableInt();
|
||||
if (string.IsNullOrEmpty("spu_id"))
|
||||
if (string.IsNullOrEmpty(spu_id))
|
||||
return "{\"code\":50001,\"msg\":\"没有商品Id\"}";
|
||||
if (string.IsNullOrEmpty("product_name"))
|
||||
if (string.IsNullOrEmpty(product_name))
|
||||
return "{\"code\":50001,\"msg\":\"没有商品名称\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
@@ -1155,6 +1155,108 @@ namespace KJD_Web.BLL.WXXD
|
||||
}
|
||||
|
||||
|
||||
public string WXAddMdyQualificationImage(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
|
||||
//int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt();
|
||||
//int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(50);
|
||||
string img_md5 = RegexUtils.GetStringQuery(ref inputData, "img_md5")?.Replace("'", "\\'");
|
||||
string img_base64 = RegexUtils.GetStringQuery(ref inputData, "img_base64")?.Replace("'", "\\'");
|
||||
string img_thumb_base64 = RegexUtils.GetStringQuery(ref inputData, "img_thumb_base64")?.Replace("'", "\\'");
|
||||
string txt_margin = RegexUtils.GetStringQuery(ref inputData, "txt_margin")?.Replace("'", "\\'");
|
||||
if (string.IsNullOrEmpty(img_md5))
|
||||
return "{\"code\":50001,\"msg\":\"没有图片码\"}";
|
||||
if (string.IsNullOrEmpty("product_name"))
|
||||
return "{\"code\":50001,\"msg\":\"没有图片\"}";
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "INSERT INTO wxxd.wx_qualification_image (img_md5,img_base64,img_thumb_base64,txt_margin) VALUES " +
|
||||
" ('" + img_md5 + "','" + img_base64 + "','" + img_thumb_base64 + "','" + txt_margin + "')" +
|
||||
" ON DUPLICATE KEY UPDATE img_base64=VALUES(img_base64),img_thumb_base64=VALUES(img_thumb_base64),txt_margin=VALUES(txt_margin);";
|
||||
|
||||
var rst = mySql.ExecuteAffectedRows(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (!mySql.Message.IsNullOrEmpty())
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"" + mySql.Message + "\"}";
|
||||
}
|
||||
else if (rst < 1)
|
||||
{
|
||||
return "{\"code\":500,\"msg\":\"未新增或更新\"}";
|
||||
}
|
||||
return "{\"code\":200,\"msg\":\"success\"}";
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
public string WXGetQualificationImage(string inputData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
if (!WXUserManage.GetSign(inputData))
|
||||
return "{\"code\":999,\"msg\":\"校验失败\"}";
|
||||
|
||||
int page = RegexUtils.GetStringQuery(ref inputData, "page").ParseToInt(1);
|
||||
int page_size = RegexUtils.GetStringQuery(ref inputData, "page_size").ParseToInt(200);
|
||||
string img_md5 = RegexUtils.GetStringQuery(ref inputData, "img_md5")?.Replace("'", "\\'");
|
||||
string is_detail = RegexUtils.GetStringQuery(ref inputData, "is_detail")?.Replace("'", "\\'");
|
||||
|
||||
string conn = System.Configuration.ConfigurationManager.ConnectionStrings["ConnKJD"].ConnectionString;
|
||||
MysqlUtils mySql = new MysqlUtils(conn);
|
||||
|
||||
string sql = "SELECT * FROM wxxd.wx_qualification_image where 1=1";
|
||||
|
||||
string where = "";
|
||||
if (!string.IsNullOrEmpty(img_md5))
|
||||
where += " and img_md5 in ('" + img_md5.Replace(",", "','") + "')";
|
||||
sql += where;
|
||||
sql += " ORDER BY id DESC";
|
||||
sql += " LIMIT " + (page - 1) * page_size + "," + page_size + ";";
|
||||
|
||||
var dt = mySql.ExecuteDataTable(sql);
|
||||
mySql.Close();
|
||||
|
||||
if (dt != null)
|
||||
{
|
||||
JArray jArr = new JArray();
|
||||
try
|
||||
{
|
||||
foreach (DataRow row in dt.Rows)
|
||||
{
|
||||
JObject jObj = new JObject();
|
||||
jObj["id"] = row["id"].ToString();
|
||||
jObj["img_md5"] = row["img_md5"].ToString();
|
||||
if (is_detail == "true")
|
||||
jObj["img_base64"] = row["img_base64"].ParseToNullableString();
|
||||
jObj["img_thumb_base64"] = row["img_thumb_base64"].ParseToNullableString();
|
||||
jObj["txt_margin"] = row["txt_margin"].ParseToNullableString();
|
||||
jObj["add_time"] = Convert.ToDateTime(row["add_time"]);
|
||||
jObj["mdy_time"] = Convert.ToDateTime(row["mdy_time"]);
|
||||
jArr.Add(jObj);
|
||||
}
|
||||
return "{\"code\":200,\"msg\":\"success\",\"data\":" + JsonUtils.SerializeObject(jArr) + "}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "{\"code\":50002,\"msg\":\"" + ex.Message + "\",\"data\":[]}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "{\"code\":50003,\"msg\":\"" + mySql.Message + "\",\"data\":[]}";
|
||||
}
|
||||
}
|
||||
return "{\"code\":19999,\"msg\":\"输入为空\"}";
|
||||
}
|
||||
|
||||
|
||||
public string E57GetFreightTemplate(string inputData)
|
||||
{
|
||||
if (string.IsNullOrEmpty(inputData))
|
||||
|
||||
@@ -152,6 +152,7 @@
|
||||
<Compile Include="Model\WxModel\WxOptimizeExpressInfo.cs" />
|
||||
<Compile Include="Model\WxModel\WXOrderAmountInfo.cs" />
|
||||
<Compile Include="Model\WxModel\WXOrderDecryptAddressInfo.cs" />
|
||||
<Compile Include="Model\WxModel\wx_qualification_image_info.cs" />
|
||||
<Compile Include="Model\WxProdSecretSpuIdShopIdMapParam.cs" />
|
||||
<Compile Include="Model\WXShopDefaultAddressInfo.cs" />
|
||||
<Compile Include="Utils\ApiRequestLogger.cs" />
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace KJD_Web.Model.WxModel
|
||||
{
|
||||
public class wx_qualification_image_info
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string img_md5 { get; set; }
|
||||
public string img_base64 { get; set; }
|
||||
public string txt_margin { get; set; }
|
||||
public DateTime add_time { get; set; }
|
||||
public DateTime mdy_time { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -311,6 +311,18 @@ namespace KJD_Web
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void wx_add_mdy_qualification_image()
|
||||
{
|
||||
string jsontext = GetRequestJsonString();
|
||||
|
||||
var result = jsontext;
|
||||
result = new WXProductManage().WXAddMdyQualificationImage(jsontext);
|
||||
|
||||
Context.Response.Write(result);
|
||||
Context.Response.End();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public void e57_get_freight_template()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user