src/base/BaseOrderModel.php
public function afterDelete ()
		{
			$parent = parent::afterDelete();

			if ($this->hasAttribute('order'))
			{
				$query = self::find()->where([ '>', 'order', $this->order ]);

				$condition = $this->orderCondition();
				if ($condition !== null)
				{
					$query->andWhere($condition);
				}

				$objects = $query->all();
				foreach ($objects as $object)
				{
					$object->order -= 1;
					$object->save();
				}
			}

			return $parent;
		}
public function afterDelete ()
		{
			$parent = parent::afterDelete();

			if ($this->hasAttribute('order'))
			{
				$query = self::find()->where([ '>', 'order', $this->order ]);

				$condition = $this->orderCondition();
				if ($condition !== null)
				{
					$query->andWhere($condition);
				}

				$objects = $query->all();
				foreach ($objects as $object)
				{
					$object->order -= 1;
					$object->save();
				}
			}

			return $parent;
		}
public function afterDelete ( ) { $ parent = parent :: afterDelete ( ) ; if ( $ this -> hasAttribute ( 'order' ) ) { $ query = self :: find ( ) -> where ( [ '>' , 'order' , $ this -> order ] ) ; $ condition = $ this -> orderCondition ( ) ; if ( $ condition !== null ) { $ query -> andWhere ( $ condition ) ; } $ objects = $ query -> all ( ) ; foreach ( $ objects as $ object ) { $ object -> order -= 1 ; $ object -> save ( ) ; } } return $ parent ; }
Which order more than the remote model, do for order -1.
Which order more than the remote model do for order - 1 .