fix office file ext
This commit is contained in:
parent
f1d87cfbb2
commit
c36b10a416
@ -143,6 +143,14 @@ class FileController extends AbstractController
|
|||||||
])) {
|
])) {
|
||||||
return Base::retError('类型错误');
|
return Base::retError('类型错误');
|
||||||
}
|
}
|
||||||
|
$ext = '';
|
||||||
|
if (in_array($type, [
|
||||||
|
'word',
|
||||||
|
'excel',
|
||||||
|
'ppt',
|
||||||
|
])) {
|
||||||
|
$ext = str_replace(['word', 'excel', 'ppt'], ['docx', 'xlsx', 'pptx'], $type);
|
||||||
|
}
|
||||||
//
|
//
|
||||||
$userid = $user->userid;
|
$userid = $user->userid;
|
||||||
if ($pid > 0) {
|
if ($pid > 0) {
|
||||||
@ -161,6 +169,7 @@ class FileController extends AbstractController
|
|||||||
'pid' => $pid,
|
'pid' => $pid,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
|
'ext' => $ext,
|
||||||
'userid' => $userid,
|
'userid' => $userid,
|
||||||
'created_id' => $user->userid,
|
'created_id' => $user->userid,
|
||||||
]);
|
]);
|
||||||
@ -201,6 +210,7 @@ class FileController extends AbstractController
|
|||||||
'pid' => $row->pid,
|
'pid' => $row->pid,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'type' => $row->type,
|
'type' => $row->type,
|
||||||
|
'ext' => $row->ext,
|
||||||
'userid' => $userid,
|
'userid' => $userid,
|
||||||
'created_id' => $user->userid,
|
'created_id' => $user->userid,
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user