Browse Source

优化2

master
wanghongjun 2 days ago
parent
commit
cca5002379
  1. 3
      app/Models/ParkingLicensePlate.php

3
app/Models/ParkingLicensePlate.php

@ -5,7 +5,6 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Collection;
class ParkingLicensePlate extends Model
{
@ -29,7 +28,7 @@ class ParkingLicensePlate extends Model
return self::query()->where('id', $id)->value('number') ?? '';
}
public static function getId($number): array|Collection
public static function getId($number)
{
return self::query()->where('number', 'like', "%{$number}%")->pluck(
'id'

Loading…
Cancel
Save