平时对二维数组进行处理
都是foreach觉得太土了
其实可以通过laravel的集合filter操作来实现
```
public function index(Phone $request){
try{
$list = UserCouponService::getByMobile($request);
if($request['is_use'] == 0){
$list = $list->filter(function ($item,$key){
$use_start_date = $item['use_start_date'];
$use_end_date = $item['use_end_date'];
$is_expire = UserService::checkCouponExpire([
'use_start_date' => $use_start_date,
'use_end_date' => $use_end_date,
]);
return $is_expire == 0;
});
}
return $this->jsonData(User::collection($list));
}catch (\Exception $e){
return $this->jsonError($e->getMessage());
}
}
```