当前位置: 首页>>代码示例>>PHP>>正文


PHP AdminListBuilder::pagination方法代码示例

本文整理汇总了PHP中Admin\Builder\AdminListBuilder::pagination方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminListBuilder::pagination方法的具体用法?PHP AdminListBuilder::pagination怎么用?PHP AdminListBuilder::pagination使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Admin\Builder\AdminListBuilder的用法示例。


在下文中一共展示了AdminListBuilder::pagination方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: scoreLog

 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();
     }
 }
开发者ID:naliduo,项目名称:Lightweight-social-platform,代码行数:31,代码来源:ActionController.class.php

示例2: buildList

 public function buildList($page = 1, $r = 20)
 {
     $map['status'] = array('egt', 0);
     $list = M('Report')->where($map)->page($page, $r)->order('id asc')->select();
     $reportCount = M('Report')->where($map)->count();
     int_to_string($list);
     $builder = new AdminListBuilder();
     $builder->title("举报处理列表");
     $builder->buttonModalPopup(addons_url('Report://Admin/handleEject'), '', '批量处理', array('target-form' => 'ids'))->buttonDisable(addons_url('Report://Admin/ignoreReport'), '忽略处理')->buttonDelete(addons_url('Report://Admin/deleteReport'), '删除举报')->keyId()->keyLink('url', "举报链接", '{$url}')->keyUid('uid', "举报用户的ID")->keyText('reason', "举报原因")->keyText('content', "举报描述")->keyText('type', "举报类型")->keyCreateTime('create_time', "创建时间")->keyUpdateTime('handle_time', "处理时间")->keyText('handle_result', "处理结果")->keyDoActionModalPopup('Report://Admin/handleEject?ids=###|addons_url', '处理', '操作')->keyDoActionEdit('Report://Admin/ignoreReport?ids=###|addons_url', '忽略处理')->key('status', '状态', 'status', array('0' => '未处理', '1' => '处理中', '2' => '已处理'));
     $builder->data($list);
     $builder->pagination($reportCount, $r);
     $builder->display();
 }
开发者ID:xiaolw,项目名称:wacms,代码行数:13,代码来源:AdminController.class.php

示例3: audit

 public function audit($page = 1, $r = 20)
 {
     $aAudit = I('audit', 0);
     $map['status'] = $aAudit;
     $model = $this->atlasModel;
     list($list, $totalCount) = $model->getListByPage($map, $page, 'addtime desc', '*', $r);
     $builder = new AdminListBuilder();
     $builder->title('搞笑列表(审核通过的不在该列表中)')->data($list)->setStatusUrl(U('Atlas/setNewsStatus'))->buttonEnable(null, '审核通过')->buttonModalPopup(U('Atlas/doAudit'), null, '审核不通过', array('data-title' => '设置审核失败原因', 'target-form' => 'ids'))->setSelectPostUrl(U('Admin/Atlas/audit'))->select('', 'audit', 'select', '', '', '', array(array('id' => 0, 'value' => '待审核'), array('id' => -1, 'value' => '审核失败')))->keyId()->keyText('content', '内容')->keyImage('image', '图片')->keyUid()->keyCreateTime('addtime')->keyStatus();
     if ($aAudit == 1) {
         $builder->keyText('reason', '审核失败原因');
     }
     $builder->pagination($totalCount, $r)->display();
 }
开发者ID:chenyongze,项目名称:bighaha,代码行数:13,代码来源:AtlasController.class.php

示例4: lists

 public function lists($page = 1, $r = 20)
 {
     $map['status'] = array('egt', 0);
     $list = M('Report')->where($map)->page($page, $r)->select();
     //   $simplify_list = array_column($list, 'id');
     $reportCount = M('Report')->where($map)->count();
     int_to_string($list);
     $builder = new AdminListBuilder();
     $builder->title("举报处理列表");
     $builder->setStatusUrl(U('setStatus'))->buttonModalPopup(U('handleEject'), '', "处理", $attr = array())->buttonDisable('', '忽略处理')->buttonDelete(U('deleteReport'), '删除举报')->keyId()->keyLink('url', "举报链接", '{$url}')->keyUid('uid', "举报用户的ID")->keyText('reason', "举报原因")->keyText('content', "举报原因")->keyText('type', "举报类型")->keyCreateTime('create_time', "创建时间")->keyUpdateTime('update_time', "更新时间")->keyUpdateTime('handle_time', "处理时间")->keyDoActionModalPopup('handleEject?id=###', '处理', '操作', array('data-title' => '迁移用户到其他身份'))->keyDoActionEdit(' ', '忽略处理')->key('status', '状态', 'status', array('0' => '忽略处理', '1' => '已处理', '2' => '正在处理'));
     $builder->data($list);
     $builder->pagination($reportCount, $r);
     $builder->display();
 }
开发者ID:ccccy,项目名称:wuanlife,代码行数:14,代码来源:ReportController.class.php

示例5: lists

 public function lists($page = 1, $r = 20)
 {
     $map['status'] = array('egt', 0);
     $list = M('Report')->where($map)->page($page, $r)->select();
     //   $simplify_list = array_column($list, 'id');
     $reportCount = M('Report')->where($map)->count();
     int_to_string($list);
     $builder = new AdminListBuilder();
     $builder->title(L('_REPORT_PROCESSING_LIST_'));
     $builder->setStatusUrl(U('setStatus'))->buttonModalPopup(U('handleEject'), '', L('_PROCESS_'), $attr = array())->buttonDisable('', L('_IGNORE_'))->buttonDelete(U('deleteReport'), L('_DELETE_REPORT_'))->keyId()->keyLink('url', L('_REPORT_LINK_'), '{$url}')->keyUid('uid', L('_REPORT_USERS_ID_'))->keyText('reason', L('_REPORT_REASONS_'))->keyText('content', L('_REPORT_REASONS_'))->keyText('type', L('_REPORT_TYPE_'))->keyCreateTime('create_time', L('_CREATE_TIME_'))->keyUpdateTime('update_time', L('_UPDATE_TIME_'))->keyUpdateTime('handle_time', L('_PROCESSING_TIME_'))->keyDoActionModalPopup('handleEject?id=###', L('_PROCESS_'), L('_OPERATION_'), array('data-title' => L('_MIGRATING_USER_TO_ANOTHER_IDENTITY_')))->keyDoActionEdit(' ', L('_IGNORE_'))->key('status', L('_STATUS_'), 'status', array('0' => L('_IGNORE_'), '1' => L('_HAS_BEEN_DEALT_WITH_'), '2' => L('_BEING_PROCESSED_')));
     $builder->data($list);
     $builder->pagination($reportCount, $r);
     $builder->display();
 }
开发者ID:nanhuacrab,项目名称:jhysns,代码行数:14,代码来源:ReportController.class.php

示例6: userList

 public function userList($page = 1, $r = 20)
 {
     $aSearch1 = I('get.user_search1', '');
     $aSearch2 = I('get.user_search2', 0, 'intval');
     $map = array();
     if (empty($aSearch1) && empty($aSearch2)) {
         $aUserGroup = I('get.user_group', 0, 'intval');
         $aRole = I('get.role', 0, 'intval');
         if (!empty($aRole) || !empty($aUserGroup)) {
             $uids = $this->getUids($aUserGroup, $aRole);
             $map['uid'] = array('in', $uids);
         }
         $user = D('member')->where($map)->page($page, $r)->field('uid,nickname')->select();
         foreach ($user as &$v) {
             $v['id'] = $v['uid'];
         }
         unset($v);
         $totalCount = D('member')->where($map)->count();
     } else {
         $uids = $this->getUids_sc($aSearch1, $aSearch2);
         $map['uid'] = array('in', $uids);
         $user = D('member')->where($map)->page($page, $r)->field('uid,nickname')->select();
         foreach ($user as &$v) {
             $v['id'] = $v['uid'];
         }
         unset($v);
         $totalCount = D('member')->where($map)->count();
     }
     $r = 20;
     $role = D('Role')->selectByMap(array('status' => 1));
     $user_role = array(array('id' => 0, 'value' => L('_ALL_')));
     foreach ($role as $key => $v) {
         array_push($user_role, array('id' => $v['id'], 'value' => $v['title']));
     }
     $group = D('AuthGroup')->getGroups();
     $user_group = array(array('id' => 0, 'value' => L('_ALL_')));
     foreach ($group as $key => $v) {
         array_push($user_group, array('id' => $v['id'], 'value' => $v['title']));
     }
     $builder = new AdminListBuilder();
     $builder->title(L('_"MASS_USER_LIST"_'));
     $builder->meta_title = L('_"MASS_USER_LIST"_');
     $builder->setSelectPostUrl(U('Message/userList'))->setSearchPostUrl(U('Message/userList'))->select(L('_USER_GROUP:_'), 'user_group', 'select', L('_FILTER_ACCORDING_TO_USER_GROUP_'), '', '', $user_group)->select(L('_IDENTITY_'), 'role', 'select', L('_FILTER_ACCORDING_TO_USER_IDENTITY_'), '', '', $user_role)->search('', 'user_search1', '', L('_SEARCH_ACCORDING_TO_USERS_NICKNAME_'), '', '', '')->search('', 'user_search2', '', L('_SEARCH_ACCORDING_TO_USER_ID_'), '', '', '');
     $builder->buttonModalPopup(U('Message/sendMessage'), array('user_group' => $aUserGroup, 'role' => $aRole), L('_SEND_A_MESSAGE_'), array('data-title' => L('_MASS_MESSAGE_'), 'target-form' => 'ids', 'can_null' => 'true'));
     $builder->keyText('uid', '用户ID')->keyText('nickname', L('_"NICKNAME"_'));
     $builder->data($user);
     $builder->pagination($totalCount, $r);
     $builder->display();
 }
开发者ID:naliduo,项目名称:Lightweight-social-platform,代码行数:49,代码来源:MessageController.class.php

示例7: userList

 public function userList($page = 1, $r = 20)
 {
     $aUserGroup = I('get.user_group', 0, 'intval');
     $aRole = I('get.role', 0, 'intval');
     $map = array();
     if (!empty($aRole) || !empty($aUserGroup)) {
         $uids = $this->getUids($aUserGroup, $aRole);
         $map['uid'] = array('in', $uids);
     }
     $user = D('member')->where($map)->page($page, $r)->field('uid,nickname')->select();
     foreach ($user as &$v) {
         $v['id'] = $v['uid'];
     }
     unset($v);
     $totalCount = D('member')->where($map)->count();
     $r = 20;
     $role = D('Role')->selectByMap(array('status' => 1));
     $user_role = array(array('id' => 0, 'value' => '全部'));
     foreach ($role as $key => $v) {
         array_push($user_role, array('id' => $v['id'], 'value' => $v['title']));
     }
     $group = D('AuthGroup')->getGroups();
     $user_group = array(array('id' => 0, 'value' => '全部'));
     foreach ($group as $key => $v) {
         array_push($user_group, array('id' => $v['id'], 'value' => $v['title']));
     }
     $builder = new AdminListBuilder();
     $builder->title("群发用户列表");
     $builder->meta_title = '群发用户列表';
     $builder->setSelectPostUrl(U('Message/userList'))->select('用户组:', 'user_group', 'select', '根据用户组筛选', '', '', $user_group)->select('身份:', 'role', 'select', '根据用户身份筛选', '', '', $user_role);
     $builder->buttonModalPopup(U('Message/sendMessage'), array('user_group' => $aUserGroup, 'role' => $aRole), '发送消息', array('data-title' => '群发消息', 'target-form' => 'ids', 'can_null' => 'true'));
     $builder->keyText('uid', '用户ID')->keyText('nickname', "昵称");
     $builder->data($user);
     $builder->pagination($totalCount, $r);
     $builder->display();
 }
开发者ID:ccccy,项目名称:wuanlife,代码行数:36,代码来源:MessageController.class.php

示例8: field

 public function field($id, $page = 1, $r = 20)
 {
     $profile = D('field_group')->where('id=' . $id)->find();
     $map['status'] = array('egt', 0);
     $map['profile_group_id'] = $id;
     $field_list = D('field_setting')->where($map)->order("sort asc")->page($page, $r)->select();
     $totalCount = D('field_setting')->where($map)->count();
     $type_default = array('input' => L('_ONE-WAY_TEXT_BOX_'), 'radio' => L('_RADIO_BUTTON_'), 'checkbox' => L('_CHECKBOX_'), 'select' => L('_DROP-DOWN_BOX_'), 'time' => L('_DATE_'), 'textarea' => L('_MULTI_LINE_TEXT_BOX_'));
     $child_type = array('string' => L('_STRING_'), 'phone' => L('_PHONE_NUMBER_'), 'email' => L('_MAILBOX_'), 'number' => L('_NUMBER_'), 'join' => L('_RELATED_FIELD_'));
     foreach ($field_list as &$val) {
         $val['form_type'] = $type_default[$val['form_type']];
         $val['child_form_type'] = $child_type[$val['child_form_type']];
     }
     $builder = new AdminListBuilder();
     $builder->title('【' . $profile['profile_name'] . '】 字段管理');
     $builder->meta_title = $profile['profile_name'] . L('_FIELD_MANAGEMENT_');
     $builder->buttonNew(U('editFieldSetting', array('id' => '0', 'profile_group_id' => $id)))->buttonDelete(U('setFieldSettingStatus', array('status' => '-1')))->setStatusUrl(U('setFieldSettingStatus'))->buttonSort(U('sortField', array('id' => $id)))->button(L('_RETURN_'), array('href' => U('profile')));
     $builder->keyId()->keyText('field_name', L('_FIELD_NAME_'))->keyBool('visiable', L('_OPEN_YE_OR_NO_'))->keyBool('required', L('_WHETHER_THE_REQUIRED_'))->keyText('sort', L('_SORT_'))->keyText('form_type', L('_FORM_TYPE_'))->keyText('child_form_type', L('_TWO_FORM_TYPE_'))->keyText('form_default_value', L('_DEFAULT_'))->keyText('validation', L('_FORM_VERIFICATION_MODE_'))->keyText('input_tips', L('_USER_INPUT_PROMPT_'));
     $builder->keyTime("createTime", L('_CREATE_TIME_'))->keyStatus()->keyDoAction('User/editFieldSetting?profile_group_id=' . $id . '&id=###', L('_EDIT_'));
     $builder->data($field_list);
     $builder->pagination($totalCount, $r);
     $builder->display();
 }
开发者ID:naliduo,项目名称:Lightweight-social-platform,代码行数:23,代码来源:UserController.class.php

示例9: index

 public function index($page = 1, $r = 20)
 {
     $aCate = I('cate', 0, 'intval');
     if ($aCate) {
         $cates = $this->newsCategoryModel->getCategoryList(array('pid' => $aCate));
         $cates = array_column($cates, 'id');
         $map['category'] = array('in', array_merge(array($aCate), $cates));
     }
     $aDead = I('dead', 0, 'intval');
     if ($aDead) {
         $map['dead_line'] = array('elt', time());
     } else {
         $map['dead_line'] = array('gt', time());
     }
     $aPos = I('pos', 0, 'intval');
     /* 设置推荐位 */
     if ($aPos > 0) {
         $map[] = "position & {$aPos} = {$aPos}";
     }
     $map['status'] = 1;
     $positions = $this->_getPositions(1);
     list($list, $totalCount) = $this->newsModel->getListByPage($map, $page, 'update_time desc', '*', $r);
     $category = $this->newsCategoryModel->getCategoryList(array('status' => array('egt', 0)), 1);
     $category = array_combine(array_column($category, 'id'), $category);
     foreach ($list as &$val) {
         $val['category'] = '[' . $val['category'] . '] ' . $category[$val['category']]['title'];
     }
     unset($val);
     $optCategory = $category;
     foreach ($optCategory as &$val) {
         $val['value'] = $val['title'];
     }
     unset($val);
     $builder = new AdminListBuilder();
     $builder->title('资讯列表')->data($list)->setSelectPostUrl(U('Admin/News/index'))->select('', 'cate', 'select', '', '', '', array_merge(array(array('id' => 0, 'value' => '全部')), $optCategory))->select('', 'dead', 'select', '', '', '', array(array('id' => 0, 'value' => '当前资讯'), array('id' => 1, 'value' => '历史资讯')))->select('推荐位:', 'pos', 'select', '', '', '', array_merge(array(array('id' => 0, 'value' => '全部(含未推荐)')), $positions))->buttonNew(U('News/editNews'))->keyId()->keyUid()->keyText('title', '标题')->keyText('category', '分类')->keyText('description', '摘要')->keyText('sort', '排序')->keyStatus()->keyTime('dead_line', '有效期至')->keyCreateTime()->keyUpdateTime()->keyDoActionEdit('News/editNews?id=###');
     if (!$aDead) {
         $builder->ajaxButton(U('News/setDead'), '', '设为到期')->keyDoAction('News/setDead?ids=###', '设为到期');
     }
     $builder->pagination($totalCount, $r)->display();
 }
开发者ID:chenyongze,项目名称:bighaha,代码行数:40,代码来源:NewsController.class.php

示例10: field

 public function field($id, $page = 1, $r = 20)
 {
     $profile = D('field_group')->where('id=' . $id)->find();
     $map['status'] = array('egt', 0);
     $map['profile_group_id'] = $id;
     $field_list = D('field_setting')->where($map)->order("sort asc")->page($page, $r)->select();
     $totalCount = D('field_setting')->where($map)->count();
     $type_default = array('input' => '单行文本框', 'radio' => '单选按钮', 'checkbox' => '多选框', 'select' => '下拉选择框', 'time' => '日期', 'textarea' => '多行文本框');
     $child_type = array('string' => '字符串', 'phone' => '手机号码', 'email' => '邮箱', 'number' => '数字', 'join' => '关联字段');
     foreach ($field_list as &$val) {
         $val['form_type'] = $type_default[$val['form_type']];
         $val['child_form_type'] = $child_type[$val['child_form_type']];
     }
     $builder = new AdminListBuilder();
     $builder->title('【' . $profile['profile_name'] . '】 字段管理');
     $builder->meta_title = $profile['profile_name'] . '字段管理';
     $builder->buttonNew(U('editFieldSetting', array('id' => '0', 'profile_group_id' => $id)))->buttonDelete(U('setFieldSettingStatus', array('status' => '-1')))->setStatusUrl(U('setFieldSettingStatus'))->buttonSort(U('sortField', array('id' => $id)))->button('返回', array('href' => U('profile')));
     $builder->keyId()->keyText('field_name', "字段名称")->keyBool('visiable', '是否公开')->keyBool('required', '是否必填')->keyText('sort', "排序")->keyText('form_type', '表单类型')->keyText('child_form_type', '二级表单类型')->keyText('form_default_value', '默认值')->keyText('validation', '表单验证方式')->keyText('input_tips', '用户输入提示');
     $builder->keyTime("createTime", "创建时间")->keyStatus()->keyDoAction('User/editFieldSetting?profile_group_id=' . $id . '&id=###', '编辑');
     $builder->data($field_list);
     $builder->pagination($totalCount, $r);
     $builder->display();
 }
开发者ID:ccccy,项目名称:wuanlife,代码行数:23,代码来源:UserController.class.php

示例11: adv

 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();
 }
开发者ID:naliduo,项目名称:Lightweight-social-platform,代码行数:34,代码来源:AdvController.class.php

示例12: fieldTrash

 public function fieldTrash($page = 1, $r = 20)
 {
     $aModel = I('model', 'CatField', 'text');
     $listBuilder = new AdminListBuilder();
     $listBuilder->clearTrash($aModel);
     $listBuilder->title('字段管理');
     $data = M('cat_field')->where(' status=-1')->order('sort desc')->page($page, $r)->select();
     $totalCount = M('cat_field')->where(' status=-1')->count();
     $type_alias = array(IT_SINGLE_TEXT => '单行文本', IT_MULTI_TEXT => '多行文本', IT_SELECT => '下拉框', IT_CHECKBOX => '多选框', IT_RADIO => '单选框', IT_EDITOR => '编辑器', IT_PIC => '单图上传');
     foreach ($data as $key => $v) {
         $data[$key]['input_type'] = $type_alias[$v['input_type']];
         $entity = M('cat_entity')->find($v['entity_id']);
         $data[$key]['entity_alias'] = $entity['alias'];
     }
     $listBuilder->keyId();
     $listBuilder->keyText('name', '英文名')->keyLink('entity_alias', '模型', 'field?entity_id={$entity_id}')->keyText('alias', '中文名')->keyText('sort', '排序')->keyText('input_type', '输入类型');
     $listBuilder->keyDoActionEdit('editField?id=####');
     $listBuilder->buttonRestore(U('setFieldStatus', array('status' => 1)))->buttonClear('CatField');
     //$listBuilder->buttonSort(U('sortField'));
     $listBuilder->pagination($totalCount, $r);
     $listBuilder->data($data);
     $listBuilder->display();
 }
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:23,代码来源:CatController.class.php

示例13: goodsList

 public function goodsList($page = 1, $r = 20)
 {
     $map['status'] = array('egt', 0);
     $goodsList = $this->shopModel->where($map)->order('createtime desc')->page($page, $r)->select();
     $totalCount = $this->shopModel->where($map)->count();
     $builder = new AdminListBuilder();
     $builder->title('商品列表');
     $builder->meta_title = '商品列表';
     foreach ($goodsList as &$val) {
         $category = $this->shop_categoryModel->where('id=' . $val['category_id'])->getField('title');
         $val['category'] = $category;
         unset($category);
         $val['is_new'] = $val['is_new'] == 0 ? '否' : '是';
     }
     unset($val);
     $builder->buttonNew(U('Shop/goodsEdit'))->buttonDelete(U('setGoodsStatus'))->setStatusUrl(U('setGoodsStatus'));
     $builder->keyId()->keyText('goods_name', '商品名称')->keyText('category', '商品分类')->keyText('goods_introduct', '商品广告语')->keyText('money_need', '商品价格')->keyText('goods_num', '商品余量')->keyText('sell_num', '已售出量')->keyLink('is_new', '是否为新品', 'Shop/setNew?id=###')->keyStatus('status', '出售状态')->keyUpdateTime('changetime')->keyCreateTime('createtime')->keyDoActionEdit('Shop/goodsEdit?id=###');
     $builder->data($goodsList);
     $builder->pagination($totalCount, $r);
     $builder->display();
 }
开发者ID:chenyongze,项目名称:bighaha,代码行数:21,代码来源:ShopController.class.php

示例14: index

 public function index($page = 1, $r = 20)
 {
     $aStatus = I('get.status', 0, 'intval');
     if ($aStatus == 0) {
         $map['status'] = 1;
     } elseif ($aStatus == 1) {
         $map['status'] = 2;
     } else {
         $map['status'] = 0;
     }
     list($list, $totalCount) = $this->questionModel->getListPageByMap($map, $page, 'is_recommend desc,create_time desc', $r, '*');
     $builder = new AdminListBuilder();
     $builder->title('问题列表页');
     $builder->setSelectPostUrl(U('Question/index'))->select('', 'status', 'select', '', '', '', array(array('id' => 0, 'value' => '当前问题(启用)'), array('id' => 1, 'value' => '未审核'), array('id' => 2, 'value' => '审核失败或已禁用')));
     $builder->setStatusUrl(U('Question/setQuestionStatus'));
     if ($aStatus == 1) {
         $builder->buttonEnable(null, '审核通过')->buttonDisable(null, '审核失败')->buttonDelete(null, '直接删除');
     } elseif ($aStatus == 2) {
         $builder->buttonEnable(null, '启用或审核通过')->buttonDelete();
     } else {
         $builder->buttonEnable()->buttonDisable()->buttonDelete()->ajaxButton(U('Question/recommend'), array('recommend' => 1), '设为推荐')->ajaxButton(U('Question/recommend'), array('recommend' => 0), '取消推荐');
     }
     $builder->keyId()->keyLink('title', '标题', 'Question/Index/detail?id=###')->keyUid()->keyText('category', '分类')->keyBool('is_recommend', '是否为推荐')->keyCreateTime()->keyUpdateTime()->keyStatus();
     $builder->pagination($totalCount, $r)->data($list)->display();
 }
开发者ID:chenyongze,项目名称:bighaha,代码行数:25,代码来源:QuestionController.class.php


注:本文中的Admin\Builder\AdminListBuilder::pagination方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。