QUES MAS FILTER
This commit is contained in:
parent
658478b3be
commit
ff97178553
@ -85,8 +85,8 @@ defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automat
|
|||||||
defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
|
defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
|
||||||
|
|
||||||
// define login route name for token verification
|
// define login route name for token verification
|
||||||
defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listLessPDDetails/:any)'); // no errors
|
//defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listLessPDDetails/:any)'); // no errors
|
||||||
//defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'triggerNewPD'); // no errors
|
defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listAllQuestions/:any)'); // no errors
|
||||||
|
|
||||||
/*********************AWS resources Constants*************************************************/
|
/*********************AWS resources Constants*************************************************/
|
||||||
defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic');
|
defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic');
|
||||||
|
|||||||
@ -23,13 +23,14 @@ class Question_Management_Controller extends REST_Controller {
|
|||||||
|
|
||||||
public function listAllQuestions_get()
|
public function listAllQuestions_get()
|
||||||
{
|
{
|
||||||
$page = 0;$limit = 0;$sort = 'ASC';
|
$page = 0;$limit = 0;$sort = 'ASC';$category_id = '';
|
||||||
|
|
||||||
if($this->get('page')) { $page = $this->get('page'); }
|
if($this->get('page')) { $page = $this->get('page'); }
|
||||||
if($this->get('limit')){ $limit = $this->get('limit'); }
|
if($this->get('limit')){ $limit = $this->get('limit'); }
|
||||||
if($this->get('sort')) { $sort = $this->get('sort'); }
|
if($this->get('sort')) { $sort = $this->get('sort'); }
|
||||||
|
if($this->get('cid')) { $category_id = $this->get('cid'); }
|
||||||
|
|
||||||
$result = $this->Question_Management_Model->listAllQuestions($page,$limit,$sort);
|
$result = $this->Question_Management_Model->listAllQuestions($page,$limit,$sort,$category_id);
|
||||||
if($result['data_status'])
|
if($result['data_status'])
|
||||||
{
|
{
|
||||||
$data['dataStatus'] = true;
|
$data['dataStatus'] = true;
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class Question_Management_Model extends SPARQ_Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function listAllQuestions($page,$limit,$sort)
|
public function listAllQuestions($page,$limit,$sort,$category_id)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@ -20,6 +20,10 @@ class Question_Management_Model extends SPARQ_Model {
|
|||||||
$this->db->JOIN(QUESTIONCATEGORY.' as QUESTIONCATEGORY','QUESTIONS.fk_question_catagory = QUESTIONCATEGORY.question_categroy_id');
|
$this->db->JOIN(QUESTIONCATEGORY.' as QUESTIONCATEGORY','QUESTIONS.fk_question_catagory = QUESTIONCATEGORY.question_categroy_id');
|
||||||
$this->db->JOIN(USERPROFILE.' as USERPROFILE','QUESTIONS.fk_createdby = USERPROFILE.userid');
|
$this->db->JOIN(USERPROFILE.' as USERPROFILE','QUESTIONS.fk_createdby = USERPROFILE.userid');
|
||||||
$this->db->JOIN(USERPROFILE.' as USERPROFILE1','QUESTIONS.fk_updatedby = USERPROFILE1.userid','LEFT');
|
$this->db->JOIN(USERPROFILE.' as USERPROFILE1','QUESTIONS.fk_updatedby = USERPROFILE1.userid','LEFT');
|
||||||
|
if($category_id != null || $category_id != '')
|
||||||
|
{
|
||||||
|
$this->db->WHERE('QUESTIONS.fk_question_catagory',$category_id);
|
||||||
|
}
|
||||||
$this->db->ORDER_BY('QUESTIONS.question_id',$sort);
|
$this->db->ORDER_BY('QUESTIONS.question_id',$sort);
|
||||||
$this->db->LIMIT($page,$limit);
|
$this->db->LIMIT($page,$limit);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user