好友关系申请model
Наследование: QueryModel
Пример #1
0
        /// <summary>
        /// 获取加好友申请
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns></returns>
        public BasePageList<CustRelationsApplyViewModels> GetCustRelationsPageList(CustRelationsApplyQueryModels query)
        {
            const string spName = "sp_common_pager";
            const string tableName = @"cust_relations_apply as a
                                        inner join cust_info as b on a.fromid=b.innerid
                                        left join cust_wechat as c on a.fromid=c.custid
                                        left join wechat_friend as d on d.openid=c.openid
                                        left join base_code as bc1 on a.sourceid=bc1.codevalue and bc1.typekey='cust_source'";
            const string fields = " a.innerid ,a.fromid as Friendsid,a.status as ApplyStatus,bc1.codename as Source,b.custname, b.mobile, b.email, b.headportrait, b.`status`, b.authstatus, b.brithday, b.totalpoints, b.`level`, b.createdtime,d.photo ,(select count(1) from car_info where custid=a.fromid) as carnum ";
            var orderField = string.IsNullOrWhiteSpace(query.Order) ? "a.createdtime desc" : query.Order;
            //查询条件
            var sqlWhere = new StringBuilder("1=1");

            if (!string.IsNullOrWhiteSpace(query.Toid))
            {
                sqlWhere.Append($" and a.toid='{query.Toid}'");
            }

            sqlWhere.Append(query.Status != null
                ? $" and a.status={query.Status}"
                : "");

            var model = new PagingModel(spName, tableName, fields, orderField, sqlWhere.ToString(), query.PageSize, query.PageIndex);
            var list = Helper.ExecutePaging<CustRelationsApplyViewModels>(model, query.Echo);
            return list;
        }
Пример #2
0
        /// <summary>
        /// 获取加好友申请
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns></returns>
        public BasePageList<CustRelationsApplyViewModels> GetCustRelationsPageList(CustRelationsApplyQueryModels query)
        {
            const string spName = "sp_common_pager";
            const string tableName = @"cust_relations_apply";
            const string fields = " * ";
            var orderField = string.IsNullOrWhiteSpace(query.Order) ? "createdtime desc" : query.Order;
            //查询条件
            var sqlWhere = new StringBuilder("1=1");

            if (!string.IsNullOrWhiteSpace(query.Toid))
            {
                sqlWhere.Append($" and toid='{query.Toid}'");
            }

            sqlWhere.Append(query.Status != null
                ? $" and status={query.Status}"
                : "");

            var model = new PagingModel(spName, tableName, fields, orderField, sqlWhere.ToString(), query.PageSize, query.PageIndex);
            var list = Helper.ExecutePaging<CustRelationsApplyViewModels>(model, query.Echo);
            return list;
        }