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

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

获取会员详情(根据手机号)
public GetCustByMobile ( string mobile ) : CustModel
mobile string 会员手机号
Результат CCN.Modules.Customer.BusinessEntity.CustModel
        public CustModel GetCustByMobile(string mobile)
        {
            const string sql = "select * from cust_info where mobile=@mobile;";

            try
            {
                var custModel = Helper.Query<CustModel>(sql, new { mobile }).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();
                }
                return custModel;

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