本文整理汇总了PHP中Admin\Builder\AdminListBuilder::ajaxButton方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminListBuilder::ajaxButton方法的具体用法?PHP AdminListBuilder::ajaxButton怎么用?PHP AdminListBuilder::ajaxButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin\Builder\AdminListBuilder
的用法示例。
在下文中一共展示了AdminListBuilder::ajaxButton方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildList
/**
* 公告列表
* @param int $page
* @param int $r
* @author 郑钟良<zzl@ourstu.com>
*/
public function buildList($page = 1, $r = 20)
{
$map['status'] = 1;
$aDown = I('down', 0, 'intval');
$this->assign('down', $aDown);
if ($aDown) {
$map['end_time'] = array('elt', time());
} else {
$map['end_time'] = array('gt', time());
}
list($list, $totalCount) = $this->announcementModel->getListPage($map, $page, 'id desc', $r);
$builder = new AdminListBuilder();
$builder->title('公告列表');
$builder->buttonNew(addons_url('Announcement://admin/edit'));
$builder->setSelectPostUrl(addons_url('Announcement://admin/buildList'))->select('', 'down', 'select', '', '', '', array(array('id' => 0, 'value' => '当前公告'), array('id' => 1, 'value' => '历史公告')));
$builder->keyId()->keyTitle()->keyIcon()->keyText('link', '链接')->keyText('content', '内容')->keyCreateTime()->keyTime('end_time', '截止日期');
$builder->keyDoActionEdit('Announcement://admin/edit?id=###|addons_url');
if (!$aDown) {
$builder->ajaxButton(addons_url('Announcement://admin/setEnd'), '', '设为到期')->keyDoAction('Announcement://admin/setEnd?ids=###|addons_url', '设为到期');
}
$builder->data($list)->pagination($totalCount, $r);
$builder->display();
}
示例2: 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();
}
示例3: infoTrash
public function infoTrash($entity_id = 0, $page = 1, $r = 20, $title = '')
{
$listBuilder = new AdminListBuilder();
$listBuilder->clearTrash('CatInfo');
$entity_id = intval($entity_id);
$map['status'] = array('eq', -1);
if ($title != '') {
$map['title'] = array('like', "%{$title}%");
}
if ($entity_id != 0) {
$map['entity_id'] = $entity_id;
$list = M('cat_info')->where($map)->order('create_time desc')->page($page, $r)->select();
$totalCount = M('cat_info')->where($map)->count();
$entity = M('cat_entity')->find($entity_id);
foreach ($list as &$v) {
$v['entity_alias'] = $entity['alias'];
}
unset($v);
} else {
$list = M('cat_info')->where($map)->order('create_time desc')->page($page, $r)->select();
$totalCount = M('cat_info')->where($map)->count();
}
$listBuilder->ajaxButton(U('setInfoField'), array('field' => 'status', 'value' => 1), '还原')->buttonClear('');
$listBuilder->title('信息回收站')->keyId()->keyLink('entity_alias', '信息模型', '?entity_id={$entity_id}')->keyTitle()->keyStatus()->keyBool('top', '置顶')->keyBool('recom', '推荐');
$listBuilder->search('搜索', 'title', null, '标题');
$listBuilder->data($list)->pagination($totalCount, $r)->display();
}
示例4: withdrawList
public function withdrawList($r = 15, $page = 1)
{
$listBuilder = new AdminListBuilder();
$recordModel = D('recharge_withdraw');
$data = $recordModel->order('create_time desc')->page($p, $r)->select();
$totalCount = $recordModel->count();
foreach ($data as &$v) {
$type = D('Ucenter/Score')->getType(array('id' => $v['field'], 'status' => 1));
$v['type_title'] = $type['title'];
$v['method_name'] = get_pay_method($v['method']);
$v['pay_condition'] = $this->getConditionText($v['payok']);
if ($v['pay_uid'] != 0) {
$user = query_user(array('space_link'), $v['pay_uid']);
$v['operator'] = $user['space_link'];
} else {
$v['operator'] = '-';
}
$v['pay_time'] = $v['pay_time'] == 0 ? '-' : $v['pay_time'];
}
unset($v);
$listBuilder->title('提现记录');
$listBuilder->keyId()->keyText('type_title', '提现字段')->keyText('amount', '提现金额')->keyText('frozen_amount', '冻结积分')->keyUid()->keyText('method_name', '提现方式')->keyCreateTime()->keyText('pay_condition', '支付状态')->keyText('operator', '操作者')->keyTime('pay_time', '提现操作时间')->keyText('account_info', '收款账户信息');
$listBuilder->data($data)->pagination($totalCount, $r);
$listBuilder->ajaxButton(U('recharge/doWithdraw'), null, '提现');
$listBuilder->ajaxButton(U('recharge/cancelWithdraw'), null, '关闭提现');
$listBuilder->display();
}