| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | 
							- <?php
 
- namespace Content\Lib;
 
- use Dever;
 
- class Manage
 
- {
 
-     private function search($table = 'content/news')
 
-     {
 
-         $keyword = Dever::input('keyword');
 
-         $yes = Dever::input('yes');
 
-         $where = array();
 
-         $cate = Dever::input('cate');
 
-         if ($cate) {
 
-             $where['cate_id'] = $cate;
 
-         }
 
-         if ($yes) {
 
-             $yes = Dever::db($table)->search(array('ids' => $yes));
 
-         }
 
-         if (!$keyword) {
 
-             $where['limit'] = '0,50';
 
-             $data = Dever::db($table)->search($where);
 
-         } else {
 
-             $where['name'] = $keyword;
 
-             $data = Dever::db($table)->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 search_news_api()
 
-     {
 
-         return $this->search('content/news');
 
-     }
 
-     # 查看图片
 
-     public function pic($pic)
 
-     {
 
-         $table = array();
 
-         $table[0] = '<img src="'.$pic.'" width=“150”/>';
 
-         return Dever::table($table);
 
-     }
 
-     public function picGrid($text)
 
-     {
 
-         $table = array();
 
-         $text = Dever::array_decode($text);
 
-         $table[0] = '';
 
-         foreach ($text as $k => $v) {
 
-             if ($v['pic']) {
 
-                 $table[0] .= '<img src="'.$v['pic'].'" width=“150”/>  ';
 
-             }
 
-         }
 
-         return Dever::table($table);
 
-     }
 
- }
 
 
  |