using CoreEntity.ESEntity; using Newtonsoft.Json; using SupplierWeb.Commonss; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace MemberWeb.Commonss.EsDAL { #region 订单code实体类 public class Condition { /// /// /// public string name { get; set; } /// /// /// public string type { get; set; } } #endregion public class Orderscode { /// /// /// public List columns { get; set; } /// /// /// public List> rows { get; set; } } public class OrderDAL { /// /// 根据电话号码,获取他所有的订单编号 /// /// /// public static string GetPrescriptionOderscode(dynamic data, string filter) { string code = ""; data = new { query = "select OrdersCode from mem_order where 1=1 " + filter + "" }; var ordersql = JsonConvert.SerializeObject(data); string orderstr = Util.ElasticQuery("_sql?format=json", "POST", ordersql); Orderscode orderscode = EsCommon.FromJSON(orderstr); for (int i = orderscode.rows.Count - 1; i >= 0; i--) { if (i > 0) { code += "'" + orderscode.rows[i][0] + "',"; } else { code += "'" + orderscode.rows[i][0] + "'"; } } return code; } } }