本文整理汇总了PHP中Activity::getRecords方法的典型用法代码示例。如果您正苦于以下问题:PHP Activity::getRecords方法的具体用法?PHP Activity::getRecords怎么用?PHP Activity::getRecords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Activity
的用法示例。
在下文中一共展示了Activity::getRecords方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doWebRedActivity
//.........这里部分代码省略.........
}
if ($foo == 'modify') {
$id = $_GPC['id'];
$id = intval($id);
$a = new Activity();
$activity = $a->getOne($id);
/**Activity:2.根据活动ID查询活动内容及设置等**/
if (empty($activity)) {
$this->error('访问错误');
}
if ($_W['ispost']) {
$input = $_GPC;
$input['rules'] = htmlspecialchars_decode($input['rules']);
$input['start'] = strtotime($input['time']['start'] . ':00');
$input['end'] = strtotime($input['time']['end'] . ':59');
$input['share'] = serialize($input['share']);
$input['limit'] = serialize($input['limit']);
if ($input['type'] == 'game') {
$input['tag'] = serialize($input['game']);
} elseif ($input['type'] == 'shared') {
$input['tag'] = serialize($input['shared']);
} else {
$input['tag'] = serialize($input['tag']);
}
$gifts = array();
foreach ($input['gifts']['id'] as $k => $v) {
$gifts[] = array('gift' => $v, 'quantity' => $input['gifts']['quantity'][$k], 'rate' => $input['gifts']['rate'][$k]);
}
$a = new Activity();
$ret = $a->modify($id, $input, $gifts);
/**Activity:3.根据活动ID编辑活动内容及设置等**/
if (is_error($ret)) {
message($ret['message']);
} else {
message("成功编辑活动", $this->createWebUrl('redactivity'));
}
}
$time = array();
$time['start'] = date('Y-m-d H:i', $activity['start']);
$time['end'] = date('Y-m-d H:i', $activity['end']);
if ($activity['type'] == 'game') {
$game = $activity['tag'];
} elseif ($activity['type'] == 'shared') {
$shared = $activity['tag'];
}
load()->func('tpl');
include $this->template('redactivity_form');
}
if ($foo == 'records') {
$id = $_GPC['id'];
$id = intval($id);
$a = new Activity();
$activity = $a->getOne($id);
/**Activity:2.根据活动ID查询活动内容及设置等**/
if (empty($activity)) {
$this->error('访问错误');
}
$filters = array();
$filters['activity'] = $id;
$filters['nickname'] = $_GPC['nickname'];
$pindex = intval($_GPC['page']);
$pindex = max($pindex, 1);
$psize = 20;
$total = 0;
$ds = $a->getRecords($filters, $pindex, $psize, $total);
/**Activity:4.分页活动列表**/
$pager = pagination($total, $pindex, $psize);
include $this->template('redactivity_records');
}
if ($foo == 'delete') {
$id = $_GPC['id'];
$id = intval($id);
$a = new Activity();
$ret = $a->remove($id);
/**Activity:5.删除活动**/
if (is_error($ret)) {
message($ret['message']);
} else {
message('操作成功', $this->createWebUrl('redactivity'));
}
}
if ($foo == 'list') {
$a = new Activity();
$ds = $a->getAll(array());
/**Activity:6.查询所有活动**/
if (is_array($ds)) {
foreach ($ds as &$row) {
$url = $this->createMobileUrl('redactivity', array('actid' => $row['actid']));
$row['surl'] = $url;
$url = substr($url, 2);
$url = $_W['siteroot'] . 'app/' . $url;
$row['url'] = $url;
$row['count'] = $a->calcCount($row['actid']);
/**Activity:7.查询活动礼品信息:总数量、已发放、还剩余。**/
}
unset($row);
}
include $this->template('redactivity_list');
}
}
示例2: array
$prepare = $this->prepareActivity($activity, array('user' => $user));
if (is_error($prepare)) {
$error = $prepare;
}
$footer_off = true;
$_W['page']['title'] = $activity['title'];
$_share = array();
$_share['title'] = $activity['share']['title'];
$_share['desc'] = $activity['share']['content'];
$_share['imgUrl'] = tomedia($activity['share']['image']);
$_share['link'] = $_W['siteroot'] . 'app/' . substr($this->createMobileUrl('activity', array('actid' => $activity['actid'])), 2);
$got = $a->getRecord($user['uid'], $id);
$filters = array();
$filters['activity'] = $id;
$filters['status'] = 'complete';
$recents = $a->getRecords($filters, 1, 5, $total);
if ($activity['type'] == 'direct') {
//直接发红包
include $this->template('activity-direct');
}
if ($activity['type'] == 'game') {
//红包游戏
require_once MB_ROOT . '/source/Game.class.php';
$g = new Game();
$game = $activity['tag'];
$game['quantity'] = $g->calcQuantity($activity['actid'], $user['uid']);
$game['already'] = !empty($got);
include $this->template('activity-game');
}
if ($activity['type'] == 'shared') {
$_share['link'] = $_W['siteroot'] . 'app/' . substr($this->createMobileUrl('shared', array('actid' => $activity['actid'], 'owner' => $user['uid'])), 2);
示例3: exit
$profile = $f->getProfile($user['uid']);
if (!empty($profile)) {
exit('success');
}
}
if ($foo == 'history') {
require_once MB_ROOT . '/source/Activity.class.php';
$id = $_GPC['actid'];
$id = intval($id);
$a = new Activity();
$activity = $a->getOne($id);
if ($activity['type'] == 'game') {
$filters = array();
$filters['owner'] = $user['uid'];
$filters['activity'] = $activity['actid'];
$records = $a->getRecords($filters);
include $this->template('my-game');
}
if ($activity['type'] == 'shared') {
require_once MB_ROOT . '/source/Shared.class.php';
$s = new Shared($activity);
$filters = array();
$filters['owner'] = $user['uid'];
$ds = $s->getAllHelps($filters);
if (!empty($ds)) {
foreach ($ds as &$r) {
$r['user'] = $f->getOne($r['helper']);
}
}
include $this->template('my-shared');
}
示例4: intval
if ($foo == 'records') {
$id = $_GPC['id'];
$id = intval($id);
$a = new Activity();
$activity = $a->getOne($id);
if (empty($activity)) {
$this->error('访问错误');
}
$filters = array();
$filters['activity'] = $id;
$filters['nickname'] = $_GPC['nickname'];
$pindex = intval($_GPC['page']);
$pindex = max($pindex, 1);
$psize = 15;
$total = 0;
$ds = $a->getRecords($filters, $pindex, $psize, $total);
$pager = pagination($total, $pindex, $psize);
include $this->template('activity-records');
}
if ($foo == 'delete') {
$id = $_GPC['id'];
$id = intval($id);
$a = new Activity();
$ret = $a->remove($id);
if (is_error($ret)) {
message($ret['message']);
} else {
message('操作成功', $this->createWebUrl('activity'));
}
}
if ($foo == 'list') {