public string Get(string url) { var sql = new CreatorSql(); return(sql.request2("SELECT cb.block, cm.module_id FROM page p " + "left join content_page cp on p.content_page_id = cp.page_id " + "left join content_module cm on cm.module_id = cp.content_module_id " + "left join content_block cb on cb.id = cm.block_id " + "where " + "p.url = '" + url + "' " + "group by cm.block_id;")); }
public string Get(string url) { var sql = new CreatorSql(); return(sql.request("select " + "CONCAT( " + "CONCAT( " + " '{\"title\":\"', m.title, '\"', " + " ',\"url\":\"', m.url, '\"', " + "',\"type\":\"', m.type, '\"}' " + " ) " + ") as json " + "from menu m " + "where m.menu_name = 'main_menu' " + "order by m.sort ASC; ")); }
public IEnumerable <WeatherForecast> Get() { var sql = new CreatorSql(); var data = sql.request("select cm.module from page p " + "LEFT JOIN content_page cp " + "on cp.page_id = p.content_page_id " + "LEFT JOIN content_module cm " + "on cp.content_module_id = cm.id " + "where " + "p.id = 1;"); var rng = new Random(); return(Enumerable.Range(1, 5).Select(index => new WeatherForecast { Date = DateTime.Now.AddDays(index), TemperatureC = rng.Next(-20, 55), Summary = data }) .ToArray()); }