本文整理汇总了PHP中Fields::getFieldsByTree方法的典型用法代码示例。如果您正苦于以下问题:PHP Fields::getFieldsByTree方法的具体用法?PHP Fields::getFieldsByTree怎么用?PHP Fields::getFieldsByTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fields
的用法示例。
在下文中一共展示了Fields::getFieldsByTree方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTreeById
public function getTreeById($id, $option = '')
{
$sql = 'SELECT * FROM {{tree}} WHERE id=' . $id;
$item = DB::getRow($sql);
$item['fields'] = Fields::getFieldsByTree($id, $option);
return $item;
}
示例2: __construct
public function __construct()
{
if ($_GET['ref']) {
$sql = 'SELECT iuser FROM {{iusers_options}} WHERE selfcode=\'' . $_GET['ref'] . '\'';
$iuser = DB::getOne($sql);
if ($iuser) {
$_SESSION['referal'] = $iuser;
}
}
$sql = 'SELECT * FROM {{tree}} WHERE parent=410 AND visible=1 ORDER BY num';
$list = DB::getAll($sql);
foreach ($list as $item) {
$fields = Fields::getFieldsByTree($item['id'], 'wide');
$item['pic'] = $fields['files_gal']['image'][0]['path'];
$multi = Fields::getMultiFields($item['id']);
foreach ($multi['color'] as $row) {
$item['list'][$row] = Funcs::$referenceId['color'][$row]['name'];
}
Run::$colors[$item['id']] = $item;
}
//print '<pre>';print_r(Run::$colors);die;
$sql = 'SELECT * FROM {{tree}} WHERE id=1';
$row = DB::getRow($sql);
Run::$socTitle = $row['seo_title'];
Run::$socDescription = $row['seo_description'];
}
示例3: getList
public function getList()
{
$start = microtime(true);
$data = array('list' => array(), 'categories' => array());
$parentIds = array();
$sql = '
SELECT DISTINCT {{catalog}}.*, {{tree}}.* FROM {{catalog}}
INNER JOIN {{tree}} ON {{catalog}}.tree={{tree}}.id
WHERE {{catalog}}.market=1 AND {{catalog}}.price>0 AND {{tree}}.visible=1 AND available=1
ORDER BY num
';
//print DB::prefix($sql);
$catalog = DB::getPagi($sql);
$fields = Fields::getReserveFieldsByModulePath($tab);
$k = 1;
$date_b = explode('.', Funcs::$conf['akcia']['date_begin']);
$date_e = explode('.', Funcs::$conf['akcia']['date_end']);
$date_b = mktime(0, 0, 0, $date_b[1], $date_b[0], $date_b[2]);
$date_e = mktime(23, 59, 59, $date_e[1], $date_e[0], $date_e[2]);
$today = mktime();
$yes = 0;
if ($today >= $date_b && $today <= $date_e) {
$yes = 1;
}
foreach ($catalog as $i => $model) {
$akcia = '0';
//if ($yes==1)
//$akcia=$model['akcia'];
$data['list'][] = array('id' => $model['id'], 'parent' => $model['parent'], 'fields' => Fields::getFieldsByTree($model['tree'], 'wide'), 'name' => Market::clearInfo($model['name']), 'path' => Catalog::getPathToTree($model['tree']), 'available' => $model['available'], 'bid' => $model['bid'], 'akcia' => $akcia, 'cbid' => $model['cbid'], 'typePrefix' => $model['typePrefix'], 'vendor' => Funcs::$referenceId['vendor'][$model['vendor']]['name'], 'yandex_description' => Market::clearInfo($model['yandex_description']), 'price' => $model['price'], 'local_delivery_cost' => $model['price'] < 4000 ? '200' : '0', 'manufacturer_warranty' => $model['manufacturer_warranty']);
$parentIds[] = $model['parent'];
$k++;
//echo $k.' Время выполнения скрипта '.(microtime(true) - $start).'<br />';
}
$parentIds = array_unique($parentIds);
if (count($parentIds) > 0) {
$sql = '
SELECT * FROM {{tree}} WHERE id IN (' . implode(',', $parentIds) . ')
';
$list = DB::getAll($sql);
$parentIds = array();
foreach ($list as $item) {
$data['categories'][] = array('id' => $item['id'], 'parent' => $item['parent'], 'name' => $item['name']);
$parentIds[] = $item['parent'];
}
if (count($parentIds) > 0) {
$sql = '
SELECT * FROM {{tree}} WHERE id IN (' . implode(',', $parentIds) . ')
';
$list = DB::getAll($sql);
foreach ($list as $item) {
$data['categories'][] = array('id' => $item['id'], 'name' => $item['name']);
}
}
}
return $data;
}
示例4: getOne
public function getOne($id)
{
if ($_POST) {
if (Spage::send($id)) {
View::$layout = 'empty';
View::render('site/redirect', array('href' => '/vacancy/', 'text' => 'Заявка принята!\\nМы свяжемся с Вами в ближайшее время'));
}
}
$field = Fields::getFieldsByTree($id, 'wide');
return $field;
}
示例5: getRSS
public static function getRSS()
{
$data = array();
$id = Tree::getIdTreeByModule('news');
$sql = 'SELECT * FROM {{tree}} WHERE parent=' . $id . ' AND visible=1 ORDER BY udate DESC LIMIT 0,10';
$list = DB::getAll($sql);
foreach ($list as $item) {
$field = Fields::getFieldsByTree($item['id']);
$data[] = array('id' => $item['id'], 'name' => trim(strip_tags($item['name'])), 'preview' => strip_tags($field['preview']), 'path' => 'http:://' . $_SERVER['HTTP_HOST'] . '/about/news/' . $item['id'] . '/', 'udate' => date("D, d M Y H:i:s O", strtotime($item['udate'])));
}
return array('list' => $data);
}
示例6: getSearch
public function getSearch($parent)
{
$data = array();
$sql = '
SELECT {{tree}}.* FROM {{tree}} INNER JOIN {{search}} ON {{tree}}.id={{search}}.tree
WHERE parent=' . $parent . ' AND search LIKE \'%' . $_POST['q'] . '%\' AND visible=1
ORDER BY udate DESC
';
$list = DB::getAll($sql);
foreach ($list as $item) {
$data[] = array('name' => $item['name'], 'path' => Tree::getPathToTree($item['id']), 'udate' => date('d.m.Y', strtotime($item['udate'])), 'fields' => Fields::getFieldsByTree($item['id'], 'wide'));
}
return $data;
}
示例7: getResult
public function getResult()
{
$data = array();
$q = trim(strip_tags($_GET['q']));
if ($q) {
$sql = '
SELECT * FROM {{search}}
INNER JOIN {{tree}} ON {{search}}.tree={{tree}}.id
WHERE search LIKE \'%' . $q . '%\' AND visible=1
ORDER BY {{search}}.cdate DESC
';
$list = DB::getAll($sql);
foreach ($list as $item) {
$fields = Fields::getFieldsByTree($item['tree'], 'gal');
$path = Tree::getPathToTree($item['tree']);
$data[] = array('id' => $item['tree'], 'name' => $item['name'], 'path' => $path, 'fields' => $fields, 'info' => Tree::getInfo($item['tree']));
}
}
return $data;
}
示例8: getPersonsComments
public static function getPersonsComments($id)
{
$data = array();
$sql = '
SELECT {{tree}}.* FROM {{tree}}
INNER JOIN ({{data}}
INNER JOIN {{relations}} ON {{relations}}.id1={{data}}.id
) ON {{data}}.tree={{tree}}.id
WHERE {{relations}}.modul1=\'data\' AND {{relations}}.id2=' . $id . ' AND {{relations}}.modul2=\'tree\'
AND {{data}}.path=\'newscom\'
ORDER BY num
';
$list = DB::getAll($sql);
foreach ($list as $item) {
$fields = Fields::getFieldsByTree($item['id']);
$item['preview'] = $fields['preview'];
$item['person'] = Persons::getOne($item['parent']);
$data[] = $item;
}
return $data;
}
示例9: getContacts
public static function getContacts($parent)
{
$data = array();
$sql = '
SELECT * FROM {{tree}}
WHERE visible=1 AND parent=' . $parent . '
ORDER BY num
';
$list = DB::getAll($sql);
foreach ($list as $item) {
$fields = Fields::getFieldsByTree($item['id'], 'gal');
$pics = array();
if (is_array($fields['files_gal1'])) {
foreach ($fields['files_gal1'] as $file) {
$name = explode(' ', $file['name']);
$if[] = $name[0];
$if[] = $name[1];
unset($name[0]);
unset($name[1]);
$job = implode(' ', $name);
$pics[] = array('path' => $file['path'], 'name' => $if, 'job' => $job, 'dop' => $file['dop']);
}
}
$data[] = array('preview' => $fields['preview'], 'pics' => $pics);
}
return $data;
}
示例10: getOne
public function getOne($id)
{
//die($id);
if (!Cache::get('model' . $id)) {
$fields = Fields::getReserveFieldsByModulePath('catalog');
$sql = '
SELECT {{catalog}}.*, {{tree}}.* FROM {{catalog}}
INNER JOIN {{tree}} ON {{catalog}}.tree={{tree}}.id
WHERE {{tree}}.id =' . $id . '
';
$model = DB::getRow($sql);
if ($model) {
foreach ($fields as $key => $item) {
if (in_array($item['path'], OneSSA::$catalogStandart)) {
$temp[$item['path']] = $model[$item['path']];
}
}
$return = $temp;
$return['id'] = $id;
$parentpath = Tree::getPathToTree($model['parent']);
$return['path'] = $parentpath . $id . '/';
$return['tree'] = $id;
$return['name'] = $model['name'];
$return['parent'] = $model['parent'];
$return['rating'] = $model['rating'];
$return['report'] = Catalog::getCountReport($id);
$return['sale'] = $item['price'] - $item['supprice'];
$fields = Fields::getFieldsByTree($id, 'wide');
$return['pics'] = $fields['files_gal']['image'];
/*$date_b=explode('.', Funcs::$conf['akcia']['date_begin']);
$date_e=explode('.', Funcs::$conf['akcia']['date_end']);
$date_b=mktime(0,0,0,$date_b[1], $date_b[0],$date_b[2]);
$date_e=mktime(23,59,59,$date_e[1], $date_e[0],$date_e[2]);
$today=mktime();
$yes=0;
if (($today>=$date_b)&&($today<=$date_e))
$yes=1;
$akcia='0';
if ($yes==1)
$akcia=$model['akcia'];*/
$return['akcia'] = $akcia;
$return['files'] = $fields['files_gal']['application'];
$multi = Fields::getMultiFields($id);
if (count($multi['tv']) > 0) {
$return['descr1'] = 'Телевидение';
$return['descr2'] = Funcs::$referenceId['tv'][$multi['tv'][0]]['name'];
}
unset($fields['files_gal']);
unset($fields['gal']);
$return['additional'] = Catalog::getAdditionalFieldsArray($fields);
Cache::set('model' . $id, $return);
return $return;
}
} else {
return Cache::get('model' . $id);
}
}
示例11: getOrderGoods
public function getOrderGoods($order)
{
$data = array();
$sql = '
SELECT {{dealers_orders_items}}.*, {{tree}}.name FROM {{dealers_orders_items}}
INNER JOIN {{tree}} ON {{dealers_orders_items}}.tree={{tree}}.id
WHERE {{dealers_orders_items}}.`order`=' . $order . '
';
$list = DB::getAll($sql);
foreach ($list as $item) {
$sql = 'SELECT parent FROM {{tree}} WHERE id=' . $item['tree'] . '';
$id = DB::getOne($sql);
$item['fields'] = Fields::getFieldsByTree($item['tree']);
$data[] = array('goods' => Catalog::getOne($id), 'size' => $item);
}
return $data;
}