Esempio n. 1
0
 public function index($ads_id = '')
 {
     $data['id'] = $ads_id;
     $data['username'] = \Request::server('PHP_AUTH_USER');
     \Queue::push('App\\Jobs\\UpdateAdsClickCount', $data);
     $ads = Advertisement::find($ads_id);
     return redirect()->away($ads->url);
 }
 public function fire($job, $data)
 {
     $id = isset($data['id']) ? $data['id'] : NULL;
     $username = isset($data['username']) ? $data['username'] : "******";
     if (isset($data['id']) && isset($data['username'])) {
         $advertismentimpression = new Advertisementimpression();
         $advertismentimpression->advertisement_id = $id;
         $advertismentimpression->username = $username;
         $advertismentimpression->save();
         $advertisement = Advertisement::find($id);
         $advertisement->increment('impressions');
     } else {
         $job->delete();
     }
 }
 public function fire($job, $data)
 {
     $id = $data['id'];
     $username = $data['username'] ? $data['username'] : "******";
     if ($username != '') {
         $advertismentclick = new Advertisementclick();
         $advertismentclick->advertisement_id = $id;
         $advertismentclick->username = $username;
         $advertismentclick->save();
         $advertisement = Advertisement::find($id);
         $advertisement->increment('clicks');
     } else {
         $job->delete();
     }
 }