diff --git a/app/controller/api/Consumer.php b/app/controller/api/Consumer.php index b117878..f970005 100644 --- a/app/controller/api/Consumer.php +++ b/app/controller/api/Consumer.php @@ -113,8 +113,8 @@ class Consumer extends Base $flowArray = $accountRepo->getBusinessFlowCodeArray($account->user_code); } } - - $res['list']->each(function ($item)use($params,$flowArray){ + $time = time(); + $res['list']->each(function ($item) use ($params, $flowArray, $time) { unset($item->square); $distance = (get_distance($params["lat"], $params["lng"], $item["lat"],$item["lng"])); if ($distance >= 1000) { @@ -131,6 +131,13 @@ class Consumer extends Base $item->businessName = $item->business_name; $item->cover = $this->request->domain().$item->image_url; $item->couponName = $item->name; + + //到期状态 到期前7天!!!!!!!!没做完 +// $weekTIme = 7 * 86400; +// $endTime = strtotime($item->end_time); +// if ($endTime > ($time - $weekTIme) && $endTime < $time) { +// $item->couponName +// } }); return $this->json(0, 'success', $res);