本文整理汇总了PHP中load_func函数的典型用法代码示例。如果您正苦于以下问题:PHP load_func函数的具体用法?PHP load_func怎么用?PHP load_func使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_func函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: checkIsLogin
/**
* 检测登录
*
* @return bool|\Illuminate\Http\RedirectResponse
* @author yangyifan <[email protected]>
*/
private function checkIsLogin()
{
load_func('common');
$uid = is_admn_login();
return $uid <= 0 && header('location:' . action('Admin\\LoginController@getIndex'));
die;
}
开发者ID:91xcode,项目名称:laravel-admin,代码行数:13,代码来源:BaseController.php
示例2: send_to_swoole_server
function send_to_swoole_server($step, $targer, $params, $callback)
{
//加载函数库
load_func('instanceof');
$swoole_client = get_swoole_client();
return $swoole_client->send(json_encode(['step' => $step, 'targer' => $targer, 'params' => $params, 'callback' => $callback]) . config('swoole.package_eof'));
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:7,代码来源:swoole.func.php
示例3: __construct
/**
* 构造方法
*
* @author yangyifan <[email protected]>
*/
public function __construct()
{
//加载函数库
load_func('common');
//获得导航数据
$this->getSearch();
}
开发者ID:angelfreedomv,项目名称:laravel-admin,代码行数:12,代码来源:BaseController.php
示例4: getAllForSchemaOption
/**
* 获得全部文章分类--无限极分类(编辑菜单时选项)
*
* @descript 递归组合无限极分类,为了编辑页面和增加页面select 展示
* @param $name 表单name名称
* @param $id 当前id
* @return array
* @author yangyifan <[email protected]>
*/
public static function getAllForSchemaOption($name, $id = 0, $first = true)
{
//加载函数库
load_func('common');
$data = $id > 0 ? merge_tree_node(obj_to_array(self::where('id', '<>', $id)->where('user_info_id', '=', is_user_login())->where('deleted_at', '=', '0000-00-00 00:00:00')->get())) : merge_tree_node(obj_to_array(self::where('user_info_id', '=', is_user_login())->get()));
$first == true && array_unshift($data, ['id' => '0', $name => '顶级分类']);
return $data;
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:17,代码来源:SiteCatModel.php
示例5: getSaveUserInfo
/**
* 保用用户信息到redis
*
* @param Requests $requests
* @author yangyifan <[email protected]>
*/
public function getSaveUserInfo(Request $requests)
{
$user_info = unserialize(urldecode($requests->get('user_info')));
//保存用户信息到redis hash表
load_func('instanceof,swoole');
//返回状态
get_redis()->hSet(config('config.user_list_hash_table'), $user_info->id, serialize($user_info)) != false ? $this->response(200, 'success') : $this->response(400, trans('response.save_user_info_to_redis_error'));
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:14,代码来源:UserController.php
示例6: getUserForumCat
/**
* 获得当前栏目全部角色权限
*
* @param null $role_id
* @return mixed
* @author yangyifan <[email protected]>
*/
public static function getUserForumCat($forum_cat_id)
{
if (!empty($forum_cat_id)) {
//加载函数库
load_func('common');
return obj_to_array(DB::table('forum_access AS fa')->select('r.id', 'r.role_name')->join('role AS r', 'fa.role_id', '=', 'r.id')->where('fa.forum_cat_id', '=', $forum_cat_id)->get());
}
return false;
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:16,代码来源:ForumCatModel.php
示例7: getIndex
/**
* 登录操作
*
* @return Response
* @author yangyifan <[email protected]>
*/
public function getIndex()
{
load_func('common');
//判断是否已经登录
if (is_admin_login() > 0) {
return redirect(url('admin/home'), 302);
}
return view('admin.login.login');
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:15,代码来源:LoginController.php
示例8: __construct
/**
* 构造方法
*
* @author yangyifan <[email protected]>
*/
public function __construct()
{
//加载函数库
load_func('common');
//检测是否登陆
$this->checkIsLogin();
//获得导航数据
$this->getSearch();
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:14,代码来源:BaseController.php
示例9: __construct
/**
* 构造方法
*
* @author yangyifan <[email protected]>
*/
public function __construct()
{
parent::__construct();
$this->disk = Storage::disk('qiniu');
//获得一块硬盘
//加载函数库
load_func('common');
//设置会员头像保存路径
$this->user_avatar_prefix = '/avatar/' . is_user_login() . '/';
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:15,代码来源:AvatarController.php
示例10: saveUserSession
/**
* 写入用户信息到SESSION
*
* @param $user_info
* @author yangyifan <[email protected]>
*/
private static function saveUserSession($user_info)
{
//引入函数库
load_func('common');
$user_info = obj_to_array($user_info);
$user_info['admin_user_data'] = ['id' => $user_info['id'], 'email' => $user_info['email'], 'updated_at' => $user_info['updated_at']];
$user_info['sign'] = hash_user_sign($user_info['admin_user_data']);
Session::put('admin_info', $user_info);
Session::save();
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:16,代码来源:AdminInfoModel.php
示例11: saveUserAvatar
/**
* 保存用户头像
*
* @param $image
* @param null $user_id
* @return bool
*/
public static function saveUserAvatar($image, $user_id = null)
{
if (!empty($image)) {
//加载函数库
load_func('common');
$user_id = $user_id != null ? $user_id : is_user_login();
return self::where('id', '=', $user_id)->update(['face' => $image]);
}
return false;
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:17,代码来源:AvatarModel.php
示例12: addFriend
/**
* 添加好友
*
* @param $user_id
* @param $contents
* @author yangyifan <[email protected]>
*/
public static function addFriend($user_id, $contents = '')
{
//加载函数库
load_func('common');
$affected_id = DB::table('add_user')->insertGetId(['user_info_id' => is_user_login(), 'invitee' => $user_id, 'created_at' => date('Y-m-d H:i:s')]);
//发送私信
if ($affected_id > 0) {
LetterModel::sendLetter($user_id, trans('log.add_user_log', ['user_name' => Session::get('user_info.email'), 'contents' => $contents]));
}
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:17,代码来源:FriendsModel.php
示例13: postSocketFd
/**
* 获得用户web socket fd
*
* @param Request $request
*/
public function postSocketFd(Request $request)
{
$user_id = $request->get('id');
//加载函数库
load_func('instanceof,image');
//获得发送对象$fb
$user_info = unserialize(get_redis()->hGet(config('config.user_list_hash_table'), $user_id));
if (!empty($user_info)) {
$this->response(200, 'success', ['fd' => $user_info->web_socket_fd, 'name' => $user_info->user_name, 'face' => get_user_info_face($user_info->face)]);
} else {
$this->response(400, trans('response.save_user_socket_to_redis_error'));
}
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:18,代码来源:ChatController.php
示例14: checkIsLogin
/**
* 检测登录
*
* @return bool|\Illuminate\Http\RedirectResponse
* @author yangyifan <[email protected]>
*/
private function checkIsLogin()
{
//记载函数库
load_func('common');
$uid = is_user_login();
if ($uid <= 0 && Request::method() == 'POST') {
$this->response(400, trans('response.no_login'));
} else {
if ($uid <= 0) {
header('location:' . action('Home\\UserController@getLogin'));
die;
}
}
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:20,代码来源:BaseController.php
示例15: getUserChoseCagetory
/**
* 获得全部分类
*
* @return mixed
* @author yangyifan <[email protected]>
*/
public static function getUserChoseCagetory()
{
//加载函数库
load_func('common');
//获得当前用户全部新闻分类
$user_new_category_id = self::getUserCagetory();
$all_category = self::all();
if (!empty($all_category)) {
foreach ($all_category as &$category) {
$category->checked = in_array($category->id, $user_new_category_id) ? true : false;
}
}
$all_category = obj_to_array($all_category);
return array_to_obj(merge_tree_child_node($all_category));
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:21,代码来源:NewsModel.php
示例16: updateUserAccess
/**
* 更新用户当前权限
*
* @param array $access_array
* @param null $role_id
* @return bool
* @author yangyifan <[email protected]>
*/
public static function updateUserAccess(array $access_array = null, $role_id = null)
{
//删除会员当前全部新闻分类
self::deleteUserAccess($role_id);
if (!empty($access_array)) {
//加载函数库
load_func('common');
$role_id = self::getRoleId($role_id);
foreach ($access_array as $access) {
if ($access <= 0) {
continue;
}
DB::table('role_relation_menu')->insertGetId(['role_id' => $role_id, 'menu_id' => $access]);
}
}
return true;
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:25,代码来源:AccessModel.php
示例17: onlineUser
/**
* 获得在线好友
*
* @param $params array 用户登录名和密码参数
* @return int
* @author yangyifan <[email protected]>
*/
public static function onlineUser()
{
load_func('instanceof,image,common');
$online_user = get_redis()->hGetAll(config('config.user_list_hash_table'));
$item = [];
//获得全部我的好友
$my_friends = FriendsModel::getMyFriends();
foreach ($online_user as $user) {
$user = unserialize($user);
//如果是自己,则跳过 || 如果不是自己好友,则跳过
if ($user->id == is_user_login() || !in_array($user->id, $my_friends)) {
continue;
}
$item[] = ['id' => $user->id, 'name' => $user->user_name, 'face' => get_user_info_face($user->face), 'url' => action("User\\UserController@getIndex", ['id' => $user->id])];
}
$data = [['name' => '在线好友', 'nums' => count($item), 'id' => 1, 'item' => $item]];
return $data;
}
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:25,代码来源:UserModel.php
示例18: checkIsLogin
/**
* 检测登录
*
* @return bool|\Illuminate\Http\RedirectResponse
* @author yangyifan <[email protected]>
*/
private function checkIsLogin()
{
load_func('common');
$uid = is_login();
return $uid <= 0 && header('location:/admin/login');
}
开发者ID:nlls1990,项目名称:laravel-admin,代码行数:12,代码来源:BaseController.php
示例19: getAllForMenuSide
/**
* 获得全部菜单--递归(左侧菜单显示)
*
* @return array
* @auther yangyifan <[email protected]>
*/
public static function getAllForMenuSide()
{
//加载函数库
load_func('common');
return merge_tree_child_node(obj_to_array(self::all()));
}
开发者ID:jiangtong1125,项目名称:laravel-admin,代码行数:12,代码来源:MenuModel.php
示例20: postSiteCategory
/**
* 添加网址分类
*
* @param Request $request
* @author yangyifan <[email protected]>
*/
public function postSiteCategory(SearchCatRequest $request)
{
$data = $request->all();
//加载函数库
load_func('common');
$data['user_info_id'] = is_user_login();
$affected_number = SiteCatModel::create($data);
return $affected_number->id > 0 ? $this->response(200, trans('response.add_success'), [], false) : $this->response(400, trans('response.add_error'), [], false);
}
开发者ID:91xcode,项目名称:laravel-admin,代码行数:15,代码来源:IndexController.php
注:本文中的load_func函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论