72 lines
2.1 KiB
PHP
72 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Models\LelongBidder;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class Pemenang extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public $name;
|
|
|
|
public $total_bid_win;
|
|
// public $id;
|
|
// public $lelong_id;
|
|
// public $token;
|
|
|
|
public function __construct($name, $total_bid_win)
|
|
{
|
|
$this->name = $name;
|
|
$this->total_bid_win = $total_bid_win;
|
|
// $this->id = $id;
|
|
// $this->lelong_id = $lelong_id;
|
|
// $this->token = $token;
|
|
}
|
|
|
|
/**
|
|
* Build the message.
|
|
*git stsa
|
|
*/
|
|
public function build()
|
|
{
|
|
// return $this->view('view.name');
|
|
$user['name'] = $this->name;
|
|
$user['total_bid_win'] = $this->total_bid_win;
|
|
// $user['id'] = $this->id;
|
|
// $user['lelong_id'] = $this->lelong_id;
|
|
// $user['token'] = $this->token;
|
|
// $current = Carbon::now();
|
|
// $current = new Carbon();
|
|
// $today = $current->format('Y-m-d');
|
|
|
|
// $bidders = LelongBidder::join('lelongbid', 'lelongbid.id', '=', 'lelongbidder.lelongbid_id')
|
|
// // ->where('lelongbid.status_jual', 0)
|
|
// ->where('masa_bidaan', 'LIKE', '%'.$today.'%')
|
|
// ->where('lelongbid.lelong_id', '=', $this->lelong_id)
|
|
// ->where('lelongbid.nopembeli', '=', $this->id)
|
|
// ->where('lelongbid.status_jual', '=', 1)
|
|
// ->select('lelongbidder.user_id', 'lelongbidder.id', 'lelongbidder.hargabida', 'lelongbid.pinjaman', 'lelongbid.bakiupah','lelongbid.kodcaw')
|
|
// ->get();
|
|
// foreach($bidders as $index=>$bidder)
|
|
// {
|
|
// $bidders[$index]['hargabida'] = $bidder->sum('hargabida');
|
|
// }
|
|
|
|
// $infos[$index1]['info'] = $info;
|
|
|
|
return $this->from('masterlelongpkb@gmail.com', 'Admin ArrahnBid')
|
|
->subject('ArrahnBid -Tahniah,Anda Pemenang ArrahnBid')
|
|
->view('template.pemenang', ['user' => $user]);
|
|
}
|
|
}
|