html($params); } } /** * 视图 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 * @datetime 2019-02-06T16:16:34+0800 * @param [array] $params [输入参数] */ public function html($params = []) { // 当前模块/控制器/方法 $module_name = strtolower(request()->module()); $controller_name = strtolower(request()->controller()); $action_name = strtolower(request()->action()); // 获取应用数据 $ret = PluginsService::PluginsData('commontopnotice'); if($ret['code'] == 0) { // 内容是否为空 if(empty($ret['data']['content'])) { return ''; } // 有效时间 if(!empty($ret['data']['time_start'])) { // 是否已开始 if(strtotime($ret['data']['time_start']) > time()) { return ''; } } if(!empty($ret['data']['time_end'])) { // 是否已结束 if(strtotime($ret['data']['time_end']) < time()) { return ''; } } // 非全局 if($ret['data']['is_overall'] != 1) { // 非首页则空 if($module_name.$controller_name.$action_name != 'indexindexindex') { return ''; } } $this->assign('data', $ret['data']); return $this->fetch('../../../plugins/view/commontopnotice/index/content'); } else { return $ret['msg']; } } } ?>