Explorar o código

图片地址拼接

林海涛 hai 1 ano
pai
achega
57dcf8cdb8
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      app/common/model/master_worker/MasterWorker.php

+ 10 - 0
app/common/model/master_worker/MasterWorker.php

@@ -9,6 +9,7 @@ namespace app\common\model\master_worker;
 use app\common\model\BaseModel;
 use app\common\model\dict\DictData;
 use app\common\model\MasterWorkerRegister;
+use app\common\service\FileService;
 use think\facade\Cache;
 
 /**
@@ -81,4 +82,13 @@ class MasterWorker extends BaseModel
         return true;
     }
 
+    public function getAvatarAttr($value)
+    {
+        return trim($value) ? FileService::getFileUrl($value) : '';
+    }
+
+    public function getRealAvatarAttr($value)
+    {
+        return trim($value) ? FileService::getFileUrl($value) : '';
+    }
 }