promot jobs

This commit is contained in:
CHIEFSOFT\ameye
2024-09-18 09:48:32 -04:00
parent b22ab61ef4
commit be7cd8f62e
+26 -7
View File
@@ -37,14 +37,33 @@ class Promo extends BaseController
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$out =[];
$in["action"] = -1; // bad number - we dont want formating WRENCHBOARD_ACCOUNT_JOBLIST; dont send this line , the formater will be confused
$out=[];
$endpoint = "PROMO_JOBS-". $in["promo"];
log_message('critical', "promoTask::promoStart ********* ALL ".serialize($in) );
$in["loc"] = $_SERVER["REMOTE_ADDR"];
// $in['action'] = WRENCHBOARD_MARKET_PLAN01_START;
$in['limit'] = 10;
// $ret['WRENCHBOARD_MARKET_PLAN01_START'] = (new \App\Models\BackendModel())->wrenchboard_api($in, $out);
return []; //json_encode( $final_out );
$out = $this->getCache($endpoint);
$countItem = 0;
if( is_array($out)){
$countItem = count($out);
}
if ( $countItem == 0 ){
$local_url = "http://".$this->micro_service_net1.":3033/marketjobs";
$out = $this->APIcall('GET', $local_url, $in);
// dont cache junk
if ( is_array($out) && is_array($out["result_list"]) && count($out["result_list"]) > 0){
$this->saveCache($endpoint,$out,3000);
}
$out['internal_return'] = 0; // just backwad comaptobility
log_message('critical', "***** ***** WrenchJobs::getJobsData Cache Done:::Ret ");
}
$endpoint = "WRENCH_JOB_INTEREST_COUNT";
$int_list = $this->getCache($endpoint)["result_list"];
$out["interest_list"] = ( isset($int_list) && is_array($int_list) ) ? $int_list : [];
log_message('critical', "***** ***** WrenchJobs::getJobsData Ret ");
return $this->respond( $this->summaryReturnData($in,$out), 200);
}
}