jeudi 26 septembre 2019

How to get maximum amount and all other amounts separately in laravel?

Hello I am building an auction system. where for now i will consider two tables. Auction table and Bidding table. I want to build eloquent query so that I can get maximum amount and all other amounts separately because I will transfer maximum amount to seller and other amount to refund their users.

I don't know from where I should start.

Auction table migration

   public function up()
    {
        Schema::create('auctions', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->Integer('productID');
            $table->Integer('price');
            $table->Integer('quantity');
            $table->dateTime('endTimeDate');
            $table->dateTime('startTimeDate');
            $table->timestamps();
        });
    }

Bidding table migration

  public function up()
    {
        Schema::create('biddings', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->Integer('userID');
            $table->integer('auctionID');
            $table->bigInteger('amount');
            $table->timestamps();
        });
    }

I want to get maximum amount and other amounts separately.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2lxkFjS
via IFTTT

Aucun commentaire:

Enregistrer un commentaire