Exemple #1
0
        /// <summary>
        /// 获取用户资金异动记录
        /// </summary>
        /// <param name="model">model</param>
        /// <returns></returns>
        public ResultModel GetUserBalanceChangeLogList(SearchZJ_UserBalanceChangeLogModel model)
        {
            var log     = _database.Db.ZJ_UserBalanceChangeLog;
            var logType = _database.Db.ZJ_AmountChangeType_lang;

            var where = new SimpleExpression(1, 1, SimpleExpressionType.Equal); //

            //移动类型语言ID
            where = new SimpleExpression(where, logType.LanguageID == model.LanguageId, SimpleExpressionType.And);

            if (model.AddOrCutTypeArry.Length > 0)
            {
                //异动类型
                where = new SimpleExpression(where, log.AddOrCutType == model.AddOrCutTypeArry, SimpleExpressionType.And);
            }

            //显示
            where = new SimpleExpression(where, log.IsDisplay == 1, SimpleExpressionType.And);

            if (model.UserID > 0)
            {
                //用户ID
                where = new SimpleExpression(where, log.UserID == model.UserID, SimpleExpressionType.And);
            }
            if (model.EndCreateDT != null && model.EndCreateDT.Value.Year != 0001)
            {
                //结束 时间加一天是为了查询结束当天的数据
                where = new SimpleExpression(where, log.CreateDT < model.EndCreateDT, SimpleExpressionType.And);
            }
            if (model.BeginCreateDT != null && model.BeginCreateDT.Value.Year != 0001)
            {
                //开始时间
                where = new SimpleExpression(where, log.CreateDT >= model.BeginCreateDT, SimpleExpressionType.And);
            }

            var query = log
                        .Query()
                        .LeftJoin(logType)
                        .On(logType.ID == log.AddOrCutType)
                        .Select(
                log.ID,
                log.AddOrCutAmount,
                log.IsAddOrCut,
                log.AddOrCutType,
                log.OrderNo,
                log.CreateDT,
                logType.TypeName
                )
                        .Where(where)
                        .OrderByCreateDTDescending();

            var result = new ResultModel
            {
                Data = new SimpleDataPagedList <ZJ_UserBalanceChangeLogModel>(query,
                                                                              model.PagedIndex, model.PagedSize)
            };

            return(result);
        }
Exemple #2
0
        /// <summary>
        /// 列表
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public JsonResult List(SearchZJ_UserBalanceChangeLogModel model)
        {
            //SearchAC_OperateLogModel logmodel = new SearchAC_OperateLogModel();
            model.PagedIndex = model.PagedIndex == 0 ? 0 : model.PagedIndex;
            model.PagedSize  = model.PagedSize == 0 ? 10 : model.PagedSize;



            //查询列表
            var result = this._zjUserBalanceChangeLog.GetZJ_UserBalanceChangeLogList(model);
            List <ZJ_UserBalanceChangeLogModel> ds = result.Data;
            var data = new
            {
                rows  = ds,
                total = result.Data.TotalCount,
            };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
        /// <summary>
        /// 获取用户账户金额异动记录表
        /// </summary>
        /// <param name="model">model</param>
        /// <returns></returns>
        public ResultModel GetZJ_UserBalanceChangeLogList(SearchZJ_UserBalanceChangeLogModel model)
        {
            var tb = _database.Db.ZJ_UserBalanceChangeLog;

            var where = new SimpleExpression(1, 1, SimpleExpressionType.Equal); //

            if (model.ID > 0)
            {
                //流水号
                where = new SimpleExpression(where, tb.ID == model.ID, SimpleExpressionType.And);
            }
            if (model.AddOrCutType > 0)
            {
                //异动类型
                where = new SimpleExpression(where, tb.AddOrCutType == model.AddOrCutType, SimpleExpressionType.And);
            }
            if (model.IsAddOrCut != 10)
            {
                //
                where = new SimpleExpression(where, tb.IsAddOrCut == model.IsAddOrCut, SimpleExpressionType.And);
            }
            if (!string.IsNullOrEmpty(model.OrderNo) && model.OrderNo.Trim() != "")
            {
                //订单编号
                where = new SimpleExpression(where, tb.OrderNo.Like("%" + model.OrderNo.Trim() + "%"), SimpleExpressionType.And);
            }
            if (!string.IsNullOrEmpty(model.CreateBy) && model.CreateBy.Trim() != "")
            {
                //创建人(操作人)
                where = new SimpleExpression(where, tb.CreateBy.Like("%" + model.CreateBy.Trim() + "%"), SimpleExpressionType.And);
            }
            if (!string.IsNullOrEmpty(model.Account) && model.Account.Trim() != "")
            {
                //用户名(YH_User表,登陆账号)
                where = new SimpleExpression(where, _database.Db.YH_User.Account.Like("%" + model.Account.Trim() + "%"), SimpleExpressionType.And);
            }
            if (!string.IsNullOrEmpty(model.RealName) && model.RealName.Trim() != "")
            {
                //用户真实姓名
                where = new SimpleExpression(where, _database.Db.YH_User.RealName.Like("%" + model.RealName.Trim() + "%"), SimpleExpressionType.And);
            }
            if (!string.IsNullOrEmpty(model.Phone) && model.Phone.Trim() != "")
            {
                //手机
                where = new SimpleExpression(where, _database.Db.YH_User.Phone.Like("%" + model.Phone.Trim() + "%"), SimpleExpressionType.And);
            }
            if (!string.IsNullOrEmpty(model.Email) && model.Email.Trim() != "")
            {
                //Email
                where = new SimpleExpression(where, _database.Db.YH_User.Email.Like("%" + model.Email.Trim() + "%"), SimpleExpressionType.And);
            }
            if (model.EndCreateDT != null && model.EndCreateDT.Value.Year != 0001)
            {
                //结束 时间加一天是为了查询结束当天的数据
                where = new SimpleExpression(where, tb.CreateDT < model.EndCreateDT, SimpleExpressionType.And);
            }
            if (model.BeginCreateDT != null && model.BeginCreateDT.Value.Year != 0001)
            {
                //开始时间
                where = new SimpleExpression(where, tb.CreateDT >= model.BeginCreateDT, SimpleExpressionType.And);
            }

            dynamic pc;
            dynamic zj;
            var     query = tb
                            .Query()
                            .LeftJoin(_database.Db.ZJ_AmountChangeType, out zj)
                            .On(_database.Db.ZJ_AmountChangeType.ID == tb.AddOrCutType)
                            .LeftJoin(_database.Db.YH_User, out pc)
                            .On(_database.Db.YH_User.UserID == tb.UserID)
                            .Select(
                tb.ID,
                tb.UserID,
                tb.AddOrCutAmount,
                tb.IsAddOrCut,
                tb.OldAmount,
                tb.NewAmount,
                tb.AddOrCutType,
                tb.OrderNo,
                tb.Remark,
                tb.IsDisplay,
                tb.CreateBy,
                tb.CreateDT,

                zj.TypeName,
                pc.Phone,
                pc.Email,
                pc.NickName,
                pc.RealName,
                pc.Account
                )
                            .Where(where)
                            .OrderByIDDescending();

            var result = new ResultModel
            {
                Data = new SimpleDataPagedList <ZJ_UserBalanceChangeLogModel>(query,
                                                                              model.PagedIndex, model.PagedSize)
            };

            return(result);
        }