mirror of
https://gitee.com/ulthon/ul-file-share.git
synced 2026-07-01 19:12:48 +08:00
32 lines
464 B
PHP
32 lines
464 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace app\model;
|
|
|
|
use think\facade\App;
|
|
use think\Model;
|
|
|
|
/**
|
|
* @mixin \think\Model
|
|
*/
|
|
class ShareFiles extends Model
|
|
{
|
|
|
|
public static function build_safe_path($save_name)
|
|
{
|
|
$root_dir = App::getRootPath();
|
|
|
|
$safe_dir = '/safe/';
|
|
|
|
return $root_dir . $safe_dir . $save_name;
|
|
}
|
|
|
|
public function getFileSizeFormatAttr()
|
|
{
|
|
$value = $this->getData('file_size');
|
|
return format_size($value);
|
|
}
|
|
//
|
|
}
|