CCN.Modules.Customer.DataAccess.CustomerDA.CustLogin C# (CSharp) Метод

CustLogin() публичный Метод

用户登录
public CustLogin ( CustLoginInfo loginInfo ) : CustModel
loginInfo CCN.Modules.Customer.BusinessEntity.CustLoginInfo 登录账户
Результат CCN.Modules.Customer.BusinessEntity.CustModel
        public CustModel CustLogin(CustLoginInfo loginInfo)
        {
            const string sql = "select * from `cust_info` where mobile=@mobile and password=@password;";
            var custModel = Helper.Query<CustModel>(sql, new
            {
                mobile = loginInfo.Mobile,
                password = loginInfo.Password
            }).FirstOrDefault();

            //获取微信信息
            if (custModel != null)
            {
                custModel.Wechat = Helper.Query<CustWechat>("select a.* from wechat_friend as a inner join cust_wechat as b on a.openid=b.openid where b.custid=@custid;", new
                {
                    custid = custModel.Innerid
                }).FirstOrDefault();

                //获取是否参与过会员体验
                custModel.isbate = Helper.Query<int>("select count(1) from cust_wxpay_info where custid=@custid and type=2;", new
                {
                    custid = custModel.Innerid
                }).FirstOrDefault();
            }

            return custModel;
        }