@@ -52,9 +52,9 @@ return array
'url' => array
(
'type' => 'varchar-800',
- 'name' => '转换的url',
+ 'name' => '需要转换的网址',
'default' => '',
- 'desc' => '转换的url',
+ 'desc' => '需要转换的网址',
'match' => 'is_string',
'update' => 'text',
'search' => 'fulltext',
@@ -67,9 +67,11 @@ return array
'name' => '参数',
'desc' => '参数',
- 'match' => 'is_string',
- 'update' => 'text',
- 'list' => true,
+ 'match' => 'option',
+ //'update' => 'text',
+ //'list' => true,
+ 'list_name' => '短连接',
+ 'list' => 'Dever::load("short/handle.showUrl", {id})',
),
'key' => array
@@ -78,10 +80,10 @@ return array
'name' => '关键字',
'desc' => '关键字',
- 'search' => 'fulltext',
+ //'search' => 'fulltext',
'state' => array
@@ -6,6 +6,14 @@ use Dever;
class Handle
{
+ public function showUrl($id)
+ {
+ $info = Dever::db('short/info')->one($id);
+ $type = Dever::db('short/type')->one($info['type']);
+
+ return $type['host'] . Dever::uid($id);
+ }
public function get($type, $url, $param, $host = '')
$param = json_encode($param);