datadump fixes 1 : ps
This commit is contained in:
parent
e15e666800
commit
582f4ff036
@ -73,10 +73,12 @@ class Data_Dump_Model extends SPARQ_Model {
|
||||
}
|
||||
|
||||
function getRequestForDataDump($arr){
|
||||
$pdid = $arr['pd_id'];
|
||||
$fromd = $arr['from_date'];$tod= $arr['to_date'];
|
||||
$type = $arr['pd_type_id'];$prod = $arr['product_id'];
|
||||
$cseg = $arr['customer_segment_id'];
|
||||
$pdid = isset($arr['pd_id'])?$arr['pd_id']:[];
|
||||
$fromd = $arr['from_date'];
|
||||
$tod= $arr['to_date'];
|
||||
$type = isset($arr['pd_type_id'])?$arr['pd_type_id']:null;
|
||||
$prod = isset($arr['product_id'])?$arr['product_id']:null;
|
||||
$cseg = isset($arr['customer_segment_id'])?$arr['customer_segment_id']:null;
|
||||
### 2 tables t_pd_form_details_json and t_pd_triggered
|
||||
$this->db->select('PDFORMDETAILSJSON.pd_form_detail_json_id, PDFORMDETAILSJSON.fk_pd_id, PDFORMDETAILSJSON.fk_form_id, PDFORMDETAILSJSON.isactive, PDFORMDETAILSJSON.json, DATE_FORMAT(PDFORMDETAILSJSON.createdon,"%d/%m/%Y %H:%i:%s") as createdon, PDFORMDETAILSJSON.processed_json, PDFORMDETAILSJSON.updatedon,PDTRIGGER.completed_on,PDTRIGGER.fk_product_id, PDTRIGGER.fk_customer_segment,PDTRIGGER.fk_pd_type,PDTRIGGER.pd_status,PDTRIGGER.createdon');
|
||||
$this->db->from(PDFORMDETAILSJSON.' as PDFORMDETAILSJSON');
|
||||
@ -86,14 +88,14 @@ class Data_Dump_Model extends SPARQ_Model {
|
||||
{
|
||||
$this->db->where_in('PDFORMDETAILSJSON.fk_pd_id',$pdid);
|
||||
}
|
||||
if(($fd != "" || $fd != null) && ($td != "" || $td != null)) {
|
||||
$this->db->where('PDTRIGGER.createdon BETWEEN '. "'$fd'". ' AND '. "'$td'" );
|
||||
if(($fromd != "" || $fromd != null) && ($tod != "" || $tod != null)) {
|
||||
$this->db->where('PDTRIGGER.createdon BETWEEN '. "'$fromd'". ' AND '. "'$tod'" );
|
||||
}
|
||||
else if($fd != "" && $fd != null) {
|
||||
$this->db->where("DATE_FORMAT(PDTRIGGER.createdon,'%Y-%m-%d')",$fd);
|
||||
else if($fromd != "" && $fromd != null) {
|
||||
$this->db->where("DATE_FORMAT(PDTRIGGER.createdon,'%Y-%m-%d')",$fromd);
|
||||
}
|
||||
else if($td != "" && $td != null) {
|
||||
$this->db->where("DATE_FORMAT(PDTRIGGER.createdon,'%Y-%m-%d')",$td);
|
||||
else if($tod != "" && $tod != null) {
|
||||
$this->db->where("DATE_FORMAT(PDTRIGGER.createdon,'%Y-%m-%d')",$tod);
|
||||
}
|
||||
if($prod != ""){
|
||||
$this->db->where('PDTRIGGER.fk_product_id',$prod);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user