mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-04 03:38:41 +00:00
Fix media createdBy output
This commit is contained in:
parent
2990f5694b
commit
1867c1b77e
|
|
@ -136,11 +136,11 @@ class Media
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return mixed
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getCreatedBy() : int
|
||||
public function getCreatedBy()
|
||||
{
|
||||
return $this->createdBy;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ use phpOMS\DataStorage\Database\DataMapperAbstract;
|
|||
use phpOMS\DataStorage\Database\Query\Builder;
|
||||
use phpOMS\DataStorage\Database\Query\Column;
|
||||
use phpOMS\DataStorage\Database\RelationType;
|
||||
use Modules\Admin\Models\AccountMapper;
|
||||
|
||||
class MediaMapper extends DataMapperAbstract
|
||||
{
|
||||
|
|
@ -42,6 +43,13 @@ class MediaMapper extends DataMapperAbstract
|
|||
'media_created_at' => ['name' => 'media_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||
];
|
||||
|
||||
protected static $belongsTo = [
|
||||
'createdBy' => [
|
||||
'mapper' => AccountMapper::class,
|
||||
'dest' => 'media_created_by',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Primary table.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getName(), ENT_COMPAT, 'utf-8'); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getExtension(), ENT_COMPAT, 'utf-8'); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getSize(), ENT_COMPAT, 'utf-8'); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getCreatedBy(), ENT_COMPAT, 'utf-8'); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getCreatedBy()->getName1(), ENT_COMPAT, 'utf-8'); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getCreatedAt()->format('Y-m-d H:i:s'), ENT_COMPAT, 'utf-8'); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if($count === 0) : ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user