public DeleteCustAllPic GetCustomerAllPicture(string mobile)
{
var sqlCust = "select innerid,qrcode from cust_info where mobile=@mobile;";
var sqlCustAuth = "select relevantpicture from cust_authentication where custid=@custid;";
var sqlCarPic = "select path from car_picture where carid in (select innerid from car_info where custid=@custid);";
var sqlCarCode = "select qrcode from coupon_code where custid=@custid;";
using (var conn = Helper.GetConnection())
{
var custModel = conn.Query<dynamic>(sqlCust, new { mobile }).FirstOrDefault();
if (custModel == null)
{
return null;
}
var custid = custModel.innerid.ToString();
var model = new DeleteCustAllPic
{
Qrcode = custModel.qrcode.ToString(),
AuthPic = conn.Query<string>(sqlCustAuth, new { custid }).FirstOrDefault(),
CarPicList = conn.Query<string>(sqlCarPic, new { custid }).ToList(),
CodeList = conn.Query<string>(sqlCarCode, new { custid }).ToList(),
};
//model.qrcode = custModel.qrcode.ToString();
////获取认证信息图片
//model.authPic = conn.Query<string>(sqlCustAuth, new { custid }).FirstOrDefault();
////获取车辆图片
//model.carPicList = conn.Query<string>(sqlCarPic, new { custid }).ToList();
////获取礼券二维码图片
//model.codeList = conn.Query<string>(sqlCarCode, new { custid }).ToList();
return model;
}
}