Skip to content

Commit 611cc6a

Browse files
committed
Fix queries
1 parent 5872a04 commit 611cc6a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/Http/Controllers/MainController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public function find(): JsonResponse|RedirectResponse|View{
333333
}
334334
}else{
335335
// finally, try exact claim name match
336-
$claims = Claim::query()->distinct('claim_id')->where('name',$criteria)->orderByDesc('FIELD(bid_state,"Controlling")')->limit(10)->get();
336+
$claims = Claim::query()->distinct('claim_id')->where('name',$criteria)->orderByRaw('FIELD(bid_state,"Controlling") DESC')->limit(10)->get();
337337
if(count($claims)===1){
338338
return Redirect::to('/claims/'.$claims[0]->claim_id);
339339
}

app/Models/Address.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
*/
1616
class Address extends Model{
1717

18+
protected $casts = [
19+
'first_seen' => 'datetime',
20+
];
1821
protected $table = 'address';
1922
public $timestamps = false;
2023

0 commit comments

Comments
 (0)