<?php
namespace admin\factory;
class ShopOrder
{
  static public function next_order_id( int $order_id )
  {
    global $mdb;

    if ( !$order_id )
      return false;

    return $mdb -> get( 'pp_shop_orders', 'id', [ 'id[>]' => $order_id, 'ORDER' => [ 'id' => 'ASC' ], 'LIMIT' => 1 ] );
  }

  static public function prev_order_id( int $order_id )
  {
    global $mdb;

    if ( !$order_id )
      return false;

    return $mdb -> get( 'pp_shop_orders', 'id', [ 'id[<]' => $order_id, 'ORDER' => [ 'id' => 'DESC' ], 'LIMIT' => 1 ] );
  }
}
