| 1234567891011121314151617181920212223242526272829303132 | <?phpnamespace app\model;use DateTimeInterface;use support\Model;class Device extends Model{    protected $table = 'device';    protected $primaryKey = 'device_id';    protected $keyType = 'string';    protected $dateFormat = 'U';    const CREATED_AT = 'device_addtimes';    const UPDATED_AT = null;    public function serializeDate(DateTimeInterface $date)    {        return $date->format('Y-m-d H:i:s');    }    public function ledger()    {        return $this->hasOne(DeviceLedger::class, 'device_ledger_id', 'join_device_ledger_id')            ->select('device_ledger_id', 'device_ledger_name');    }}
 |