public pShowModel Getorderform(int stata = 0, string searchId = "") { List <orderform> orderformlist = new List <orderform>(); using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Sqlconn"].ToString())) { if (stata == 0) { orderformlist = conn.Query <orderform>($"select od.*,sh.Sname,sh.Stitle,sh.Simg,sh.Sprice,sh.Scolor,sh.Ssnum,sh.Sdescribe,(case od.OF_status when 1 then '待处理' when 2 then '揽货中' when 3 then '已发货' when 4 then '已完成' when 5 then '取消订单' when 6 then '退货' end) as status from orderform od join Shop sh on od.Shop_Sid = sh.Sid").ToList(); } if (searchId != "") { orderformlist = conn.Query <orderform>($"select od.*,sh.Sname,sh.Stitle,sh.Simg,sh.Sprice,sh.Scolor,sh.Ssnum,sh.Sdescribe,(case od.OF_status when 1 then '待处理' when 2 then '揽货中' when 3 then '已发货' when 4 then '已完成' when 5 then '取消订单' when 6 then '退货' end) as status from orderform od join Shop sh on od.Shop_Sid = sh.Sid where sh.Sname like '%{searchId}%'").ToList(); } if (stata != 0) { orderformlist = conn.Query <orderform>($"select od.*,sh.Sname,sh.Stitle,sh.Simg,sh.Sprice,sh.Scolor,sh.Ssnum,sh.Sdescribe,(case od.OF_status when 1 then '待处理' when 2 then '揽货中' when 3 then '已发货' when 4 then '已完成' when 5 then '取消订单' when 6 then '退货' end) as status from orderform od join Shop sh on od.Shop_Sid = sh.Sid where od.OF_status={stata}").ToList(); } } pShowModel model = new pShowModel(); model.code = 200; model.msg = "msg"; model.count = orderformlist.Count(); model.data = orderformlist; return(model); }
public pShowModel Getbufen(int id = 7) { List <orderform> orderformlist = new List <orderform>(); using (SqlConnection conn = new SqlConnection(Mysql)) { orderformlist = conn.Query <orderform>($"select od.*,sh.Sname,sh.Stitle,sh.Simg,sh.Sprice,sh.Scolor,sh.Ssnum,sh.Sdescribe,(case od.OF_status when 1 then '待处理' when 2 then '揽货中' when 3 then '已发货' when 4 then '已完成' when 5 then '取消订单' when 6 then '退货' end) as status from orderform od join Shop sh on od.Shop_Sid = sh.Sid where od.OF_Id={id}").ToList(); } pShowModel model = new pShowModel(); model.code = 200; model.msg = "msg"; model.count = orderformlist.Count(); model.data = orderformlist; return(model); }