Пример #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="group"></param>
 /// <param name="account"></param>
 /// <returns></returns>
 public static Recharge GetHistoryInfo(String id)
 {
     try
     {
         String          sql          = String.Format("select * from recharge_history where id = '{0}' ", id);
         DataTable       dataTable    = DBUtils.QueryData(sql);
         List <Recharge> userAccounts = dataTable.GetListByTableName <Recharge>();
         if (userAccounts != null && userAccounts.Count > 0)
         {
             return(userAccounts[0]);
         }
         return(null);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Пример #2
0
 /// <summary>
 /// 获取账号信息
 /// </summary>
 public static UserAccount GetInfo(String userName)
 {
     try
     {
         String             sql          = String.Format("select * from accounts where accounts = '{0}'", userName);
         DataTable          dataTable    = DBUtils.QueryData(sql);
         List <UserAccount> userAccounts = dataTable.GetListByTableName <UserAccount>();
         if (userAccounts != null && userAccounts.Count > 0)
         {
             return(userAccounts[0]);
         }
         return(null);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="group"></param>
        /// <param name="account"></param>
        /// <returns></returns>
        public static List <Recharge> GetHistoryListByToday()
        {
            try
            {
                String          updated_at   = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd 23:30:00");
                String          sql          = String.Format("select a.* from recharge_history a left join recharge b on a.id = b.id where a.payState = 0 and a.pay_querycount < 4 and b.id is null and a.updated_at >= '{0}' ", updated_at);
                DataTable       dataTable    = DBUtils.QueryData(sql);
                List <Recharge> userAccounts = dataTable.GetListByTableName <Recharge>();

                if (userAccounts != null && userAccounts.Count > 0)
                {
                    List <String> ids = userAccounts.Select(A => A.kid).ToList();
                    sql = "update recharge_history set pay_querycount = (pay_querycount + 1) where kid in (" + String.Join(",", ids) + ")";
                    DBUtils.ExecuteNonQuery(sql);
                }

                return(userAccounts);
            }
            catch (Exception)
            {
                return(null);
            }
        }