+----------------------------------------------------------------------------------------------- */ declare (strict_types = 1); namespace app\oa\controller; use app\base\BaseController; use app\adm\model\Note as NoteModel; use think\exception\ValidateException; use think\facade\Db; use think\facade\View; class Note extends BaseController { /** * 构造函数 */ protected $model; public function __construct() { parent::__construct(); // 调用父类构造函数 $this->model = new NoteModel(); } /** * 数据列表 */ public function datalist() { $param = get_params(); if (request()->isAjax()) { $where=[]; $where[]=['a.delete_time','=',0]; if (!empty($param['keywords'])) { $where[] = ['a.id|a.title', 'like', '%' . $param['keywords'] . '%']; } $list = $this->model->datalist($where, $param); return table_assign(0, '', $list); } else{ return view(); } } /** * 查看 */ public function view($id) { $detail = $this->model->getById($id); if (!empty($detail)) { $detail['cate'] = Db::name('NoteCate')->where(['id' => $detail['cate_id']])->value('title'); $detail['admin_name'] = Db::name('Admin')->where(['id' => $detail['admin_id']])->value('name'); if($detail['file_ids'] !=''){ $file_array = Db::name('File')->where('id','in',$detail['file_ids'])->select(); $detail['file_array'] = $file_array; } View::assign('detail', $detail); if(is_mobile()){ return view('qiye@/index/note_view'); } return view(); } else{ return view(EEEOR_REPORTING,['code'=>404,'warning'=>'找不到页面']); } } }