public function scoreLog($r = 20, $p = 1) { if (I('type') == 'clear') { D('ScoreLog')->where(array('id>0'))->delete(); $this->success('清空成功。', U('scoreLog')); exit; } else { $aUid = I('uid', 0, ''); if ($aUid) { $map['uid'] = $aUid; } $listBuilder = new AdminListBuilder(); $listBuilder->title('积分日志'); $map['status'] = array('gt', -1); $scoreLog = D('ScoreLog')->where($map)->order('create_time desc')->findPage($r); $scoreTypes = D('Ucenter/Score')->getTypeListByIndex(); foreach ($scoreLog['data'] as &$v) { $v['adjustType'] = $v['action'] == 'inc' ? '增加' : '减少'; $v['scoreType'] = $scoreTypes[$v['type']]['title']; $class = $v['action'] == 'inc' ? 'text-success' : 'text-danger'; $v['value'] = '<span class="' . $class . '">' . ($v['action'] == 'inc' ? '+' : '-') . $v['value'] . $scoreTypes[$v['type']]['unit'] . '</span>'; $v['finally_value'] = $v['finally_value'] . $scoreTypes[$v['type']]['unit']; } $listBuilder->data($scoreLog['data']); $listBuilder->keyId()->keyUid('uid', '用户')->keyText('scoreType', '积分类型')->keyText('adjustType', '调整类型')->keyHtml('value', '积分变动')->keyText('finally_value', '积分最终值')->keyText('remark', '变动描述')->keyCreateTime(); $listBuilder->pagination($scoreLog['count'], $r); $listBuilder->search(L('_SEARCH_'), 'uid', 'text', '输入UID'); $listBuilder->button('清空日志', array('url' => U('scoreLog', array('type' => 'clear')), 'class' => 'btn ajax-get confirm')); $listBuilder->display(); } }
public function lists() { $listBuilder = new AdminListBuilder(); /*刷新模块列表时清空缓存*/ $aRefresh = I('get.refresh', 0, 'intval'); if ($aRefresh) { S('module_all', null); } /*刷新模块列表时清空缓存 end*/ $modules = $this->moduleModel->getAll(); foreach ($modules as &$m) { $m['alias'] = '<i class="icon-' . $m['icon'] . '"></i> ' . $m['alias']; if ($m['is_setup']) { $m['name'] = '<i class="icon-ok" style="color: green;"></i> ' . $m['name']; if ($m['can_uninstall']) { $m['do'] = '<a class="btn btn-error " onclick="moduleManager.uninstall(\'' . $m['id'] . '\')"><span style="color: red;" ><i class="icon-cut"></i></span> 卸载</a>'; } } else { $m['name'] = '<i class="icon-remove" style="color: red;"></i> ' . $m['name']; $m['do'] = '<a class="btn" onclick="moduleManager.install(\'' . $m['id'] . '\')"><span style="color: green;"<i class="icon-check"></i></span> 安装</a>'; } if ($m['is_com']) { $m['is_com'] = '<strong style="color: orange">商业模块</strong>'; } else { $m['is_com'] = '<strong style="color: green">免费模块</strong>'; } } unset($m); $listBuilder->data($modules); $listBuilder->title('模块管理'); $listBuilder->button('刷新', array('href' => U('Admin/Module/lists', array('refresh' => 1)))); $listBuilder->keyId()->keyHtml('alias', '模块名')->keyText('name', '模块英文名')->keyText('summary', '模块介绍')->keyText('version', '版本号')->keyText('is_com', '商业模块')->keyLink('developer', '开发者', '{$website}')->keyText('entry', '前台入口')->keyText('admin_entry', '后台入口')->keyText('do', '操作'); $listBuilder->display(); }
public function lists() { $listBuilder = new AdminListBuilder(); /*刷新模块列表时清空缓存*/ $aRefresh = I('get.refresh', 0, 'intval'); if ($aRefresh == 1) { D('Module')->reload(); } else { if ($aRefresh == 2) { D('Module')->cleanModulesCache(); } } /*刷新模块列表时清空缓存 end*/ $modules = $this->moduleModel->getAll(); foreach ($modules as &$m) { $m['alias'] = '<a href="' . U('edit?', array('name' => $m['name'])) . '"><i class="icon-' . $m['icon'] . '"></i> ' . $m['alias'] . '</a>'; if ($m['is_setup']) { $m['name'] = '<i class="icon-ok" style="color: green;"></i> ' . $m['name']; if ($m['can_uninstall'] == 1) { $m['do'] = '<a class="btn btn-error " href="' . U('uninstall', array('id' => $m['id'])) . '"><span style="color: red;" ><i class="icon-cut"></i></span> 卸载</a>'; } else { $m['do'] = '系统模块'; } } else { $m['do'] = '<a class="btn" href="' . U('install', array('name' => $m['name'])) . '"><span style="color: green;"<i class="icon-check"></i></span> 安装</a>'; $m['name'] = '<i class="icon-remove" style="color: red;"></i> ' . $m['name']; // $m['do'] = '<a class="btn" onclick="moduleManager.install(\'' . $m['id'] . '\')"><span style="color: green;"<i class="icon-check"></i></span> 安装</a>'; } } unset($m); $listBuilder->data($modules); $listBuilder->title('模块管理'); $listBuilder->button('刷新(读入新的模块)', array('href' => U('Admin/Module/lists', array('refresh' => 2)))); $listBuilder->button('重置(根据预设模块信息重置)', array('href' => U('Admin/Module/lists', array('refresh' => 1)))); $listBuilder->keyId()->keyHtml('alias', '模块名')->keyText('name', '模块英文名')->keyText('summary', '模块介绍')->keyText('version', '版本号')->keyLink('developer', '开发者', '{$website}')->keyText('entry', '前台入口')->keyText('admin_entry', '后台入口')->keyHtml('do', '操作'); $listBuilder->display(); }
public function adv($r = 20) { $aPosId = I('pos_id', 0, 'intval'); $advPosModel = D('Common/AdvPos'); $pos = $advPosModel->find($aPosId); if ($aPosId != 0) { $map['pos_id'] = $aPosId; } $map['status'] = 1; $data = D('Adv')->where($map)->order('pos_id desc,sort desc')->findPage($r); foreach ($data['data'] as &$v) { $p = $advPosModel->find($v['pos_id']); $v['pos'] = '<a class="text-danger" href="' . U('adv?pos_id=' . $p['pos_id']) . '">' . $p['title'] . '</a>'; } //todo 广告管理列表 $builder = new AdminListBuilder(); if ($aPosId == 0) { $builder->title('广告管理'); } else { $builder->title($pos['title'] . '【' . $pos['name'] . '】' . ' 设置——' . $advPosModel->switchType($pos['type'])); } $builder->keyId()->keyLink('title', '广告说明', 'editAdv?id=###'); $builder->keyHtml('pos', '所属广告位'); $builder->keyText('click_count', '点击量'); $builder->buttonNew(U('editAdv?pos_id=' . $aPosId), '新增广告'); if ($aPosId != 0) { $builder->button('广告排期查看', array('href' => U('schedule?pos_id=' . $aPosId))); $builder->button('设置广告位', array('href' => U('editPos?id=' . $aPosId))); } $builder->keyText('url', '链接地址')->keyTime('start_time', '开始生效时间', '不设置则立即生效')->keyTime('end_time', '失效时间', '不设置则一直有效')->keyText('sort', '排序')->keyCreateTime()->keyStatus(); $builder->data($data['data']); $builder->pagination($data['count'], $r); $builder->display(); }
/** * 章节列表 * @author 郑钟良<*****@*****.**> */ public function sections() { $aBookId = I('get.book_id', 0, 'intval'); $aSectionId = I('get.id', 0, 'intval'); if ($aBookId) { $book = $this->bookModel->getData($aBookId); if (!$book) { $this->error(L('_THE_TUTORIAL_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED_WITH_EXCLAMATION_')); } $title = $book['title']; $map['status'] = array('neq', -1); $map['book_id'] = $aBookId; $map['pid'] = 0; $list = $this->bookSectionModel->getlist($map); } elseif ($aSectionId) { $section = $this->bookSectionModel->getData($aSectionId); if (!$section) { $this->error(L('_THE_SECTION_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED_WITH_EXCLAMATION_')); } $title = ''; $title = $this->bookSectionModel->getTitle($aSectionId, $title); $map['status'] = array('neq', -1); $map['book_id'] = $section['book_id']; $map['pid'] = $aSectionId; $list = $this->bookSectionModel->getlist($map); } else { $this->error(L('_PLEASE_CHOOSE_A_CHAPTER_OR_TUTORIAL_WITH_EXCLAMATION_')); } foreach ($list as &$val) { if (!$val['type']) { $val['sections_link'] = '<a href="' . U('Book/sections', array('id' => $val['id'])) . '">章节</a> <a href="' . U('Book/editSections', array('id' => $val['id'])) . '">编辑章节</a>'; $val['type_title'] = L('_CHAPTER_'); } else { $val['type_title'] = L('_ARTICLE_'); } if (!$val['is_show']) { $val['is_show'] = L('_DRAFT_'); } else { $val['is_show'] = L('_NORMAL_'); } } unset($val); $builder = new AdminListBuilder(); $builder->title(op_t($title))->data($list); if ($aBookId) { $builder->button(L('_EDIT_THIS_LAYER_SECTION_'), array('href' => U('Book/editSections', array('book_id' => $aBookId)))); } else { $builder->button(L('_EDIT_THIS_LAYER_SECTION_'), array('href' => U('Book/editSections', array('id' => $aSectionId)))); } $builder->setStatusUrl(U('Book/setSectionStatus'))->buttonEnable()->buttonDisable()->buttonDelete()->ajaxButton(U('Book/changeSectionType'), array('type' => 1), L('_TURN_TO_THE_ARTICLE_TYPE_'))->ajaxButton(U('Book/changeSectionType'), array('type' => 0), L('_TURN_TO_CHAPTER_TYPE_'))->buttonSort(U('Book/sortSections', array('pid' => $map['pid'], 'book_id' => $map['book_id'])), L('_SORT_'))->keyId()->keyText('type_title', L('_TYPE_'))->keyLink('title', L('_TITLE_'), 'Book/Index/read?section_id=###')->keyText('sections_link', L('_SECTION_OPERATION_'))->keyDoActionEdit('Book/editSection?id=###')->keyDoAction('Book/copySection?id=###', L('_COPY_'))->keyBool('open_child', L('_START_SUB_CHAPTER_'))->keyText('keywords', L('_KEY_WORDS_'))->keyText('is_show', L('_DRAFT_NORMAL_WITH_SLASH_'))->keyUid()->keyStatus()->keyCreateTime()->display(); }