| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 | 
							- <?php
 
- namespace Push\Lib;
 
- use Dever;
 
- class Manage
 
- {
 
-     public function search_api()
 
-     {
 
-         $keyword = Dever::input('keyword');
 
-         $yes = Dever::input('yes');
 
-         $where = array();
 
-         $type = Dever::input('type');
 
-         $func = Dever::db('push/info')->config['func'];
 
-         $func = $func();
 
-         $method = false;
 
-         if ($func && $type && isset($func[$type])) {
 
-             $method = $func[$type]['api'];
 
-         }
 
-         if (!$method) {
 
-             Dever::alert('暂无数据');
 
-         }
 
-         $temp = explode('.', $method);
 
-         $method = $temp[0];
 
-         if ($yes) {
 
-             $yes = Dever::db($method)->search(array('ids' => $yes));
 
-         }
 
-         if (!$keyword) {
 
-             $where['limit'] = '0,50';
 
-             $data = Dever::db($method)->search($where);
 
-         } else {
 
-             $where['name'] = $keyword;
 
-             $data = Dever::db($method)->search($where);
 
-         }
 
-         $result = array();
 
-         if ($yes) {
 
-             foreach ($yes as $k => $v) {
 
-                 if (isset($data[$k])) {
 
-                     unset($data[$k]);
 
-                 }
 
-                 $yes[$k]['selected'] = 'selected';
 
-             }
 
-             $data = $yes + $data;
 
-             $data = array_merge($data, array());
 
-         } else {
 
-             $data = array_merge($data, array());
 
-         }
 
-         if (!$data) {
 
-             Dever::alert('暂无数据');
 
-         }
 
-         return $data;
 
-     }
 
-     # 查看图片
 
-     public function pic($pic)
 
-     {
 
-         $table = array();
 
-         $table[0] = '<img src="'.$pic.'" width=“150”/>';
 
-         return Dever::table($table);
 
-     }
 
-     public function show($id)
 
-     {
 
-         $table = Dever::load('push/lib/data')->getOne($id, 1);
 
-         if (count($table) == 1) {
 
-             $table = $table[0];
 
-         }
 
-         return Dever::table($table);
 
-     }
 
- }
 
 
  |