search($param);
if ($data) {
return $data;
} else {
return array
(
0 => array('id' => -1, 'value' => '没有找到您搜索的数据', 'label' => '没有找到您搜索的数据'),
);
}
}
public function search_tag_by_ids($id)
{
$data = Dever::db('upload/tag')->search($id);
return $data;
}
public function add_tag($id, $name, $data)
{
$tag = Dever::param('tag', $data);
if ($tag) {
$temp = explode(',', $tag);
foreach ($temp as $k => $v) {
$info = Dever::db('upload/tag')->one(array('name' => $v));
if (!$info) {
Dever::db('upload/tag')->insert(array('name' => $v));
}
}
}
}
public function file($id)
{
$info = Dever::db('upload/file')->one($id);
$table = array();
$html = '';
$location = '';
$config = Dever::db('upload/upload')->one($info['upload']);
if ($config['yun'] && $config['save_type'] > 2) {
$yun = Dever::db('upload/yun')->one($config['yun']);
$link = $yun['host'] . $info['file'];
$location = $yun['name'] . ':' . $info['file'];
if ($config['save_type'] == 3) {
$location = '
' . '本地服务器:' . $info['file'];
}
} else {
$link = Dever::upload('{uploadRes}' . $info['file']);
$location = '本地服务器:' . $info['file'];
if ($config['save_type'] == 2) {
$yun = Dever::db('upload/yun')->one($config['yun']);
$link = $yun['host'] . $info['file'];
$location = '
' . $yun['name'] . ':' . $info['file'];
}
}
if (strstr($info['file'], '.png') || strstr($info['file'], '.jpg') || strstr($info['file'], '.gif')) {
$html = '';
}
$table['存储位置'] = $location;
$table['文件名'] = $info['name'];
$table['文件大小'] = $info['width'] . '*' . $info['height'];
$html .= Dever::table($table);
return $html;
}
}