Data Dump + Sales PD Cet : ps
This commit is contained in:
parent
b7dd905545
commit
8e7bf26fec
File diff suppressed because it is too large
Load Diff
@ -324,11 +324,14 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$where = 'DATE(SALES_PD_DATA.completed_date)
|
||||
BETWEEN ' ."'$newDate1'". ' AND ' ."'$newDate2'";
|
||||
$where_arr = array('SALES_PD_DATA.is_the_data_transfer_cet'=>0,'SALES_PD_DATA.status' => COMPLETED, $where => null);
|
||||
// $where_arr = array('SALES_PD_DATA.status' => COMPLETED, $where => null);
|
||||
$details = $this->Sales_PD_Model->selectCustomRecords($columns, $where_arr, $table);
|
||||
log_message('ERROR', $msg." Changed ".$newDate1." to ".$newDate2." Total Records => " . count($details));
|
||||
// log_message('ERROR', $msg." Changed ".$newDate1." to ".$newDate2." Total Records => " . count($details));
|
||||
log_message('ERROR', $msg." Total Records => " . count($details));
|
||||
if(!empty($details)){
|
||||
$flag = 0;$ids=array();
|
||||
for ($i = 0; $i < count($details); $i++) {
|
||||
log_message('ERROR', "inx = $i ".$details[$i]['sales_pd_id']);
|
||||
$sales_pd_id = $details[$i]['sales_pd_id'];
|
||||
// echo $sales_pd_id;
|
||||
$result = $this->dataSynchronization($sales_pd_id);
|
||||
@ -338,7 +341,6 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$update_fields2 = array('is_the_data_transfer_cet' => 1);
|
||||
$this->Sales_PD_Model->updateRecords($update_fields2,SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id));
|
||||
array_push($ids, $sales_pd_id);
|
||||
|
||||
}
|
||||
// $flag = ($result == true) ? $flag+1 : $flag;
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ class CET_SALESPD
|
||||
|
||||
public static function pushwithcetsalespdapi($fields,$data,$flag)
|
||||
{
|
||||
log_message('ERROR','#### pushwithcetsalespdapi Helper FNS');
|
||||
log_message('ERROR','#### pushwithcetsalespdapi Helper FNS '.$fields['pdid']);
|
||||
$fields['data'] = $data;
|
||||
$pdid = $fields['pdid'];
|
||||
$headers = array('Content-Type: application/json');
|
||||
@ -71,7 +71,7 @@ class CET_SALESPD
|
||||
// multipart/form-data;
|
||||
public static function pushwithcetphotographapi($fields,$index)
|
||||
{
|
||||
log_message('ERROR','#### pushwithcetphotographapi Helper FNS');
|
||||
log_message('ERROR','#### pushwithcetphotographapi Helper FNS '.$fields['pdid']);
|
||||
$CI =&get_instance();
|
||||
$img = $fields['img'];
|
||||
$pdid = $fields['pdid'];
|
||||
|
||||
@ -136,10 +136,10 @@ class Data_Dump_Model extends SPARQ_Model {
|
||||
|
||||
}
|
||||
### CSV-XLsheet Queries Ends Here
|
||||
function getRequestForDataDump($arr){
|
||||
function getRequestForDataDump($arr,$take, $skip){
|
||||
|
||||
|
||||
print_r($arr);
|
||||
//print_r($arr);
|
||||
$fromd = isset($arr[0]['from_date'])?$arr[0]['from_date']:null;
|
||||
$tod= isset($arr[0]['to_date'])?$arr[0]['to_date']:null;
|
||||
$type = isset($arr[0]['fk_pd_type_id'])?$arr[0]['fk_pd_type_id']:null;
|
||||
@ -178,6 +178,7 @@ class Data_Dump_Model extends SPARQ_Model {
|
||||
$this->db->WHERE('PDFORMDETAILSJSON.isactive',1);
|
||||
$this->db->order_by('PDFORMDETAILSJSON.pd_form_detail_json_id','desc');
|
||||
// $this->db->limit(5);
|
||||
$this->db->limit($take, $skip);
|
||||
$result = $this->db->get()->result_array();
|
||||
// echo count($result);print_r($result);print_r($this->db->last_query());die();
|
||||
return $result;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user