Stakeholder Revert : ps

This commit is contained in:
Sanjeev 2021-07-22 13:25:06 +05:30
parent 9a6931c9ef
commit 9381deb2ff

View File

@ -70,5 +70,50 @@ class Data_Dump_Model extends SPARQ_Model {
}
}
}
}
function getRequestForDataDump($pdid,$fd=null,$td=null,$type){
$this->db->select('t_pd_form_details_json.pd_form_detail_json_id, t_pd_form_details_json.fk_pd_id, t_pd_form_details_json.fk_form_id, t_pd_form_details_json.isactive, t_pd_form_details_json.json, DATE_FORMAT(t_pd_form_details_json.createdon,"%d/%m/%Y %H:%i:%s") as createdon, t_pd_form_details_json.processed_json, t_pd_form_details_json.updatedon');
$this->db->from('t_pd_form_details_json');
if(!empty($pdid))
{
$this->db->where_in('t_pd_form_details_json.fk_pd_id',$pdid);
}
if(($fd != "" || $fd != null) && ($td != "" || $td != null)) {
if($type == "Createdon" ){
$this->db->where('t_pd_form_details_json.createdon BETWEEN '. "'$fd'". ' AND '. "'$td'" );
}else if($type == "Updatedon" ){
$this->db->where('t_pd_form_details_json.updatedon BETWEEN '. "'$fd'". ' AND '. "'$td'" );
}else{
$this->db->where('t_pd_form_details_json.updatedon BETWEEN '. "'$fd'". ' AND '. "'$td'" );
}
}
else if($fd != "" && $fd != null) {
if($type == "Createdon" ){
$this->db->where("DATE_FORMAT(t_pd_form_details_json.createdon,'%Y-%m-%d')",$fd);
}else if($type == "Updatedon" ){
$this->db->where("DATE_FORMAT(t_pd_form_details_json.updatedon,'%Y-%m-%d')",$fd);
}else{
$this->db->where("DATE_FORMAT(t_pd_form_details_json.updatedon,'%Y-%m-%d')",$fd);
}
}
else if($td != "" && $td != null) {
if($type == "Createdon" ){
$this->db->where("DATE_FORMAT(t_pd_form_details_json.createdon,'%Y-%m-%d')",$td);
}else if($type == "Updatedon" ){
$this->db->where("DATE_FORMAT(t_pd_form_details_json.updatedon,'%Y-%m-%d')",$td);
}else{
$this->db->where("DATE_FORMAT(t_pd_form_details_json.updatedon,'%Y-%m-%d')",$td);
}
}
$this->db->WHERE('t_pd_form_details_json.isactive',1);
$this->db->order_by('t_pd_form_details_json.pd_form_detail_json_id','desc');
$result = $this->db->get()->result_array();
// echo count($result);print_r($result);die();
// print_r($this->db->last_query());die();
return $result;
}
}