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


PHP front::get_hash方法代码示例

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


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

示例1: getlistAction

 function getlistAction()
 {
     $order_dir = front::$_req["dir"];
     if (!in_array($order_dir, array("ASC", "DESC"))) {
         $order_dir = "ASC";
     }
     $order_col = front::$_req["sort"];
     if (!in_array($order_col, array("id", "title", "date_create"))) {
         $order_col = "id";
     }
     $limit = front::$_req["limit"];
     if (!$limit) {
         $limit = 20;
     }
     $offset = front::$_req["start"];
     if (!$offset) {
         $offset = 0;
     }
     $totalCount = front::og("db")->select("SELECT COUNT(*) FROM corporative_blog WHERE id_blog = 0")->fetchOne();
     $blogs = front::og("db")->select("SELECT c.*, u.uname, u.usurname, u.login FROM corporative_blog c JOIN users u on u.uid = c.id_user  WHERE id_blog = 0 ORDER BY ?v ?v LIMIT ? OFFSET ?", $order_col, $order_dir, $limit, $offset)->fetchAll();
     $bids = front::get_hash($blogs, "id", "id");
     $uids = front::get_hash($blogs, "id_user", "id_user");
     $comm = front::get_hash(front::og("db")->select("SELECT COUNT(id_blog) as count, id_blog FROM corporative_blog WHERE id_blog IN(?a) GROUP BY id_blog", $bids)->fetchAll(), "id_blog", "count");
     $user = front::og("db")->select("SELECT uname, usurname, login, uid FROM users WHERE uid IN(?a)", $uids)->fetchAll();
     //, "uid", "usname");
     foreach ($user as $k => $v) {
         $usr[$v['uid']] = $v;
     }
     $blogs = front::toUtf($blogs);
     echo json_encode(array("data" => $blogs, "totalCount" => $totalCount));
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:page_admin_cblog.class.php

示例2: getlistAction

 public function getlistAction()
 {
     $order_dir = front::$_req['dir'];
     if (!in_array($order_dir, array('ASC', 'DESC'))) {
         $order_dir = 'ASC';
     }
     $order_col = front::$_req['sort'];
     if (!in_array($order_col, array('id', 'title', 'date_create'))) {
         $order_col = 'id';
     }
     $limit = front::$_req['limit'];
     if (!$limit) {
         $limit = 20;
     }
     $offset = front::$_req['start'];
     if (!$offset) {
         $offset = 0;
     }
     $totalCount = front::og('db')->select('SELECT COUNT(*) FROM corporative_blog WHERE id_blog = 0')->fetchOne();
     $blogs = front::og('db')->select('SELECT c.*, u.uname, u.usurname, u.login FROM corporative_blog c JOIN users u on u.uid = c.id_user  WHERE id_blog = 0 ORDER BY ?v ?v LIMIT ? OFFSET ?', $order_col, $order_dir, $limit, $offset)->fetchAll();
     $bids = front::get_hash($blogs, 'id', 'id');
     $uids = front::get_hash($blogs, 'id_user', 'id_user');
     $comm = front::get_hash(front::og('db')->select('SELECT COUNT(id_blog) as count, id_blog FROM corporative_blog WHERE id_blog IN(?a) GROUP BY id_blog', $bids)->fetchAll(), 'id_blog', 'count');
     $user = front::og('db')->select('SELECT uname, usurname, login, uid FROM users WHERE uid IN(?a)', $uids)->fetchAll();
     //, "uid", "usname");
     foreach ($user as $k => $v) {
         $usr[$v['uid']] = $v;
     }
     $blogs = front::toUtf($blogs);
     echo json_encode(array('data' => $blogs, 'totalCount' => $totalCount));
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:page_admin_cblog.class.php

示例3: getCorporateBlog

 /**
  * Выборка блогов из таблицы
  *
  * @param int $page Страница
  * @param int $count Количество на странице
  */
 function getCorporateBlog($page = 1, $count = 10, $tags = false)
 {
     if (!$tags) {
         $total = front::og("db")->select("SELECT COUNT(*) FROM corporative_blog WHERE id_blog = 0  AND (id_deleted IS NULL OR id_deleted = 0)")->fetchOne();
         front::og("tpl")->page_corp = $page;
         front::og("tpl")->pages_corp = ceil($total / $count);
         front::og("tpl")->total_corp = $total;
         $nPages = ceil($total / $count);
         if (($total == 0 || $total - 1 < ($page - 1) * $count) && $this->uri[0] == 'page' || $nPages == 1 && $this->uri[0] == 'page') {
             include ABS_PATH . '/404.php';
             exit;
         }
     }
     $page--;
     $sql_page = $page * $count;
     $blogs = front::og("db")->select("SELECT * FROM corporative_blog WHERE " . ($tags ? ' id IN(?a) AND ' : ' 0 = ? AND ') . " id_blog = 0 AND (id_deleted IS NULL OR id_deleted = 0) ORDER BY id DESC LIMIT ? OFFSET ?", $tags ? $tags : 0, $count, $sql_page)->fetchAll();
     if (!$blogs && $tags) {
         Header("Location: /404.php");
     }
     $bids = front::get_hash($blogs, "id", "id");
     $uids = front::get_hash($blogs, "id_user", "id_user");
     //return false;
     if ($bids) {
         //$comm  = front::get_hash(front::og("db")->select("SELECT COUNT(id_blog) as count, id_blog FROM corporative_blog WHERE id_blog IN(?a) GROUP BY id_blog", $bids)->fetchAll(), "id_blog", "count");
         $user = front::og("db")->select("SELECT uname, usurname, login, uid, role, is_pro, is_pro_test, boss_rate FROM users WHERE uid IN(?a)", $uids)->fetchAll();
         //, "uid", "usname");
         foreach ($blogs as $k => $v) {
             $cid[$v['id']] = $v['id'];
         }
         if ($cid) {
             $attach = front::og("db")->select("SELECT * FROM corporative_blog_attach WHERE msg_id IN(?a)", $cid)->fetchAll();
         }
         if ($attach) {
             foreach ($attach as $key => $val) {
                 $res_attach[$val['msg_id']][] = $val;
             }
             front::og("tpl")->attach = $res_attach;
         }
         foreach ($user as $k => $v) {
             $usr[$v['uid']] = $v;
         }
         list($lastDate, $upDate) = self::getViewPostsDate($bids);
     }
     //var_dump($lastDate);
     //var_dump($upDate);
     front::og("tpl")->usbank = $usr;
     //front::og("tpl")->comment = $comm;
     front::og("tpl")->blogs = $blogs;
     front::og("tpl")->lastDate = $lastDate;
     front::og("tpl")->upDate = $upDate;
     front::og("tpl")->tags = self::getCorpTags();
     //self::GetTags($count, 10);
     //front::og("tpl")->attach  = $attach;
     //self::getCorpTags();
     return array($blogs, $usr);
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:62,代码来源:page_about.class.php

示例4: getCorporateBlog

 /**
  * Выборка блогов из таблицы
  *
  * @param int $page страница
  * @param int $count количество на странице
  */
 function getCorporateBlog($page = 1, $count = 10)
 {
     $total = front::og("db")->select("SELECT COUNT(*) FROM corporative_blog WHERE id_blog = 0  AND (id_deleted IS NULL OR id_deleted = 0)")->fetchOne();
     front::og("tpl")->page_corp = $page;
     front::og("tpl")->pages_corp = ceil($total / $count);
     front::og("tpl")->total_corp = $total;
     $page--;
     $sql_page = $page * $count;
     $blogs = front::og("db")->select("SELECT * FROM corporative_blog WHERE id_blog = 0 AND (id_deleted IS NULL OR id_deleted = 0) ORDER BY id DESC LIMIT ? OFFSET ?", $count, $sql_page)->fetchAll();
     $bids = front::get_hash($blogs, "id", "id");
     $uids = front::get_hash($blogs, "id_user", "id_user");
     $comm = front::get_hash(front::og("db")->select("SELECT COUNT(id_blog) as count, id_blog FROM corporative_blog WHERE id_blog IN(?a) GROUP BY id_blog", $bids)->fetchAll(), "id_blog", "count");
     $user = front::og("db")->select("SELECT uname, usurname, login, uid, role, is_pro, is_pro_test, boss_rate FROM users WHERE uid IN(?a)", $uids)->fetchAll();
     //, "uid", "usname");
     foreach ($blogs as $k => $v) {
         $cid[$v['id']] = $v['id'];
     }
     if ($cid) {
         $attach = front::og("db")->select("SELECT * FROM corporative_blog_attach WHERE msg_id IN(?a)", $cid)->fetchAll();
     }
     if ($attach) {
         foreach ($attach as $key => $val) {
             $res_attach[$val['msg_id']][] = $val;
         }
         front::og("tpl")->attach = $res_attach;
     }
     foreach ($user as $k => $v) {
         $usr[$v['uid']] = $v;
     }
     front::og("tpl")->usbank = $usr;
     front::og("tpl")->comment = $comm;
     front::og("tpl")->blogs = $blogs;
     //front::og("tpl")->attach  = $attach;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:40,代码来源:page_mycorp.class.php


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