-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added search feature on Donations and Needs page #183
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,7 @@ public function findNeed($id) | |
/** | ||
* | ||
* @param type $search | ||
* @return boolean | ||
* @return Array | ||
*/ | ||
public function searchNeeds($search){ | ||
|
||
|
@@ -83,7 +83,7 @@ public function searchNeeds($search){ | |
$query = $query->where(DB::Raw('CONCAT_WS(" ",name,telephone,address,city,needs)'),"like","%$searchPart%"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This query might be open to SQL injection. Since the calls to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nadeeravista could you please have a look on @gayanhewa's comment as well as fix conflicts? |
||
} | ||
} | ||
return $query->get(); | ||
return $query->orderBy('id', 'desc')->paginate(\Config::get('rf_settings.needs_page_pagination')); | ||
} catch (\Exception $e) { | ||
Log::error($e->getMessage()); | ||
return false; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
|
||
return [ | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Home page pagination for both donations and needs | ||
|-------------------------------------------------------------------------- | ||
*/ | ||
'home_page_pagination' => '10', | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Neees page pagination | ||
|-------------------------------------------------------------------------- | ||
*/ | ||
'needs_page_pagination'=> '10', | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Donations page paginations | ||
|-------------------------------------------------------------------------- | ||
*/ | ||
'donations_page_pagination'=> '10', | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\Config::get
can be replaced withconfig()
calls