本文整理匯總了PHP中Install::select方法的典型用法代碼示例。如果您正苦於以下問題:PHP Install::select方法的具體用法?PHP Install::select怎麽用?PHP Install::select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Install
的用法示例。
在下文中一共展示了Install::select方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: count
<?php
require_once 'admin/classes/ConnectDB.php';
require_once 'admin/classes/DBase.php';
require_once 'admin/classes/login.php';
include "php/config.php";
$site_login = Install::select()[0]["name"];
$page = DB::selectParam('catalog', 'name_en', $_GET['page'], false, false);
//узнаем id по значению $_GET['page']
if ($page[0]['parent'] == 0) {
//если это родительский каталог, то
$arr_number_subcat = DB::selectParam('catalog', 'parent', (int) $page[0]['id'], false, false);
// то выводим все подкатегории, соответсвующие id родительского каталога
$sections = '';
$count = count($arr_number_subcat);
//количество подкатегорий
/**
* Формируем строку с id-шками подкатегорий
*/
$i = 0;
foreach ($arr_number_subcat as $value) {
$i++;
$sections .= $value['id'];
if ($i < $count) {
$sections .= ',';
}
}
/******************************************/
//выводим все товары соответсвующие id-шкам подкатегорий
$sql = "SELECT pr.id, pr.section, pr.name, pr.nomer, pr.included_price, pr.title, pr.description, pr.keywords, pr.img, pr.img_title, pr.img_alt, pr.nn, pr.best, pr.hide, ip.id as ip_id, ip.id_price, ip.id_size, ip.id_module, ip.price, ip.price_old, ip.sale, ip.date\n\t\t\tFROM info_prod as ip\n\t\t\tINNER JOIN (SELECT id_price ,MIN(price) AS min_price FROM info_prod as ip2 group by ip2.id_price) AS outerip ON outerip.id_price = ip.id_price AND ip.price = outerip.min_price\n\t\t\tINNER JOIN price as pr ON pr.id=ip.id_price AND pr.section IN({$sections})\n\t\t\torder by best DESC, hide ASC, nn ASC limit 0,5";
$result = DB::selectSql($sql);
示例2:
<header id="header" class="app-header navbar" role="menu">
<!-- navbar header -->
<div class="navbar-header bg-dark">
<button class="pull-right visible-xs" ui-toggle="off-screen" target=".app-aside" ui-scroll="app">
<i class="glyphicon glyphicon-align-justify"></i>
</button>
<!-- brand -->
<a href="kurs.php" class="navbar-brand text-lt">
<span class="hidden-folded m-l-xs"><?php
echo Install::select();
?>
</span>
</a>
<!-- / brand -->
</div>
</header>
示例3: del_extra
}
function del_extra($srt)
{
$srt = str_replace(',', ' ', $srt);
$srt = str_replace('.', ' ', $srt);
$srt = str_replace('/', ' ', $srt);
$srt = str_replace(' ', '-', $srt);
return $srt;
}
function date_exp($datetime)
{
list($date, $time) = explode(' ', $datetime);
return $date;
}
function time_exp($datetime)
{
list($date, $time) = explode(' ', $datetime);
return $time;
}
function data_russian($date)
{
list($y, $m, $d) = explode('-', $date);
$date_new = $d . "." . $m . "." . $y;
return $date_new;
}
require_once '../classes/ConnectDB.php';
require_once 'classes/DBase.php';
require_once 'classes/Install.php';
$settings = new Install();
$data_settings = $settings->select();