$referrer = self::find()->where('ref', $ref); if ($referrer->count() > 0) { $referrer = $referrer->get_one(); Cookie::set('signup_referral_tracking', json_encode(array('referrer' => $referrer->ref))); // if the click through var is true increase the referrers tracker if ($click_through == true) { $tracking = Model_Tracking::find()->where('email_id', $referrer->id); $tracking->click_count++; $tracking->save(); } return $referrer; }
It looks like you're new here. If you want to get involved, click one of these buttons!