本文整理汇总了PHP中me函数的典型用法代码示例。如果您正苦于以下问题:PHP me函数的具体用法?PHP me怎么用?PHP me使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了me函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAdditionalParams
/**
* Returns additional params (query object, column etc.) for report
*
* @param array args
* @return array
**/
public function getAdditionalParams($args)
{
if ($this->restrictByCity()) {
$args['filter']['city_id = ?'] = me()->city_id;
}
return $args;
}
示例2: delete
public function delete(RM_User_Leave $obLeave)
{
if (!$this->canDelete($obLeave)) {
error(L('leave.cannot_delete_leave_expired'));
return FALSE;
}
// update leave if current
if ($obLeave->isStatus('current') && !me()->isSomeAdmin() && M('Date')->time($obLeave->date_from) < M('Date')->time(M('Tools')->date()->dbDate())) {
/* $prev_day = iterFirst(M('Db')->query('SELECT DATE(DATE_SUB(NOW(), INTERVAL 1 DAY)) AS prev_day'));
$prev_day = $prev_day['prev_day'];
$date_to = (strtotime($prev_day) >= strtotime($obLeave->date_from)) ? $prev_day : M('Tools')->date()->dbDate();
if ( MC('Leave')->update($obLeave, array('date_to' => $date_to)) )
message(L('leave.leave_updated_not_deleted'));
return FALSE;*/
if ($this->dropDateToCurrent($obLeave)) {
message(L('leave.leave_updated_not_deleted'));
}
return FALSE;
}
// delete leave
if ($obLeave->delete()) {
M('Points')->leaveRemoved($obLeave);
return TRUE;
}
return FALSE;
}
示例3: save
public function save()
{
if (!$this->type_id) {
$this->type_id = 11;
}
if (!$this->name) {
$this->name = L('shop.empty_name');
}
if (!$this->city_id && me()->id()) {
$this->city_id = me()->city_id;
}
if (!($this->longitude + 0)) {
$this->longitude = NULL;
}
if (!($this->latitude + 0)) {
$this->latitude = NULL;
}
/*foreach ($this->links() as $link)
{
$link->shop_type=$this->type_id;
$link->name=$this->name;
$link->save();
}*/
$this->mdate = M('Date')->dbDateTime();
if (!$this->cdate) {
$this->cdate = M('Date')->dbDateTime();
}
return parent::save();
}
示例4: createGroup
public function createGroup($name)
{
$object = $this->_storage->loadOrCreateObject('name', $name, array('name' => $name, 'owner_id' => -1));
M('Permission')->changePermission($object, array(array('grant', me()->getPersonalGroup()->id(), 'READ')));
$object->save();
return $object;
}
示例5: __construct
public function __construct()
{
if (!MC('User')->checkAccessToEditGpc(me())) {
goU('main');
}
$this->_action_list = array('rename' => L('wizard.gpc_rename_attribute_action'), 'edit' => L('wizard.gpc_edit_attribute_action'), 'add' => L('wizard.gpc_add_attribute_action'), 'delete' => L('wizard.gpc_delete_attribute_action'));
}
示例6: getAdditionalParams
/**
* Returns additional params (query object, column etc.) for report
*
* @param array args
* @return array
**/
public function getAdditionalParams($args)
{
$args['query'] = M('Points')->getPointsReportQuery(@$_GET['user_id'] ? $_GET['user_id'] : me()->id());
if (!me()->isUserInGroup(array('admin', 'region-admin', 'super-admin'), FALSE)) {
$args['no_visible'][] = 'cdate';
}
return $args;
}
示例7: restrict
function restrict()
{
if (!me()) {
header("HTTP/1.1 403 Forbidden");
header("Location: index.php");
exit;
}
}
示例8: _initHolder
/**
* Init holder if need.
*
* @return void
*/
protected function _initHolder()
{
if (isNull($this->_data['obHolder'])) {
if (isNull($this->_data['obHolder'] = M('Holder')->getRegionHolderByUser(me()))) {
throw new RM_Base_Exception_Internal(__METHOD__ . ': can\'t find open region holder');
}
}
}
示例9: save
/**
* Enter description here...
*
*/
public function save()
{
if (!$this->_obReceipt->cdate_real) {
$this->_obReceipt->cdate_real = M('Date')->dbDateTime();
}
$this->_obReceipt->checker_id = me()->id();
parent::save();
}
示例10: getAdditionalParams
public function getAdditionalParams($args)
{
if (!me()->isUserInGroup('federal-news')) {
$args['restriction']['city_id = ?'] = me()->city_id;
$args['no_visible'][] = 'city_id';
}
return $args;
}
示例11: getAdditionalParams
/**
* Returns additional params (query object, column etc.) for report
*
* @param array args
* @return array
**/
public function getAdditionalParams($args)
{
$args['aliases'] = array('type_id' => 's.type_id', 'city_id' => 's.city_id', 'shop_count' => 'COUNT(*)');
if ($this->restrictByCity()) {
$args['filter']['city_id = ?'] = me()->city_id;
}
$args['query'] = M('Shop')->getAggregateShopTypeQuery();
return $args;
}
示例12: doAdd
public function doAdd($user_id)
{
if (!me()->hasPermissionTo('add', 'Recommendation')) {
err('You don\'t have permission to leave a recommendation for that user.');
return Redirect::to(URL::previous());
}
$recommendation = new Recommendation();
return $recommendation->validateAndUpdateFromArray(Input::all());
}
示例13: getAdditionalParams
/**
* Enter description here...
*
* @param hash$args
* @return hash
*/
public function getAdditionalParams($args)
{
$args['query'] = M('Presents')->getOrdersControlReportQuery();
$args['aliases'] = array('city_id' => 'u.city_id', 'user_id' => 'r.user_id', 'present_id' => 'p.name', 'price' => 'r.price', 'quantity' => 'r.quantity', 'state' => 'r.state', 'cdate' => 'r.cdate', 'mdate' => 'r.mdate');
if ($this->restrictByCity()) {
$args['filter']['city_id = ?'] = me()->city_id;
}
return $args;
}
示例14: getAdditionalParams
/**
* Returns additional params (query object, column etc.) for report
*
* @param array args
* @return array
**/
public function getAdditionalParams($args)
{
$args['aliases'] = array('event_date' => 'ud.event_date', 'result_id' => 'ud.result_id', 'user_id' => 'ud.user_id', 'city_id' => 'u.city_id');
if ($this->restrictByCity()) {
$args['filter']['city_id = ?'] = me()->city_id;
}
$args['query'] = M('User')->report()->getActivityReportQuery()->order('event_date desc');
return $args;
}
示例15: getAdditionalParams
/**
* Returns additional params (query object, column etc.) for report
*
* @param array args
* @return array
**/
public function getAdditionalParams($args)
{
$args['aliases'] = qw2('uid>r.user_id bdate>r.bdate number>r.number total_virt>r.total_virt total_real>r.total_real diff>diff vpurchase_count>vpurchase_count city_id>u.city_id');
$args['having'] = array('diff' => 'ROUND( IFNULL(r.total_virt*(1-IFNULL(r.discount_virt,0)),0) - IFNULL(r.total_real*(1-IFNULL(r.discount_real,0)),0), 2)', 'vpurchase_count' => 'SUM( IF(p.is_deleted != 1 AND p.status_id = 3, 1, 0) )');
$args['query'] = M('Purchase')->report()->getReportQueryReceiptListControl();
if ($this->restrictByCity()) {
$args['filter']['city_id = ?'] = me()->city_id;
}
return $args;
}