public IActionResult SeckillComShow(int aid = 0, string nmid = "", int st = -1)
 {
     try
     {
         var ls = _seckillComRepository.Query();
         //根据姓名id查询
         if (!string.IsNullOrEmpty(nmid))
         {
             ls = ls.Where(x => x.CommodityId.Equals(nmid) || x.SeckillTitle.Contains(nmid)).ToList();
         }
         //根据状态查询
         if (st != -1)
         {
             ls = ls.Where(x => x.State.Equals(st)).ToList();
         }
         if (aid != 0)
         {
             ls = ls.Where(x => x.ActivityId.Equals(aid)).ToList();
         }
         return(Ok(new
         {
             msg = "",
             code = 0,
             data = ls
         }));
     }
     catch (Exception)
     {
         throw;
     }
 }
Beispiel #2
0
        public IActionResult SeckillComShow(string nmid, int st)
        {
            var ls = _seckillComRepository.Query();

            //根据姓名id查询
            if (!string.IsNullOrEmpty(nmid))
            {
                ls = ls.Where(x => x.CommodityId.Equals(nmid) || x.SeckillTitle.Contains(nmid)).ToList();
            }
            //根据状态查询
            ls = ls.Where(x => x.State.Equals(st)).ToList();
            return(Ok(new
            {
                msg = "",
                code = 0,
                data = ls
            }));
        }