64], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'idq' => 'id вопроса', 'ida' => 'id щтвета', 'hash' => 'Hash', 'dt' => 'дата голоса', ]; } /** * {@inheritdoc} */ public function test($idq, $ida, $hash) { $r = $this->findOne(['idq'=>$idq, 'ida'=>$ida, 'hash'=>$hash]); if( $r && strtotime( $r->dt ) > time() - $this->resetTime ){ return true; } return false; } public function testq($idq, $hash) { $r = $this->find()->where(['idq'=>$idq, 'hash'=>$hash])->orderBy('dt DESC')->limit(1)->one(); if( $r && strtotime( $r->dt ) > time() - $this->resetTime ){ return true; } return false; } public function add($idq, $ida, $hash) { $this->ida = $ida; $this->idq = $idq; $this->hash = $hash; return $this->save(); } }