I am trying to get the affiliate id from the Referral table (which I have managed) - but now I need to ensure it is the latest affiliate and not already expired.
this is what I am doing...
| Code: : |
$app = new iSDK;
$app->cfgCon("InfusionSoftApp");
$cid=(int)$cid ;
$returnF = array('AffiliateId');
$query = array('ContactId' => $cid);
$referral = $app->dsQuery("Referral",1,0,$query,$returnF);
$refid=$referral[0]['AffiliateId'];
echo $refid;
|
So i need to add a where 'DateExpires' is not older than 30 days and the latest one if multiples are in the array.
Anyone able to help with how I correct my $query?