$match = $request->match;
$sector = $request->sector;
$lot = Lot::select('chairs_sell', 'price_full', 'price_half')
->where('id_match', $match)->where('id_stadium_sector', $sector)->first();
if($lot['chairs_sell'] == null || $lot['chairs_sell'] == '') {
'price_full_grandstand' => $lot['price_full'],
'price_half_grandstand' => $lot['price_half'],
'price_full_chair' => 0,
'price_half_chair' => 0
);
} else {
'price_full_chair' => $lot['price_full'],
'price_half_chair' => $lot['price_half'],
'price_full_grandstand' => 0,
'price_half_grandstand' => 0
);
}
return response()->json($data);
CiRtYXRjaCA9ICRyZXF1ZXN0LT5tYXRjaDsKJHNlY3RvciA9ICRyZXF1ZXN0LT5zZWN0b3I7CgokbG90ID0gTG90OjpzZWxlY3QoJ2NoYWlyc19zZWxsJywgJ3ByaWNlX2Z1bGwnLCAncHJpY2VfaGFsZicpCiAgICAtPndoZXJlKCdpZF9tYXRjaCcsICRtYXRjaCktPndoZXJlKCdpZF9zdGFkaXVtX3NlY3RvcicsICRzZWN0b3IpLT5maXJzdCgpOwoKaWYoJGxvdFsnY2hhaXJzX3NlbGwnXSA9PSBudWxsIHx8ICRsb3RbJ2NoYWlyc19zZWxsJ10gPT0gJycpIHsKICAgICRkYXRhID0gYXJyYXkoCiAgICAgICAgJ3ByaWNlX2Z1bGxfZ3JhbmRzdGFuZCcgICA9PiAkbG90WydwcmljZV9mdWxsJ10sCiAgICAgICAgJ3ByaWNlX2hhbGZfZ3JhbmRzdGFuZCcgICA9PiAkbG90WydwcmljZV9oYWxmJ10sCiAgICAgICAgJ3ByaWNlX2Z1bGxfY2hhaXInICAgPT4gMCwKICAgICAgICAncHJpY2VfaGFsZl9jaGFpcicgICA9PiAwCiAgICApOwp9IGVsc2UgewogICAgJGRhdGEgPSBhcnJheSgKICAgICAgICAncHJpY2VfZnVsbF9jaGFpcicgICA9PiAkbG90WydwcmljZV9mdWxsJ10sCiAgICAgICAgJ3ByaWNlX2hhbGZfY2hhaXInICAgPT4gJGxvdFsncHJpY2VfaGFsZiddLAogICAgICAgICdwcmljZV9mdWxsX2dyYW5kc3RhbmQnICAgPT4gMCwKICAgICAgICAncHJpY2VfaGFsZl9ncmFuZHN0YW5kJyAgID0+IDAKICAgICk7Cn0KCnJldHVybiByZXNwb25zZSgpLT5qc29uKCRkYXRhKTs=
$match = $request->match;
$sector = $request->sector;
$lot = Lot::select('chairs_sell', 'price_full', 'price_half')
->where('id_match', $match)->where('id_stadium_sector', $sector)->first();
if($lot['chairs_sell'] == null || $lot['chairs_sell'] == '') {
$data = array(
'price_full_grandstand' => $lot['price_full'],
'price_half_grandstand' => $lot['price_half'],
'price_full_chair' => 0,
'price_half_chair' => 0
);
} else {
$data = array(
'price_full_chair' => $lot['price_full'],
'price_half_chair' => $lot['price_half'],
'price_full_grandstand' => 0,
'price_half_grandstand' => 0
);
}
return response()->json($data);
return response()->json($data);