1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- 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
- {
- /// <summary>
- ///
- /// </summary>
- public string name { get; set; }
- /// <summary>
- ///
- /// </summary>
- public string type { get; set; }
- }
- #endregion
- public class Orderscode
- {
- /// <summary>
- ///
- /// </summary>
- public List<Condition> columns { get; set; }
- /// <summary>
- ///
- /// </summary>
- public List<List<string>> rows { get; set; }
- }
- public class OrderDAL
- {
- /// <summary>
- /// 根据电话号码,获取他所有的订单编号
- /// </summary>
- /// <param name="data"></param>
- /// <returns></returns>
- 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<Orderscode>(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;
- }
- }
- }
|