单位荣誉完成
This commit is contained in:
1 parent
b3856d3e10
commit
16fe8c91f4
15 files changed
+98
-95
No files matched your search
+17
-22
@@ -237,30 +237,25 @@ function teacherNames($list = array())
|
||||
// 重新组合文件路径
|
||||
$savename = str_replace("/","\\",$savename);
|
||||
|
||||
$list['url'] = $savename;
|
||||
$list['newname'] = substr($savename,strripos($savename,'\\')+1,strlen($savename)-strripos($savename,'\\'));
|
||||
$list['hash'] = $file->hash('sha1');
|
||||
$list['userid'] = session('userid');
|
||||
$list['oldname'] = $file->getOriginalName();
|
||||
$list['fieldsize'] = $file->getSize();
|
||||
$list['text'] = $list['text'];
|
||||
$list['bianjitime'] = $file->getMTime();
|
||||
$list['category'] = $file->getOriginalExtension();
|
||||
|
||||
$f = new \app\system\model\Fields;
|
||||
$saveinfo = $f::create($list);
|
||||
|
||||
if($saveinfo)
|
||||
{
|
||||
$data['msg'] = '上传成功';
|
||||
$data['val'] = true;
|
||||
$data['url'] = $savename;
|
||||
}else{
|
||||
$data['msg'] = '上传失败';
|
||||
$data['val'] = false;
|
||||
$data['url'] = '';
|
||||
if($isSave==true){
|
||||
$list['url'] = $savename;
|
||||
$list['newname'] = substr($savename,strripos($savename,'\\')+1,strlen($savename)-strripos($savename,'\\'));
|
||||
$list['hash'] = $file->hash('sha1');
|
||||
$list['userid'] = session('userid');
|
||||
$list['oldname'] = $file->getOriginalName();
|
||||
$list['fieldsize'] = $file->getSize();
|
||||
$list['text'] = $list['text'];
|
||||
$list['bianjitime'] = $file->getMTime();
|
||||
$list['category'] = $file->getOriginalExtension();
|
||||
$f = new \app\system\model\Fields;
|
||||
$saveinfo = $f::create($list);
|
||||
}
|
||||
|
||||
|
||||
$data['msg'] = '上传成功';
|
||||
$data['val'] = true;
|
||||
$data['url'] = $savename;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@@ -509,20 +509,20 @@ class Student extends BaseController
|
||||
|
||||
|
||||
|
||||
// 上传文件
|
||||
public function upload()
|
||||
{
|
||||
// 获取文件信息
|
||||
$list['text'] = $this->request->post('text');
|
||||
$list['serurl'] = $this->request->post('serurl');
|
||||
// // 上传文件
|
||||
// public function upload()
|
||||
// {
|
||||
// // 获取文件信息
|
||||
// $list['text'] = $this->request->post('text');
|
||||
// $list['serurl'] = $this->request->post('serurl');
|
||||
|
||||
// 获取表单上传文件
|
||||
$file = request()->file('file');
|
||||
// 上传文件并返回结果
|
||||
$data = upload($list,$file,true);
|
||||
// // 获取表单上传文件
|
||||
// $file = request()->file('file');
|
||||
// // 上传文件并返回结果
|
||||
// $data = upload($list,$file,true);
|
||||
|
||||
return json($data);
|
||||
}
|
||||
// return json($data);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -370,11 +370,13 @@ class Teacher extends BaseController
|
||||
|
||||
|
||||
// 根据教师姓名、首拼、全拼搜索教师信息
|
||||
public function srcTeacher($str="")
|
||||
public function srcTeacher()
|
||||
{
|
||||
// 声明结果数组
|
||||
$data = array();
|
||||
|
||||
$str = input("post.str");
|
||||
|
||||
// 判断是否存在数据,如果没有数据则返回。
|
||||
if(strlen($str) <= 0){
|
||||
return json($data);
|
||||
@@ -391,7 +393,7 @@ class Teacher extends BaseController
|
||||
]
|
||||
)
|
||||
->append(['age'])
|
||||
->all();
|
||||
->select();
|
||||
return json($list);
|
||||
}
|
||||
|
||||
@@ -405,9 +407,8 @@ class Teacher extends BaseController
|
||||
|
||||
// 获取表单上传文件
|
||||
$file = request()->file('file');
|
||||
$savename = \think\facade\Filesystem::putFile($list['serurl'], $file);
|
||||
|
||||
$data = saveFileInfo($file,$list);
|
||||
$data = saveFileInfo($file,$list,true);
|
||||
|
||||
return json($data);
|
||||
}
|
||||
|
||||
Loaded 3 of 15 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user