mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-09-14 01:35:33 +08:00
26
scripts/fn_GetChannelDealer.sql
Normal file
26
scripts/fn_GetChannelDealer.sql
Normal file
@@ -0,0 +1,26 @@
|
||||
CREATE FUNCTION [RM].[fn_GetChannelDealer] (@UserId BIGINT) RETURNS TABLE AS RETURN (
|
||||
WITH [as_tree_cte] AS (
|
||||
SELECT
|
||||
0 AS cte_level,
|
||||
a.[Id],
|
||||
a.[OwnerId]
|
||||
FROM
|
||||
[RM].[Sys_UserInvite] a
|
||||
WHERE
|
||||
(a.[Id] = @UserId) UNION ALL
|
||||
SELECT
|
||||
wct1.cte_level + 1 AS cte_level,
|
||||
wct2.[Id],
|
||||
wct2.[OwnerId]
|
||||
FROM
|
||||
[as_tree_cte] wct1
|
||||
INNER JOIN [RM].[Sys_UserInvite] wct2 ON wct2.[Id] = wct1.[OwnerId]
|
||||
) SELECT TOP
|
||||
1 a.[Id] AS ChannelDealerId
|
||||
FROM
|
||||
[as_tree_cte] a
|
||||
WHERE
|
||||
a.id <> 370942943322181
|
||||
ORDER BY
|
||||
a.cte_level DESC
|
||||
)
|
@@ -6,7 +6,6 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
@@ -64,14 +63,12 @@ public sealed class Ln
|
||||
<#
|
||||
var xml = new XmlDocument();
|
||||
xml.Load("../assets/res/Ln.resx");
|
||||
foreach (XmlNode data in xml.SelectNodes("//root/data")!)
|
||||
{
|
||||
foreach (XmlNode data in xml.SelectNodes("//root/data")!) {
|
||||
#>
|
||||
/// <summary>
|
||||
/// <#= data.SelectSingleNode("value")?.InnerText #>
|
||||
/// </summary>
|
||||
public static string <#=
|
||||
data.Attributes!["name"].Value.Replace(" ", "_") #> => ResourceManager.GetString("<#= data.Attributes!["name"].Value #>", Culture);
|
||||
public static string <#= data.Attributes!["name"].Value.Replace(" ", "_") #> => ResourceManager.GetString("<#= data.Attributes!["name"].Value #>", Culture);
|
||||
<#
|
||||
}
|
||||
#>
|
||||
|
@@ -29,8 +29,7 @@
|
||||
</resheader>
|
||||
<#
|
||||
var regex = new Regex(@"^\d", RegexOptions.Compiled);
|
||||
foreach (var line in Directory.GetFiles("../assets/res/", "*.ln").SelectMany(x => File.ReadLines(x)).Distinct())
|
||||
{
|
||||
foreach (var line in Directory.GetFiles("../assets/res/", "*.ln").SelectMany(x => File.ReadLines(x)).Distinct()) {
|
||||
#>
|
||||
<data name="<#= regex.IsMatch(line) ? "_" : "" #><#= line #>" xml:space="preserve"><value><#= line #></value></data>
|
||||
<#
|
||||
|
Reference in New Issue
Block a user