Example #1
0
        public static Lebi_Agent_User User_Commission(int id)
        {
            Lebi_Agent_User model = B_Lebi_Agent_User.GetModel("User_id = " + id + "");

            if (model == null)
            {
                model = new Lebi_Agent_User();
            }
            return(model);
        }
Example #2
0
        private decimal GetAngentCommission3(Lebi_DT_Agent dt_agent, Lebi_User user)
        {
            if (user != null)
            {
                Lebi_UserLevel userlevel = B_Lebi_UserLevel.GetModel(user.UserLevel_id);
                if (userlevel != null)
                {
                    if (userlevel.IsUsedAgent == 0) //关闭推广佣金
                    {
                        return(0);
                    }
                }
                if (dt_agent != null)
                {
                    if (dt_agent.IsUsedAgent == 0)
                    {
                        return(0);
                    }
                    if (dt_agent.Angent3_Commission != -1)
                    {
                        return(dt_agent.Angent3_Commission);
                    }
                }
                Lebi_Agent_User agent_user = B_Lebi_Agent_User.GetModel("User_id = " + user.id + "");
                if (agent_user != null)
                {
                    if (agent_user.Angent3_Commission != -1)
                    {
                        return(agent_user.Angent3_Commission);
                    }
                }
                Lebi_Agent_UserLevel agent_userlevel = B_Lebi_Agent_UserLevel.GetModel("UserLevel_id = " + user.UserLevel_id + "");
                if (agent_userlevel != null)
                {
                    if (agent_userlevel.Angent3_Commission != -1)
                    {
                        return(agent_userlevel.Angent3_Commission);
                    }
                }
            }
            decimal yongjin = 0;//3级佣金比例

            decimal.TryParse(bc.Angent3_Commission, out yongjin);
            return(yongjin);
        }
Example #3
0
        public static Model Info(Lebi_User user)
        {
            BaseConfig bc     = ShopCache.GetBaseConfig();
            Model      m      = new Model();
            decimal    Money  = 0;
            string     money_ = Common.GetValue("select sum(Money) from Lebi_Agent_Money where User_id=" + user.id + " and Type_id_AgentMoneyStatus=382 and datediff(d,Time_add,'" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "')>" + bc.CommissionMoneyDays + "");

            decimal.TryParse(money_, out Money);
            int UserCount = 0;

            UserCount = B_Lebi_User.Counts("User_id_parent=" + user.id + "");
            int UserCountmonth = 0;

            UserCountmonth = B_Lebi_User.Counts("User_id_parent=" + user.id + " and (datediff(d,Time_Reg,'" + System.DateTime.Now.Date.AddDays(0 - System.DateTime.Now.Day + 1).ToString("yyyy-MM-dd") + "')<=0 and datediff(d,Time_Reg,'" + System.DateTime.Now + "')>=0)");
            int UserCountday = 0;

            UserCountday = B_Lebi_User.Counts("User_id_parent=" + user.id + " and (datediff(d,Time_Reg,'" + System.DateTime.Now.Date.ToString("yyyy-MM-dd") + "')<=0 and datediff(d,Time_Reg,'" + System.DateTime.Now + "')>=0)");
            decimal Commission1 = 0;
            decimal Commission2 = 0;
            decimal Commission3 = 0;

            decimal.TryParse(bc.Angent1_Commission, out Commission1);
            decimal.TryParse(bc.Angent2_Commission, out Commission2);
            decimal.TryParse(bc.Angent3_Commission, out Commission3);
            if (user.DT_id == 0)
            {
                Lebi_Agent_UserLevel agent_userlevel = B_Lebi_Agent_UserLevel.GetModel("UserLevel_id = " + user.UserLevel_id + "");
                if (agent_userlevel != null)
                {
                    if (agent_userlevel.Angent1_Commission != -1)
                    {
                        Commission1 = agent_userlevel.Angent1_Commission;
                    }
                    if (agent_userlevel.Angent2_Commission != -1)
                    {
                        Commission2 = agent_userlevel.Angent2_Commission;
                    }
                    if (agent_userlevel.Angent3_Commission != -3)
                    {
                        Commission3 = agent_userlevel.Angent3_Commission;
                    }
                }
                Lebi_Agent_User agent_user = B_Lebi_Agent_User.GetModel("User_id = " + user.id + "");
                if (agent_user != null)
                {
                    if (agent_user.Angent1_Commission != -1)
                    {
                        Commission1 = agent_user.Angent1_Commission;
                    }
                    if (agent_user.Angent2_Commission != -1)
                    {
                        Commission2 = agent_user.Angent2_Commission;
                    }
                    if (agent_user.Angent3_Commission != -1)
                    {
                        Commission3 = agent_user.Angent3_Commission;
                    }
                }
            }
            else
            {
                Lebi_DT_Agent dt_agent = B_Lebi_DT_Agent.GetModel("DT_id = " + user.DT_id + "");
                if (dt_agent != null)
                {
                    if (dt_agent.IsUsedAgent == 1)
                    {
                        Commission1 = dt_agent.Angent1_Commission;
                        Commission2 = dt_agent.Angent2_Commission;
                        Commission3 = dt_agent.Angent3_Commission;
                    }
                }
            }
            m.Money          = Money;
            m.UserCount      = UserCount;
            m.UserCountmonth = UserCountmonth;
            m.UserCountday   = UserCountday;
            m.Commission1    = Commission1;
            m.Commission2    = Commission2;
            m.Commission3    = Commission3;
            Lebi_UserLevel userlevel = B_Lebi_UserLevel.GetModel(user.UserLevel_id);

            if (userlevel != null)
            {
                if (userlevel.IsUsedAgent == 0) //关闭注册
                {
                    m.Commission1 = 0;
                    m.Commission2 = 0;
                    m.Commission3 = 0;
                }
            }
            return(m);
        }