public function relativeMove($model, $position)
    {
        $conditionAttributes = (array)$this->conditionAttributes;
        $owner = $this->owner;

        if (!empty($conditionAttributes)) {
            $sameCondition = true;
            foreach ($conditionAttributes as $attr) {
                if ($owner->getAttribute($attr) != $model->getAttribute($attr)) {
                    $sameCondition = false;
                    break;
                }
            }
            if (!$sameCondition) {
                // move in other condition category
                $this->moveToTop();
                // update condition attribute
                $condition = [];
                foreach ($conditionAttributes as $attr) {
                    $condition[$attr] = $model->getAttribute($attr);
                }
                $condition[$this->sortAttribute] = $owner->find()->andWhere($this->getCondition())->count() - 1;
                $owner->updateAttributes($condition);
            }
        }
        // calculate pos change
        $currentPos = $owner->getAttribute($this->sortAttribute);
        $destinationPos = $model->getAttribute($this->sortAttribute);
        if ($position == 'after') {
            $newPos = $destinationPos > $currentPos ? $destinationPos - 1 : $destinationPos;
        } else {
            $newPos = $destinationPos > $currentPos ? $destinationPos : $destinationPos + 1;
        }
        $this->moveToPosition($newPos);
    }