diff --git a/app/controller/Upload.php b/app/controller/Upload.php index 20d0e8dd..d52e4de8 100644 --- a/app/controller/Upload.php +++ b/app/controller/Upload.php @@ -61,11 +61,11 @@ class Upload extends Base { 'query' => $this->request->param() ]; if($param['type'] == 'file'){ - $map[] = ['ext', '<>', 'image']; + $map[] = ['type', '<>', 'image']; }else{ - $map[] = ['ext', '=', 'image']; + $map[] = ['type', '=', 'image']; } - $list = Db::name('Attach')->paginate($pageConfig); + $list = Db::where($map)->name('Attach')->paginate($pageConfig); $this->data = [ 'from' => $this->request->param('from'), @@ -141,6 +141,8 @@ class Upload extends Base { $data = []; $file= $request->file('file'); $data['savename'] = $request->param('name'); + $data['name'] = $request->param('name'); + $data['type'] = $upload_type; $data['mime'] = $request->param('type'); $data['size'] = $file->getSize(); //文件大小,单位字节 $data['md5'] = md5_file($file->getPathname()); diff --git a/app/controller/admin/Wechat.php b/app/controller/admin/Wechat.php index 9de7ac2b..2786d22c 100644 --- a/app/controller/admin/Wechat.php +++ b/app/controller/admin/Wechat.php @@ -135,7 +135,7 @@ class Wechat extends Base { $data = $this->request->post(); $result = WechatPay::create($data); if (false != $result) { - return $this->success('添加成功!', url('/admin/wechat/index')); + return $this->success('添加成功!', url('/admin/wechat/pay')); } else { return $this->error('添加失败!'); } @@ -156,7 +156,7 @@ class Wechat extends Base { $data = $this->request->post(); $result = WechatPay::update($data, ['id' => $data['id']]); if ($result !== false) { - return $this->success('编辑成功!', url('/admin/wechat/index')); + return $this->success('编辑成功!', url('/admin/wechat/pay')); } else { return $this->error('修改失败!'); } diff --git a/app/http/form/template/attach.html b/app/http/form/template/attach.html index fdc68254..571c2312 100644 --- a/app/http/form/template/attach.html +++ b/app/http/form/template/attach.html @@ -13,7 +13,7 @@