当前位置: 首页>>代码示例>>PHP>>正文


PHP Configure::getApiKeys方法代码示例

本文整理汇总了PHP中Configure::getApiKeys方法的典型用法代码示例。如果您正苦于以下问题:PHP Configure::getApiKeys方法的具体用法?PHP Configure::getApiKeys怎么用?PHP Configure::getApiKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Configure的用法示例。


在下文中一共展示了Configure::getApiKeys方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

    public function index()
    {
        if (!Input::has('page')) {
            $pageNum = 1;
        } else {
            $pageNum = (int) Input::get('page');
        }
        $admin_id = Auth::admin()->get()->id;
        $arrCategories = [];
        $name = '';
        $take = $this->take;
        $skip = floor(($pageNum - 1) * $take);
        $images = VIImage::select('id', 'name', 'short_name', 'description', 'keywords', 'artist', 'model', 'gender', 'age_from', 'age_to', 'number_people', DB::raw('(SELECT COUNT(*)
																							FROM notifications
																				         	WHERE notifications.item_id = images.id
																				         		AND notifications.item_type = "Image"
																								AND notifications.admin_id = ' . $admin_id . '
																								AND notifications.read = 0 ) as new'))->withType('main')->with('categories')->with('collections');
        if (Input::has('categories')) {
            $arrCategories = (array) Input::get('categories');
            $images->whereHas('categories', function ($query) use($arrCategories) {
                $query->whereIn('id', $arrCategories);
            });
        }
        if (Input::has('name')) {
            $name = Input::get('name');
            $nameStr = '*' . $name . '*';
            $images->search($nameStr);
        }
        $images = $images->take($take)->skip($skip)->orderBy('id', 'desc')->get();
        $arrImages = [];
        if (!$images->isempty()) {
            $arrImages = $arrRemoveNew = [];
            foreach ($images as $image) {
                $image->path = URL . '/pic/large-thumb/' . $image->short_name . '-' . $image->id . '.jpg';
                $image->dimension = $image->width . 'x' . $image['height'];
                if ($image->new) {
                    $arrRemoveNew[] = $image->id;
                }
                $arrImages[$image->id] = $image;
                foreach (['arrCategories' => ['name' => 'categories', 'id' => 'id'], 'arrCollections' => ['name' => 'collections', 'id' => 'id']] as $key => $value) {
                    $arr = [];
                    foreach ($image->{$value}['name'] as $v) {
                        $arr[] = $v[$value['id']];
                    }
                    $arrImages[$image->id][$key] = $arr;
                }
                unset($arr);
            }
            if (!empty($arrRemoveNew)) {
                Notification::whereIn('item_id', $arrRemoveNew)->where('item_type', 'Image')->where('admin_id', $admin_id)->update(['read' => 1]);
            }
        }
        if (Request::ajax()) {
            return $arrImages;
        }
        $this->layout->title = 'Images';
        $this->layout->content = View::make('admin.images-all')->with(['images' => $arrImages, 'pageNum' => $pageNum, 'categories' => Category::getSource(), 'name' => $name, 'arrCategories' => $arrCategories, 'collections' => Collection::getSource(), 'apiKey' => Configure::getApiKeys()]);
    }
开发者ID:nguyendaivu,项目名称:imagestock,代码行数:59,代码来源:ImagesController.php


注:本文中的Configure::getApiKeys方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。