Example #1
0
 public static function upcomingBill($paid_status = null)
 {
     $data = \App\userBills::where('user_bills.flg', 1)->where('uid', Auth::user()->id);
     //                                ->where('user_bills.is_paid',0)
     if ($paid_status != null) {
         $data->where('user_bills.is_paid', $paid_status);
     }
     $data->join('category_core', 'user_bills.cate_id', '=', 'category_core.id')->where('category_core.flg', 1)->select('user_bills.id as id', 'user_bills.amount', 'user_bills.is_paid', 'user_bills.due_date', 'category_core.name')->orderBy('user_bills.due_date', 'asc');
     return json_encode($data->get());
 }