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 @@
- {$file['savename']} + {$file['name']}
{/if} diff --git a/app/http/form/template/image.html b/app/http/form/template/image.html index cbac576b..7a711b05 100644 --- a/app/http/form/template/image.html +++ b/app/http/form/template/image.html @@ -8,12 +8,12 @@
{if $value} {php} - $images = get_cover($value); + $images = get_attach($value); {/php}
- {$images['create_time']} + {$images['create_time']}
{/if} diff --git a/app/http/form/template/images.html b/app/http/form/template/images.html index 1b545e41..0a874a34 100644 --- a/app/http/form/template/images.html +++ b/app/http/form/template/images.html @@ -8,12 +8,12 @@
{if $value} {php} - $images = get_cover($value); + $images = get_attach($value); {/php}
- {$images['create_time']} + {$images['create_time']}
{/if} diff --git a/public/static/common/css/form.css b/public/static/common/css/form.css index 2eb87616..778bb2c1 100644 --- a/public/static/common/css/form.css +++ b/public/static/common/css/form.css @@ -4,4 +4,5 @@ .img-list .item .thumb img{width: 100%;} .img-list .item .thumb .close{position: absolute; right: 5px; top: 5px; opacity: 1; width: 20px; height: 20px; font-size: 10px; text-align: center; line-height: 20px; color: #ffffff; border-radius: 50%; background: #333333;} .file-list{padding: 10px 0; display: flex; flex-direction: column;} -.file-list .attach{line-height: 35px; border-bottom: 1px dotted #333333; cursor: pointer;} \ No newline at end of file +.file-list .attach{line-height: 35px; border-bottom: 1px dotted #333333; cursor: pointer; display: flex; justify-content: flex-start;} +.file-list .attach .close{line-height: 35px; margin-right: 10px;} \ No newline at end of file diff --git a/public/static/common/js/require-form.js b/public/static/common/js/require-form.js index c877bbc6..c99f24b2 100644 --- a/public/static/common/js/require-form.js +++ b/public/static/common/js/require-form.js @@ -595,7 +595,7 @@ define(['jquery', 'bootstrap', 'validator'], function ($, undefined, Validator) if(param.type == 'image'){ var html = '
'; }else{ - var html = '
'+fileList[0].savename+'
'; + var html = '
'+fileList[0].name+'
'; } file.html(html); @@ -606,7 +606,7 @@ define(['jquery', 'bootstrap', 'validator'], function ($, undefined, Validator) if(param.type == 'image'){ var html = '
'; }else{ - var html = '
'+fileList[i].savename+'
'; + var html = '
'+fileList[i].name+'
'; } value.push(fileList[i].id); file.append(html); diff --git a/view/upload/server.html b/view/upload/server.html index 243b3b68..9d90b247 100644 --- a/view/upload/server.html +++ b/view/upload/server.html @@ -34,7 +34,7 @@
{volist name="list" id="item"}
-
{$item['savename']}
+
{$item['name']}
{/volist}