public function incrementOrDecrementByPk($primary_key, $keys, $steps = 1, $op = self::PLUS_NOTIFICATION)
    {
        if ($this->is_single) {
            $values = [];
            if (is_array($keys)) {
                foreach ($keys as $k => $key) {
                    if (is_array($steps) && isset($steps[$k])) {
                        $values[$key] = [$op => $steps[$k]];
                    } else {
                        $values[$key] = [$op => $steps];
                    }
                }
            } else {
                $values[$keys] = [$op => $steps];
            }

            return Dao::component()
                ->where(
                    [
                    $this->_primary_key => $primary_key,
                    ]
                )
                ->update(static::TABLE_NAME, $values);
        }
        return false;
    }
public function incrementOrDecrementByPk($primary_key, $keys, $steps = 1, $op = self::PLUS_NOTIFICATION)
    {
        if ($this->is_single) {
            $values = [];
            if (is_array($keys)) {
                foreach ($keys as $k => $key) {
                    if (is_array($steps) && isset($steps[$k])) {
                        $values[$key] = [$op => $steps[$k]];
                    } else {
                        $values[$key] = [$op => $steps];
                    }
                }
            } else {
                $values[$keys] = [$op => $steps];
            }

            return Dao::component()
                ->where(
                    [
                    $this->_primary_key => $primary_key,
                    ]
                )
                ->update(static::TABLE_NAME, $values);
        }
        return false;
    }
public function incrementOrDecrementByPk ( $ primary_key , $ keys , $ steps = 1 , $ op = self :: PLUS_NOTIFICATION ) { if ( $ this -> is_single ) { $ values = [ ] ; if ( is_array ( $ keys ) ) { foreach ( $ keys as $ k => $ key ) { if ( is_array ( $ steps ) && isset ( $ steps [ $ k ] ) ) { $ values [ $ key ] = [ $ op => $ steps [ $ k ] ] ; } else { $ values [ $ key ] = [ $ op => $ steps ] ; } } } else { $ values [ $ keys ] = [ $ op => $ steps ] ; } return Dao :: component ( ) -> where ( [ $ this -> _primary_key => $ primary_key , ] ) -> update ( static :: TABLE_NAME , $ values ) ; } return false ; }
Increase or decrease key or keys by primary key

@param  $primary_key
@param  $keys
@param  int         $steps
@param  string      $op
@return bool
Increase or decrease key or keys by primary key