Fix queries
This commit is contained in:
parent
5872a04187
commit
611cc6a706
2 changed files with 4 additions and 1 deletions
|
@ -333,7 +333,7 @@ class MainController extends Controller{
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
// finally, try exact claim name match
|
// finally, try exact claim name match
|
||||||
$claims = Claim::query()->distinct('claim_id')->where('name',$criteria)->orderByDesc('FIELD(bid_state,"Controlling")')->limit(10)->get();
|
$claims = Claim::query()->distinct('claim_id')->where('name',$criteria)->orderByRaw('FIELD(bid_state,"Controlling") DESC')->limit(10)->get();
|
||||||
if(count($claims)===1){
|
if(count($claims)===1){
|
||||||
return Redirect::to('/claims/'.$claims[0]->claim_id);
|
return Redirect::to('/claims/'.$claims[0]->claim_id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
*/
|
*/
|
||||||
class Address extends Model{
|
class Address extends Model{
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'first_seen' => 'datetime',
|
||||||
|
];
|
||||||
protected $table = 'address';
|
protected $table = 'address';
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue