附件组件优化

This commit is contained in:
devil_gong
2019-06-26 16:47:15 +08:00
parent 46c477c105
commit 0bedabe197
13 changed files with 343 additions and 486 deletions

View File

@ -210,6 +210,7 @@ class Ueditor extends Common
if(isset($data['state']) && $data['state'] == 'SUCCESS')
{
$data['type'] = $attachment_type;
$data['path_type'] = empty($this->data_request['path_type']) ? 'other' : $this->data_request['path_type'];
$ret = ResourcesService::AttachmentAdd($data);
if($ret['code'] == 0)
{
@ -266,11 +267,17 @@ class Ueditor extends Common
'm' => $start,
'n' => $size,
'where' => [
'type' => substr($this->current_action, 4),
'path_type' => input('path_type', 'other'),
['type', '=', substr($this->current_action, 4)],
['path_type', '=', empty($this->data_request['path_type']) ? 'other' : $this->data_request['path_type']]
],
];
// 搜索关键字
if(!empty($this->data_request['keywords']))
{
$params['where'][] = ['original', 'like', '%'.$this->data_request['keywords'].'%'];
}
// 数据初始化
$data = array(
'state' => "没有相关数据",
@ -330,6 +337,7 @@ class Ueditor extends Common
if(isset($data['state']) && $data['state'] == 'SUCCESS')
{
$data['type'] = 'remote';
$data['path_type'] = empty($this->data_request['path_type']) ? 'other' : $this->data_request['path_type'];
$ret = ResourcesService::AttachmentAdd($data);
if($ret['code'] != 0)
{