protected$description='Stores cached clicks on affiliate links into DB.';
/**
* Create a new command instance.
*
* @return void
*/
publicfunction__construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
publicfunctionhandle()
{
AdgoalController::storePartnerCalls();
# Remove old entries
# The duration in hours for entries to last is defined as constant in AdgoalController
DB::delete("delete from affiliate_clicks where created_at < DATE_SUB(NOW(), INTERVAL ? HOUR);",[\App\Http\Controllers\AdgoalController::STORAGE_DURATION_HOURS]);