后台附件增加名称搜索

pull/201/head
27025011 2020-05-26 09:17:46 +08:00
parent 7c8d0a50ae
commit a529ca13b3
6 changed files with 9 additions and 0 deletions

View File

@ -59,6 +59,7 @@ CREATE TABLE `fa_admin_log` (
DROP TABLE IF EXISTS `fa_attachment`;
CREATE TABLE `fa_attachment` (
`id` int(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(30) NOT NULL DEFAULT '' COMMENT '名称名称',
`admin_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '管理员ID',
`user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '会员ID',
`url` varchar(255) NOT NULL DEFAULT '' COMMENT '物理路径',

View File

@ -135,6 +135,7 @@ class Ajax extends Backend
'storage' => 'local',
'sha1' => $sha1,
'extparam' => json_encode($extparam),
'name' => $fileInfo['name'],
);
$attachment = model("attachment");
$attachment->data(array_filter($params));

View File

@ -17,6 +17,10 @@ class Attachment extends Backend
* @var \app\common\model\Attachment
*/
protected $model = null;
/**
* 快速搜索时执行查找的字段
*/
protected $searchFields = 'id,name';
public function _initialize()
{

View File

@ -2,6 +2,7 @@
return [
'Id' => 'ID',
'name' => '名称',
'Admin_id' => '管理员ID',
'User_id' => '会员ID',
'Url' => '物理路径',

View File

@ -126,6 +126,7 @@ class Common extends Api
'uploadtime' => time(),
'storage' => 'local',
'sha1' => $sha1,
'name' => $fileInfo['name'],
);
$attachment = $attachment = new \app\common\model\Attachment();
$attachment->data(array_filter($params));

View File

@ -24,6 +24,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
[
{field: 'state', checkbox: true},
{field: 'id', title: __('Id')},
{field: 'name', title: __('name')},
{field: 'admin_id', title: __('Admin_id'), visible: false, addClass: "selectpage", extend: "data-source='auth/admin/index' data-field='nickname'"},
{field: 'user_id', title: __('User_id'), visible: false, addClass: "selectpage", extend: "data-source='user/user/index' data-field='nickname'"},
{field: 'url', title: __('Preview'), formatter: Controller.api.formatter.thumb, operate: false},