Foxtable(狐表)用户栏目专家坐堂 → 求助:三级分销事宜


  共有2546人关注过本帖树形打印复制链接

主题:求助:三级分销事宜

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/3/26 13:14:00 [显示全部帖子]

不理解你的层级关系。就你的例子,生成的目录树是怎样的?截图说明。

 

最后汇总,得到的结果是怎样的?截图说明。


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/3/26 14:50:00 [显示全部帖子]

1、参考

 


Dim dt As DataTable = DataTables("三级分销主表")
For Each dr As DataRow In dt.Select("")
    Dim s1 As String = ""
    Dim s2 As String = ""
    Dim s3 As String = ""
    For Each cdr As DataRow In dt.Select("上级_编号 = '" & dr("编号") & "'")
        s1 &= cdr("姓名") & ","       
        For Each ccdr As DataRow In dt.Select("上级_编号 = '" & cdr("编号") & "'")
            s2 &= ccdr("姓名") & ","           
            For Each cccdr As DataRow In dt.Select("上级_编号 = '" & ccdr("编号") & "'")
                s3 &= cccdr("姓名") & ","
            Next
        Next
    Next
    dr("一级推荐人员汇总") = s1.trim(",")
    dr("二级推荐人员汇总") = s2.trim(",")
    dr("三级推荐人员汇总") = s3.trim(",")
Next


 

2、参考

 


Dim dt As DataTable = DataTables("三级分销主表")
For Each dr As DataRow In dt.Select("")
    Dim s1 As String = ""
    Dim s2 As String = ""
    Dim s3 As String = ""
    Dim d1 As Double = 0
    Dim d2 As Double = 0
    Dim d3 As Double = 0
    For Each cdr As DataRow In dt.Select("上级_编号 = '" & dr("编号") & "'")
        s1 &= cdr("姓名") & ","
        d1 += cdr("一级佣金")
        For Each ccdr As DataRow In dt.Select("上级_编号 = '" & cdr("编号") & "'")
            s2 &= ccdr("姓名") & ","
            d2 += ccdr("二级佣金")
            For Each cccdr As DataRow In dt.Select("上级_编号 = '" & ccdr("编号") & "'")
                s3 &= cccdr("姓名") & ","
                d3 += cccdr("三级佣金")
            Next
        Next
    Next
    dr("一级推荐人员汇总") = s1.trim(",")
    dr("二级推荐人员汇总") = s2.trim(",")
    dr("三级推荐人员汇总") = s3.trim(",")
    dr("一级佣金汇总") = d1
    dr("二级佣金汇总") = d2
    dr("三级佣金汇总") = d3
Next

[此贴子已经被作者于2019/3/26 14:49:41编辑过]

 回到顶部