本文整理汇总了PHP中Utility::GetColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::GetColumn方法的具体用法?PHP Utility::GetColumn怎么用?PHP Utility::GetColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility::GetColumn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUserGroupId
public function getUserGroupId($user_id, $team_id)
{
$groups = D("UserGroups")->getTeamGroups($team_id);
$group_ids = Utility::GetColumn($groups);
$group = M("UserGroupMapping")->where(array("user_group_id" => array("in", $group_ids), "user_id" => $user_id))->getField("user_group_id");
return $group;
}
示例2: Logon
public static function Logon($user)
{
// if($isRemember) {
// $time = 30 * 86400;
// } else {
// $time = 0;
// }
//获取用户的group id和team id信息
$group_team = M()->table("user_group_mapping ugm, user_group_team_mapping ugtm")->where("ugm.user_group_id = ugtm.user_group_id and ugm.user_id = " . $user['id'])->field("ugm.user_group_id, ugtm.team_id ")->query('select %FIELD% from %TABLE% %WHERE%', true);
$group_team = $group_team[0];
$user['user_group_id'] = $group_team['user_group_id'];
$user['team_id'] = $group_team['team_id'];
$user['team'] = M('Teams')->getById($group_team['team_id']);
//用户有权限管理的组信息放到login_user里面
$group = M("UserGroups")->find($group_team['user_group_id']);
$user['role'] = $group['role'];
if ($group['role'] == 'admin') {
//管理员组
$groups = M("UserGroupTeamMapping")->where("team_id = " . $group_team['team_id'])->field("user_group_id")->select();
$groups = Utility::GetColumn($groups, "user_group_id");
} else {
$groups = array($group_team['user_group_id']);
}
$user['user_group'] = D("UserGroups")->find($group_team['user_group_id']);
$user['manage_group_ids'] = $groups;
Session::set("login_user", $user);
return $user;
}
示例3: _after_select
function _after_select(&$resultSet, $options)
{
if ($resultSet) {
$creator_ids = Utility::GetColumn($resultSet, "create_user_id");
$users = M("Users")->where(array("id" => array("in", $creator_ids)))->select();
$users = Utility::AssColumn($users);
foreach ($resultSet as $index => $result) {
$resultSet[$index]['create_user_name'] = $users[$result['create_user_id']]['username'];
}
}
return $resultSet;
}
示例4: SetOrderState
public static function SetOrderState($team)
{
if ($team->close_time == 0) {
return;
}
$c = array('team_id' => $team['id'], 'state' => 'unpay');
$os = DB::LimitQuery('order', array('condition' => $condition));
$ids = Utility::GetColumn($os, 'id');
foreach ($ids as $id) {
Table::UpdateCache('order', $id, array('state' => 'expire'));
}
}
示例5: getAttachmentsByModuleId
public function getAttachmentsByModuleId($module_name, $module_id)
{
if (!$module_name || !$module_id) {
//log
return NULL;
}
$table_name = ucfirst($module_name) . 'Attachments';
$module_id_name = strtolower($module_name) . '_id';
$data = D($table_name)->where($module_id_name . '=' . $module_id)->order('id desc')->select();
$user_ids = Utility::GetColumn($data, 'update_user_id');
$users = Utility::Asscolumn(D('Users')->select(implode(',', $user_ids)));
foreach ($data as $k => $n) {
$data[$k]['update_user'] = $users[$n['update_user_id']];
}
return $data;
}
示例6: send_sms_client
function send_sms_client($order_id, $number, $client_name)
{
$sms_api_options = get_sms_api_options();
if (count($sms_api_options) > 0) {
//$from_sms_send = '79224717444';
$from_sms_send = $sms_api_options['sms_api_phone'];
// Проверим и добавим + к номеру
//if (substr($number, 0, 1) !== '+') $number_to = '+'.$number;
//else $number_to = $number;
$options_client = DB::GetQueryResult("SELECT name, var FROM `settings` WHERE `name` = 'sms_client' LIMIT 1", true);
$sms_sended = DB::GetQueryResult("SELECT * FROM `sms_sended` WHERE order_id = " . $order_id . " AND `number` LIKE '{$number}' LIMIT 1", true);
if (!$sms_sended) {
$order = DB::GetQueryResult("SELECT * FROM `order` WHERE id = " . $order_id . " LIMIT 1", true);
//Города
$city_id = Utility::GetColumn($order, 'city_id');
$city = Table::Fetch('city', $city_id);
//Тип работ
$work_id = Utility::GetColumn($order, 'work_type');
$works = Table::Fetch('work_type', $work_id);
if ($order) {
$send = new Sms($sms_api_options['sms_api_username'], $sms_api_options['sms_api_password']);
//СМС - КЛИЕНТУ
$sms_body_client = str_replace("%date%", $order['time_date'], $options_client['var']);
$sms_body_client = str_replace("%time%", $order['time_time'], $sms_body_client);
$sms_body_client = str_replace("%name%", $client_name, $sms_body_client);
$sms_body_client = str_replace("%work_type%", $works[$order['work_type']]['name'], $sms_body_client);
$text_client_send = iconv('utf-8', 'utf-8', $sms_body_client);
$sms_sended_client = DB::GetQueryResult("SELECT * FROM `sms_sended` WHERE `number` LIKE '{$number}' ORDER BY `id` DESC LIMIT 1", true);
$time_now = time();
$time_order = strtotime($sms_sended_client['date']);
$razn = $time_now - $time_order;
if ($razn >= 60) {
if ($number_to != '') {
$result = $send->send_sms($text_client_send, $number, $from_sms_send);
$res1 = DB::GetQueryResult("INSERT INTO `sms_sended` (`id`, `date`, `number`, `text`, `order_id`, `type`) VALUES (NULL, CURRENT_TIMESTAMP, '{$number}', '{$sms_body_client}', '{$order_id}', '2');", true);
}
}
}
}
}
}
示例7: user_list
function user_list()
{
$this->admin_allowed();
$group_id = $this->_param("group_id");
if ($group_id) {
$group_ids = $group_id;
$this->assign("group_id", $group_id);
} else {
$groups = D("UserGroups")->getTeamGroups($this->login_user['team_id']);
$group_ids = Utility::GetColumn($groups);
}
$users = D("Users")->getGroupUsers($group_ids);
$count = count($users);
list($pagesize, $page_num, $pagestring) = pagestring($count, 20);
$users = D("Users")->getGroupUsers($group_ids, $page_num, $pagesize);
$this->assign("users", $users);
$this->assign("pagestring", $pagestring);
$all_team_groups = D("UserGroups")->getTeamGroups($this->login_user['team_id']);
$this->assign("groups", $all_team_groups);
$this->display();
}
示例8: _rich
private function _rich($one)
{
if (!$one) {
return NULL;
}
if (has_submit_apply($one['status'])) {
$one['userinfo'] = D("UserInfo")->getByInviteCode($one['invite_code']);
}
$one['same_recommends'] = $this->getsBySameAsId($one['id']);
$one['recommender_name_full'] = $one['recommender_name'];
if ($one['same_recommends']) {
$one['recommender_name_full'] .= ', ' . implode(', ', Utility::GetColumn($one['same_recommends'], 'recommender_name'));
}
// 冗余存储用户年龄,方便排序和查询
if ($one['userinfo']['birthday']) {
$age = date('Y') - intval(substr($one['userinfo']['birthday'], 0, 4));
if (!$one['age'] || $one['age'] !== $age) {
D("UserRecommends")->where('id=' . $one['id'])->setField('age', $age);
}
}
return $one;
}
示例9: index
public function index()
{
$filter = null;
$order = $this->_param("order");
if ($order) {
$order = str_replace("|", ' ', $order);
}
foreach (array_keys($this->data['all_columns']) as $v) {
$value = trim(htmlspecialchars($this->_get($v)));
if (!$value) {
continue;
}
$filter[$v] = array('like', '%' . $value . '%');
}
$count = D('Schools')->getSchoolsCount($filter);
list($pagesize, $page_num, $pagestring) = pagestring($count, 20);
$schools = D('Schools')->getSchools($filter, $page_num, $pagesize, $order);
$this->data['schools'] = $schools;
$this->data['pagestring'] = $pagestring;
$this->data['school_user_count'] = D('Schools')->getSchoolUserCount(Utility::GetColumn($schools, 'id'));
$this->assign($this->data);
D('AdminVisits')->saveVisit('school_list', $page_num);
$this->display();
}
示例10: strtotime
if ($pbday) {
$pbtime = strtotime($pbday);
$condition[] = "pay_time >= '{$pbtime}'";
}
if ($peday) {
$petime = strtotime($peday);
$condition[] = "pay_time <= '{$petime}'";
}
/* end fiter */
$count = Table::Count('order', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$orders = DB::LimitQuery('order', array(
'condition' => $condition,
'order' => 'ORDER BY id DESC',
'size' => $pagesize,
'offset' => $offset,
));
$pay_ids = Utility::GetColumn($orders, 'pay_id');
$pays = Table::Fetch('pay', $pay_ids);
$user_ids = Utility::GetColumn($orders, 'user_id');
$users = Table::Fetch('user', $user_ids);
$team_ids = Utility::GetColumn($orders, 'team_id');
$teams = Table::Fetch('team', $team_ids);
include template('manage_order_index');
示例11: dirname
<?php
require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
need_manager();
need_auth('market');
$like = strval($_GET['like']);
$cs = strval($_GET['cs']);
/* build condition */
$condition = array();
if ($like) {
$condition[] = "email like '%" . mysql_escape_string($like) . "%'";
}
if ($cs) {
$cscity = DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'name' => $cs), 'one' => true));
if ($cscity) {
$condition['city_id'] = $cscity['id'];
} else {
$cs = null;
}
}
/* end */
$count = Table::Count('subscribe', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 50);
$subscribes = DB::LimitQuery('subscribe', array('condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset));
$city_ids = Utility::GetColumn($subscribes, 'city_id');
$cities = Table::Fetch('category', $city_ids);
include template('manage_misc_subscribe');
示例12: if
$relation_id = $_GET['id'];
$relation = Table::Fetch('rbac_manage_role_relation',$relation_id);
$role_id = $relation['role_id'];
DB::Delete('rbac_manage_role_relation',array('id'=>$relation_id));
Session::Set('notice', '添加角色成功');
redirect( WEB_ROOT . "/manage/user/auth.php?action=member&id=".$role_id);
}
// 持有者
else if($action == 'member'){
$role_id = $_GET['id'];
$itemList = DB::LimitQuery('rbac_manage_role_relation',array('condition'=>array('role_id'=>$role_id)));
$user_ids = Utility::GetColumn($itemList, 'user_id');
$users = Table::Fetch('user', $user_ids);
include template('manage_user_auth_member');
}
// 一个角色的资源分配
else if($action == 'resource'){
$role_id = $_GET['id'];
$role = Table::Fetch('rbac_auth_role',$role_id);
if($_POST){
$resource = $_POST['resource'];
// delete old
DB::Delete('rbac_role_resource',array('role_id'=>$role_id));
示例13: array
$team = Table::Fetch('team', $id);
if ($team['delivery'] == 'express') {
$oc = array('state' => 'pay', 'team_id' => $id);
$orders = DB::LimitQuery('order', array('condition' => $oc, 'order' => 'ORDER BY pay_time DESC, id DESC'));
$kn = array('buy_id' => '支付序号', 'username' => '用户名', 'email' => '用户邮箱', 'realname' => '姓名', 'mobile' => '手机号码', 'address' => '地址', 'quantity' => '数量', 'condbuy' => '选项', 'remark' => '备注', 'date' => '支付时间');
foreach ($orders as $k => $o) {
$o['date'] = date('Y-m-d H:i', $o['pay_time']);
$orders[$k] = $o;
}
$name = "team_{$id}_" . date('Ymd');
down_xls($orders, $kn, $name);
} else {
$cc = array('team_id' => $id);
$coupons = DB::LimitQuery('coupon', array('condition' => $cc, 'order' => 'ORDER BY create_time ASC'));
$users = Table::Fetch('user', Utility::GetColumn($coupons, 'user_id'));
$orders = Table::Fetch('order', Utility::GetColumn($coupons, 'order_id'));
$kn = array('buy_id' => '支付序号', 'username' => '用户名', 'email' => '用户邮箱', 'realname' => '姓名', 'mobile' => '手机号码', 'condbuy' => '选项', 'id' => "{$INI['system']['couponname']}编号", 'secret' => "{$INI['system']['couponname']}密码", 'cmobile' => '消费手机', 'date' => '生成时间', 'remark' => '备注');
foreach ($coupons as $k => $o) {
$u = $users[$o['user_id']];
$r = $orders[$o['order_id']];
$o['buy_id'] = $r['buy_id'];
$o['username'] = $u['username'];
$o['realname'] = $u['realname'];
$o['condbuy'] = $r['condbuy'];
$o['mobile'] = $u['mobile'];
$o['email'] = $u['email'];
$o['cmobile'] = $r['mobile'] ? $r['mobile'] : $u['mobile'];
$o['date'] = date('Y-m-d H:i', $o['create_time']);
$o['remark'] = $r['remark'];
$coupons[$k] = $o;
}
示例14: list
case 'N': $condition['consume'] = 'N'; $condition[] = "expire_time >= {$daytime}"; break;
case 'E': $condition['consume'] = 'N'; $condition[] = "expire_time < {$daytime}"; break;
}
}
/* end filter */
$count = Table::Count('coupon', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 10);
$coupons = DB::LimitQuery('coupon', array(
'condition' => $condition,
'order' => 'ORDER BY team_id DESC, consume_time DESC, id ASC',
'size' => $pagesize,
'offset' => $offset,
));
$team_ids = Utility::GetColumn($coupons, 'team_id');
$teams = Table::Fetch('team', $team_ids);
$user_ids = Utility::GetColumn($coupons, 'user_id');
$users = Table::Fetch('user', $user_ids);
$option_state = array(
'Y' => '已消费',
'N' => '未消费',
'E' => '已过期',
);
include template('biz_coupon');
示例15: dirname
<?php
require_once dirname(dirname(__FILE__)) . '/app.php';
need_login();
need_open(option_yes('navforum'));
$publics = option_category('public');
$id = abs(intval($_GET['id']));
$condition = array('parent_id' => 0);
if ($id && ($public = Table::Fetch('category', $id))) {
$condition['public_id'] = $id;
} else {
if ($id) {
redirect(WEB_ROOT . '/forum/public.php');
} else {
$condition[] = 'public_id > 0';
}
}
$count = Table::Count('topic', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$topics = DB::LimitQuery('topic', array('condition' => $condition, 'size' => $pagesize, 'offset' => $offset, 'order' => 'ORDER BY head DESC, last_time DESC'));
$user_ids = Utility::GetColumn($topics, 'user_id');
$luser_ids = Utility::GetColumn($topics, 'last_user_id');
$user_ids = array_merge($user_ids, $luser_ids);
$users = Table::Fetch('user', $user_ids);
$public = Table::Fetch('category', $id);
$pagetitle = $public ? "{$public['name']}讨论区" : '公共讨论区';
include template('forum_public');