mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
修改文件类型
This commit is contained in:
@@ -10,68 +10,65 @@ use think\model\concern\SoftDelete;
|
||||
*/
|
||||
class UploadFiles extends Model
|
||||
{
|
||||
//
|
||||
use SoftDelete;
|
||||
//
|
||||
use SoftDelete;
|
||||
|
||||
protected $defaultSoftDelete = 0;
|
||||
protected $defaultSoftDelete = 0;
|
||||
|
||||
public function getSrcAttr()
|
||||
{
|
||||
return \get_source_link($this->getData('save_name'));
|
||||
public function getSrcAttr()
|
||||
{
|
||||
return \get_source_link($this->getData('save_name'));
|
||||
}
|
||||
|
||||
public function getTypeTitleAttr()
|
||||
{
|
||||
return \config('upload_type.' . $this->getData('type'));
|
||||
}
|
||||
|
||||
public function getUsedTimeAttr($value)
|
||||
{
|
||||
if ($value == 0) {
|
||||
return '未使用';
|
||||
}
|
||||
|
||||
public function getTypeAttr($value)
|
||||
{
|
||||
return \config('upload_type.'.$value);
|
||||
return date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
public function getDeleteTimeAttr($value)
|
||||
{
|
||||
if ($value == 0) {
|
||||
return '未删除';
|
||||
}
|
||||
|
||||
public function getUsedTimeAttr($value)
|
||||
{
|
||||
if($value == 0){
|
||||
return '未使用';
|
||||
}
|
||||
|
||||
return date('Y-m-d H:i:s',$value);
|
||||
}
|
||||
public function getDeleteTimeAttr($value)
|
||||
{
|
||||
if($value == 0){
|
||||
return '未删除';
|
||||
}
|
||||
|
||||
return date('Y-m-d H:i:s',$value);
|
||||
}
|
||||
public function getClearTimeAttr($value)
|
||||
{
|
||||
if($value == 0){
|
||||
return '未清除';
|
||||
}
|
||||
|
||||
return date('Y-m-d H:i:s',$value);
|
||||
return date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
public function getClearTimeAttr($value)
|
||||
{
|
||||
if ($value == 0) {
|
||||
return '未清除';
|
||||
}
|
||||
|
||||
public function getStatusAttr($value,$data)
|
||||
{
|
||||
if($data['used_time'] == 0){
|
||||
return '未使用(仅供预览)';
|
||||
}
|
||||
|
||||
if($data['delete_time'] > 0){
|
||||
return '已删除';
|
||||
}
|
||||
|
||||
if($data['clear_time'] > 0){
|
||||
return '已清除';
|
||||
}
|
||||
|
||||
return '使用中';
|
||||
return date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
|
||||
public function getStatusAttr($value, $data)
|
||||
{
|
||||
if ($data['used_time'] == 0) {
|
||||
return '未使用(仅供预览)';
|
||||
}
|
||||
|
||||
public function getFileSizeAttr($value)
|
||||
{
|
||||
return format_size($value);
|
||||
if ($data['delete_time'] > 0) {
|
||||
return '已删除';
|
||||
}
|
||||
|
||||
|
||||
if ($data['clear_time'] > 0) {
|
||||
return '已清除';
|
||||
}
|
||||
|
||||
return '使用中';
|
||||
}
|
||||
|
||||
public function getFileSizeAttr($value)
|
||||
{
|
||||
return format_size($value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<p>保存名称:{$vo->getData('save_name')}</p>
|
||||
<p>文件名:{$vo->getData('file_name')}</p>
|
||||
<p>文件类型: {$vo.mime_type}</p>
|
||||
<p>文件用途: <span style="color: red">{$vo.type}</span> </p>
|
||||
<p>文件用途: <span style="color: red">{$vo.type_title}</span> </p>
|
||||
<p>文件大小: {$vo.file_size}</p>
|
||||
<p>文件指纹: {$vo.file_md5}</p>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user