update from old git
This commit is contained in:
31
web/App_Code/api/lianyouController.cs
Normal file
31
web/App_Code/api/lianyouController.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using PagedList;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
/// <summary>
|
||||
/// lianyouController 的摘要描述
|
||||
/// </summary>
|
||||
[ezAuthorize]
|
||||
public class lianyouController: ApiController
|
||||
{
|
||||
private Model.ezEntities _db = new Model.ezEntities();
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/lianyou/getfollowers")]
|
||||
public async Task<IHttpActionResult> GetGuadanFollowers(int page, int pageSize, string searchName = null)
|
||||
{
|
||||
var qry = _db.followers.AsEnumerable();
|
||||
if(searchName != null)
|
||||
{
|
||||
qry = qry.Where(a => (a.u_name ?? "").Contains(searchName) || (a.phone ?? "").Contains(searchName));
|
||||
}
|
||||
var count = qry.Count();
|
||||
var data = qry.OrderBy(a => a.f_number).ToPagedList(page, pageSize);
|
||||
return Ok(new {data = data, count = count});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user