Example #1
0
 /**
  * @param $vid int 主键
  * @return mixed
  */
 public function processVisitDetails($vid)
 {
     $referrers = new Referrers();
     $information = $referrers->getReferrerInformationFromRequest();
     $params['referer_type'] = $information['referer_type'];
     $params['referer_name'] = $information['referer_name'];
     $params['referer_keyword'] = $information['referer_keyword'];
     $params['referer_url'] = $information['referer_url'];
     $params['current_url'] = $information['current_url'];
     $params['vid'] = $vid;
     return $params;
 }
Example #2
0
 public function tracker()
 {
     $idvisitor = $this->getIdvisitor();
     if (!($model = $this->findVisitor($idvisitor))) {
         $model = new StatVisit();
     }
     $referrers = new Referrers();
     $details = $referrers->getReferrerInformationFromRequest();
     $model->load(['StatVisit' => $this->load($idvisitor, $details)]);
     $model->save();
     if ($model->id) {
         $details['vid'] = $model->id;
         $details['flag'] = \yii::$app->request->get('rf', 1);
         $this->insertVisitDetails($details);
     }
 }