|
@@ -73,7 +73,8 @@ class Api extends BaseController {
|
|
|
$where[] = ["typeId", "=", $row["id"]];
|
|
|
$files = Db::table("new_talent_file")->where($where)->field("id,typeId,orignName,url")->order("sn asc")->select()->toArray();
|
|
|
foreach ($files as &$file) {
|
|
|
- $file["url"] = "/storage/" . $file["url"];
|
|
|
+ $file["ext"] = pathinfo($file["url"])["extension"];
|
|
|
+ $file["url"] = getStoragePath($file["url"]);
|
|
|
}
|
|
|
$rows[$key]["files"] = $files;
|
|
|
}
|
|
@@ -220,7 +221,8 @@ class Api extends BaseController {
|
|
|
$where[] = ["typeId", "=", $row["id"]];
|
|
|
$files = Db::table("new_talent_file")->where($where)->field("id,typeId,orignName,url")->order("sn asc")->select()->toArray();
|
|
|
foreach ($files as &$file) {
|
|
|
- $file["url"] = "/storage/" . $file["url"];
|
|
|
+ $file["ext"] = pathinfo($file["url"])["extension"];
|
|
|
+ $file["url"] = getStoragePath($file["url"]);
|
|
|
}
|
|
|
$rows[$key]["files"] = $files;
|
|
|
}
|
|
@@ -235,7 +237,7 @@ class Api extends BaseController {
|
|
|
$where = [["mainId", "=", $mainId], ["typeId", "=", $typeId]];
|
|
|
$list = Db::table("new_talent_file")->where($where)->select()->toArray();
|
|
|
foreach ($list as $key => $item) {
|
|
|
- $list[$key]["url"] = "/storage/" . $item["url"]; //获取系统配置无效,暂时这样
|
|
|
+ $list[$key]["url"] = getStoragePath($item["url"]);
|
|
|
}
|
|
|
return json($list);
|
|
|
}
|
|
@@ -299,8 +301,9 @@ class Api extends BaseController {
|
|
|
} else {
|
|
|
$fileId = Db::table("new_talent_file")->insertGetId($data);
|
|
|
}
|
|
|
+ $ext = pathinfo($filestd->filepath)["extension"];
|
|
|
TalentLogApi::write($type, $mainId, 0, sprintf("%s附件,附件名为:%s", $change ? "修改" : "添加", $data["orignName"]), 1, $fileTypeId, $fileId);
|
|
|
- $res = ["code" => 200, "msg" => "上传附件成功", "obj" => $index, "info" => "/storage/" . $filestd->filepath, "typeId" => $fileTypeId, "id" => $fileId, "orignName" => $data["orignName"]];
|
|
|
+ $res = ["code" => 200, "msg" => "上传附件成功", "obj" => $index, "ext" => $ext, "info" => getStoragePath($filestd->filepath), "typeId" => $fileTypeId, "id" => $fileId, "orignName" => $data["orignName"]];
|
|
|
echo sprintf("<script>parent.%s(%s);</script>", $backName, json_encode($res));
|
|
|
}
|
|
|
|
|
@@ -463,7 +466,7 @@ class Api extends BaseController {
|
|
|
$res = TalentCommonFile::where($where)->order('sn')->select();
|
|
|
if ($res) {
|
|
|
foreach ($res as $k => &$v) {
|
|
|
- $v['url'] = "/storage/" . $v['url'];
|
|
|
+ $v['url'] = getStoragePath($v['url']);
|
|
|
}
|
|
|
}
|
|
|
return json($res);
|