public function isUserAction($type = 0, $do = '', $targetId) { return $this->find()->where(['target_id' => $targetId, 'user_id' => Yii::$app->user->id, 'target_type' => $type, 'type' => $do])->count(); }
public function getThanks() { $model = new UserMeta(); return $model->isUserAction(self::TYPE, 'thanks', $this->id); }