51 lines
1.2 KiB
PHP
51 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Model;
|
|
|
|
use Hyperf\Database\Model\Builder;
|
|
use Hyperf\DbConnection\Model\Model;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int $driver_id
|
|
* @property string $driver_name
|
|
* @property int $driver_num
|
|
* @property int $sequence
|
|
* @property string $create_time
|
|
* @property string $update_time
|
|
*/
|
|
class DriverSequence extends Model
|
|
{
|
|
/**
|
|
* The table associated with the model.
|
|
*/
|
|
protected ?string $table = 'driver_sequence';
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected array $fillable = [];
|
|
|
|
protected array $guarded = [];
|
|
|
|
/**
|
|
* The attributes that should be cast to native types.
|
|
*/
|
|
protected array $casts = ['id' => 'integer', 'driver_id' => 'integer', 'driver_num' => 'integer', 'sequence' => 'integer'];
|
|
|
|
const string CREATED_AT = 'create_time';
|
|
|
|
const string UPDATED_AT = 'update_time';
|
|
|
|
/**
|
|
* @param int $driverId
|
|
* @return Builder|\Hyperf\Database\Model\Model|null
|
|
*/
|
|
public function getInfoByDriverId(int $driverId): \Hyperf\Database\Model\Model|Builder|null
|
|
{
|
|
return $this->where('driver_id', $driverId)->first();
|
|
}
|
|
}
|