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


PHP Fields::getFieldsByModule方法代码示例

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


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

示例1: getEditFields

 public function getEditFields($treeId, $moduleId)
 {
     $return = array();
     $data = array();
     $temp = array();
     $sql = 'SELECT *, ' . $moduleId . ' AS module FROM {{data}} WHERE tree=' . $treeId . ' AND type NOT IN(\'' . implode('\',\'', Fields::$featuresField) . '\') ORDER BY num';
     $additional = DB::getAll($sql);
     foreach ($additional as $item) {
         $temp[] = $item['path'];
     }
     $data = Work::getFields($moduleId);
     $sql = 'SELECT *, ' . $moduleId . ' AS module FROM {{catalog}} WHERE tree=' . $treeId . '';
     $catalog = DB::getRow($sql);
     foreach ($data as $key => $item) {
         if (in_array($item['path'], OneSSA::$catalogStandart)) {
             $data[$key][Fields::$types[$item['type']]['type']] = $catalog[$item['path']];
         } else {
             if (in_array($data[$key]['path'], $temp)) {
                 unset($data[$key]);
             }
         }
     }
     $data = array_merge($data, $additional);
     if (Funcs::$prop['fieldsort'] == 0) {
         return $data;
     } else {
         $fields = Fields::getFieldsByModule($moduleId);
         foreach ($fields as $field) {
             foreach ($data as $item) {
                 if ($field['path'] == $item['path']) {
                     $return[] = $item;
                 }
             }
         }
         return $return;
     }
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:37,代码来源:CatalogModel.php

示例2: getOutFieldsByTree

    public function getOutFieldsByTree($opt = 0)
    {
        $modul = Module::getModuleByTree(Funcs::$uri[2], 0);
        if ($modul['type'] == 'struct') {
            $sql = '
				SELECT {{tree}}.id FROM {{tree}}
				INNER JOIN {{catalog}} ON {{catalog}}.tree={{tree}}.id
				WHERE parent=' . Funcs::$uri[2] . '
				ORDER BY num LIMIT 0,1
			';
            if (DB::getOne($sql)) {
                $modul = Module::getModuleByPath(str_replace('struct_', '', $modul['path']));
            }
        }
        if (!$modul['id']) {
            return array();
        }
        if ($opt == 0) {
            $list = array_merge(Fields::$fieldsStandart, Fields::getFieldsByModule($modul['id']));
            foreach ($list as $key => $item) {
                if (in_array($item['path'], OneSSA::$catalogStandart)) {
                    $list[$key]['isCatalog'] = true;
                }
            }
            return $list;
        } else {
            return Fields::getFieldsByModule($modul['id']);
        }
    }
开发者ID:sov-20-07,项目名称:billing,代码行数:29,代码来源:Fields.php

示例3: getEditFields

 public function getEditFields($treeId, $moduleId)
 {
     $return = array();
     $data = array();
     $temp = array();
     $sql = 'SELECT *, ' . $moduleId . ' AS module FROM {{data}} WHERE tree=' . $treeId . ' ORDER BY num';
     $additional = DB::getAll($sql);
     foreach ($additional as $item) {
         $temp[] = $item['path'];
     }
     $data = Work::getFields($moduleId);
     $sql = 'SELECT * FROM {{fields}} WHERE module=' . $moduleId . ' AND innerf=1 ORDER BY num';
     $fields = DB::getRow($sql);
     foreach ($data as $key => $item) {
         /*if(in_array($item['path'],Fields::$catalogStandart)){
         			$data[$key][Fields::$types[$item['type']]['type']]=$fields[$item['path']];
         		}else{*/
         if (in_array($data[$key]['path'], $temp)) {
             unset($data[$key]);
         }
         //}
     }
     $data = array_merge($data, $additional);
     if (Funcs::$prop['fieldsort'] == 0) {
         return $data;
     } else {
         $fields = Fields::getFieldsByModule($moduleId);
         foreach ($fields as $field) {
             foreach ($data as $item) {
                 if ($field['path'] == $item['path']) {
                     $return[] = $item;
                 }
             }
         }
         return $return;
     }
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:37,代码来源:WorkModel.php

示例4: getWorkFields

 public static function getWorkFields($id)
 {
     $data = array();
     $module = Module::getModuleByTree($id);
     $reserveFieldsList = Fields::getFieldsByModule($module['id']);
     foreach ($reserveFieldsList as $item) {
         $reserveFields[$item['path']] = true;
     }
     $fields = Fields::getFieldsByTree($id);
     if ($fields['video']) {
         $data[] = $fields['video'];
     }
     if ($fields['pics']) {
         $data[] = $fields['pics'];
     }
     $data[] = $fields['fulltext'];
     foreach ($fields as $key => $item) {
         if (!isset($reserveFields[$key])) {
             $data[$key] = $item;
         }
     }
     return $data;
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:23,代码来源:NewsModel.php


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