• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getFieldBy函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getFieldBy函数的典型用法代码示例。如果您正苦于以下问题:PHP getFieldBy函数的具体用法?PHP getFieldBy怎么用?PHP getFieldBy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: index

 function index()
 {
     $userid = $_GET['userid'];
     $name = getFieldBy($userid, 'id', 'name', 'user');
     $this->assign('name', $name);
     $this->assign('userid', $userid);
     $this->display();
 }
开发者ID:tmlsoft,项目名称:main,代码行数:8,代码来源:SendMsgAction.class.php


示例2: render

 public function render($data)
 {
     //必需传入当前任务id array('id'=>???)
     if ($data['id']) {
         $model = M("mis_project_flow_form");
         $projectid = getFieldBy($data['id'], 'id', 'projectid', "mis_project_flow_form");
         $list = $model->where('status=1 AND outlinelevel = 4 AND projectid=' . $projectid)->order('id asc')->select();
         foreach ($list as $k => $v) {
             if ($v['id'] == $data['id']) {
                 break;
             }
         }
         $prev = $list[$k - 1];
         //上一个任务
         $next = $list[$k + 1];
         //下一个任务
         $html = '<div class="tml_search_tips">';
         $html .= '<div class="search_tips_title">上一个任务:</div>';
         if ($prev) {
             if ($prev['complete'] == 1) {
                 $html .= '<p class="search_tips_center">' . $prev['name'] . '--' . $prev['orderno'] . '&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:grey">【已完成】</span>&nbsp;&nbsp;&nbsp;&nbsp;任务开启时间:' . date('Y-m-d', $prev['begintime']);
                 if ($prev['notes']) {
                     $html .= "&nbsp;&nbsp;&nbsp;&nbsp;任务描述:" . $prev['notes'];
                 }
                 $html .= '</p>';
             } else {
                 $html .= '<p class="search_tips_center">' . $prev['name'] . '--' . $prev['orderno'] . '&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue">【未完成】</span>&nbsp;&nbsp;&nbsp;&nbsp;任务开启时间:' . date('Y-m-d', $prev['begintime']);
                 if ($prev['notes']) {
                     $html .= "&nbsp;&nbsp;&nbsp;&nbsp;任务描述:" . $prev['notes'];
                 }
                 $html .= '</p>';
             }
         } else {
             $html .= '<p class="search_tips_center"><span style="color:grey">任务不存在</span></p>';
         }
         $html .= '<div class="search_tips_title">下一个任务:</div>';
         if ($next) {
             if ($next['complete'] == 1) {
                 $html .= '<p class="search_tips_center">' . $next['name'] . '--' . $next['orderno'] . '&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:grey">【已完成】</span>&nbsp;&nbsp;&nbsp;&nbsp;任务开启时间:' . date('Y-m-d', $next['begintime']);
                 if ($next['notes']) {
                     $html .= "&nbsp;&nbsp;&nbsp;&nbsp;任务描述:" . $next['notes'];
                 }
                 $html .= '</p>';
             } else {
                 $html .= '<p class="search_tips_center">' . $next['name'] . '--' . $next['orderno'] . '&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue">【未完成】</span>&nbsp;&nbsp;&nbsp;&nbsp;任务开启时间:' . date('Y-m-d', $next['begintime']);
                 if ($next['notes']) {
                     $html .= "&nbsp;&nbsp;&nbsp;&nbsp;任务描述:" . $next['notes'];
                 }
                 $html .= '</p>';
             }
         } else {
             $html .= '<p class="search_tips_center"><span style="color:grey">任务不存在</span></p>';
         }
         $html .= '</div>';
         return $html;
     }
 }
开发者ID:tmlsoft,项目名称:main,代码行数:57,代码来源:ShowTaskUpAndDownWidget.class.php


示例3: wfDistributeChart

 /**
  *
  * @Title: wfDistributeChart
  * @Description: todo(设备分布)
  * @author renling
  * @date 2014-7-31 下午2:33:20
  * @throws 
  */
 public function wfDistributeChart()
 {
     $this->createwfDistributeTree();
     $typeModel = D('MisWorkFacilityType');
     $typelist = $typeModel->where('status=1 and pid !=0')->getField("id,name");
     $this->assign("MisWorkFacilityTypeList", $typelist);
     //查询第一个类型
     $MisWorkFacilityDistributeModel = D('MisWorkFacilityDistribute');
     $MisWorkFacilityDistributeVO = $MisWorkFacilityDistributeModel->where("status=1")->find();
     $map = array();
     $map['status'] = 1;
     if ($_REQUEST['equipmenttype']) {
         $map['equipmenttype'] = $_REQUEST['equipmenttype'];
     } else {
         $map['equipmenttype'] = $MisWorkFacilityDistributeVO['equipmenttype'];
     }
     if ($_REQUEST['manageid']) {
         $map['manageid'] = $_REQUEST['manageid'];
     }
     $this->assign("equipmenttype", $map['equipmenttype']);
     $this->assign("title", getFieldBy($map['equipmenttype'], "id", "name", "mis_work_facility_type") . "分布图");
     $map['appqty'] = array("neq", 0);
     $MisWorkFacilityDistributeList = $MisWorkFacilityDistributeModel->where($map)->select();
     $xAxis = array("categories" => array());
     $deptlist = array();
     $manageidList = array();
     $series = array();
     foreach ($MisWorkFacilityDistributeList as $key => $val) {
         if (!in_array($val['applydepartmentid'], array_keys($deptlist))) {
             $deptlist[$val['applydepartmentid']] = 1;
             $xAxis["categories"][] = getFieldBy($val['applydepartmentid'], 'id', "name", "mis_system_department");
         }
         if (!in_array($val['manageid'], array_keys($manageidList))) {
             $manageidList[$val['manageid']] = 1;
             $newseries = array("name" => $val['managename'], "data" => array());
             $series[] = $newseries;
         }
     }
     $i = 0;
     foreach ($manageidList as $mkey => $mval) {
         $alist = array();
         foreach ($deptlist as $key => $val) {
             $manageMap = array();
             $manageMap['manageid'] = $mkey;
             $manageMap['applydepartmentid'] = $key;
             $manageMap['equipmenttype'] = $map['equipmenttype'];
             //查询该部门下设备数量
             $MisWorkFacilityDistributeVo = $MisWorkFacilityDistributeModel->where($manageMap)->find();
             $alist[] = intval($MisWorkFacilityDistributeVo['appqty']);
         }
         $series[$i]["data"] = $alist;
         $i++;
     }
     $this->assign("xAxis", json_encode($xAxis));
     $this->assign("series", json_encode($series));
     $this->display("wfDistributeChart");
 }
开发者ID:tmlsoft,项目名称:main,代码行数:65,代码来源:MisWorkFacilityStatisticalAction.class.php


示例4: getViewConf

 public function getViewConf($name)
 {
     $modelname = getFieldBy($name, 'name', 'modelname', 'mis_system_dataview_mas');
     $file = Dynamicconf . "/Models/" . $modelname . "/" . $name . ".inc.php";
     if (is_file($file)) {
         return require $file;
     } else {
         return array();
     }
 }
开发者ID:tmlsoft,项目名称:main,代码行数:10,代码来源:MisSystemDataviewMasModel.class.php


示例5: lookupdistribute

 public function lookupdistribute()
 {
     $map = $this->_search();
     //实例化办公设备类型表
     $dptmodel = D("MisWorkFacilityType");
     //查name和id
     $deptlist = $dptmodel->where("status=1")->order("id asc")->field('id,name,pid as parentid')->select();
     $treemiso[] = array('id' => 0, 'pId' => -1, 'name' => '设备类型', 'rel' => 'misworkfacilitydistributeli', 'target' => 'ajax', 'url' => '__URL__/lookupdistribute/jump/1', 'open' => true);
     $param['rel'] = "misworkfacilitydistributeli";
     $param['url'] = "__URL__/lookupdistribute/jump/1/equipmenttype/#id#";
     $typeTree = $this->getTree($deptlist, $param, $treemiso);
     $this->assign('tree', $typeTree);
     $equipmenttype = $_REQUEST['equipmenttype'];
     $id = $_REQUEST['id'];
     if ($id) {
         $map['manageid'] = $id;
         $equipmenttype = getFieldBy($id, 'id', 'equipmenttype', 'mis_work_facility_manage');
     }
     $map['appqty'] = array("neq", 0);
     if ($equipmenttype) {
         //加入递归
         $deptlist = array_unique(array_filter(explode(",", $this->findAlldept($deptlist, $equipmenttype))));
         $map['equipmenttype'] = array("in", $deptlist);
         $this->assign("equipmenttype", $equipmenttype);
     }
     //动态配置显示字段
     $name = $this->getActionName();
     if (!empty($name)) {
         $qx_name = $name;
         if (substr($name, -4) == "View") {
             $qx_name = substr($name, 0, -4);
         }
         //验证浏览及权限
         if (!isset($_SESSION['a'])) {
             $map = D('User')->getAccessfilter($qx_name, $map);
         }
         $this->_list($name, $map);
     }
     $scdmodel = D('SystemConfigDetail');
     //扩展工具栏操作
     $toolbarextension = $scdmodel->getDetail($name, true, 'toolbar');
     if ($toolbarextension) {
         $this->assign('toolbarextension', $toolbarextension);
     }
     $detailList = $scdmodel->getDetail($name);
     if ($detailList) {
         $this->assign('detailList', $detailList);
     }
     if ($_REQUEST['jump']) {
         $this->display("lookupdistributeview");
     } else {
         $this->display();
     }
 }
开发者ID:tmlsoft,项目名称:main,代码行数:54,代码来源:MisWorkFacilityDistributeAction.class.php


示例6: index

 public function index()
 {
     $name = $this->getActionName();
     if (isset($_SESSION[C('USER_AUTH_KEY')])) {
         //初始化生成左边树,默认打开节点,跳转不再刷新树
         $model = D('SystemConfigDetail');
         if ($_REQUEST['jump']) {
             $modelName = $_REQUEST['model'];
         } else {
             $models = D('SystemConfigNumber');
             $returnarr = $models->getRoleTree('ToolBarConfigBox');
             //左边树
             $firstDetail = $models->firstDetail;
             $this->assign('returnarr', $returnarr);
             if ($_REQUEST['model']) {
                 $check = getFieldBy($_REQUEST['model'], 'name', 'id', 'node');
                 $this->assign('check', $check);
                 $modelName = $_REQUEST['model'];
             } else {
                 $this->assign('check', $firstDetail['check']);
                 $modelName = $firstDetail['name'];
             }
         }
         //赋值给toolbar调用
         $_REQUEST['modelname'] = $modelName;
         $this->assign('modelname', $modelName);
         $scdmodel = D('SystemConfigDetail');
         //读取列名称数据(按照规则,应该在index方法里面)
         $detailList = $scdmodel->getDetail($name);
         if ($detailList) {
             $this->assign('detailList', $detailList);
         }
         // 		//扩展工具栏操作
         $toolbarextension = $scdmodel->getDetail($name, true, 'toolbar');
         if ($toolbarextension) {
             $this->assign('toolbarextension', $toolbarextension);
         }
         // 选中模型的toolbar配置集
         $scdmodel = D('SystemConfigDetail');
         $toollist = $scdmodel->getDetail($modelName, false, 'toolbar');
         $list = $this->htmlaspilt($toollist);
         //dump($toollist);
         $this->assign('list', $list);
         if ($_REQUEST['jump']) {
             $this->display("indexview");
         } else {
             $this->display();
         }
     }
 }
开发者ID:tmlsoft,项目名称:main,代码行数:50,代码来源:ToolBarConfigAction.class.php


示例7: _before_add

 /**
  * @Title: _before_add
  * @Description: todo(打开页面前置函数)
  * @author 
  * @throws
  */
 public function _before_add()
 {
     $this->assign("time", time());
     //得到当前登录的用户绑定的员工
     $userid = $_SESSION[C('USER_AUTH_KEY')];
     $deptid = getFieldBy($userid, 'id', 'dept_id', 'user');
     //获取部门
     //$model=D("MisHrPersonnelPersonInfo");
     //$deptid = $model->where("id=".$employeid)->getField("deptid");
     //查询职位
     $DutyModel = D('Duty');
     $DutyList = $DutyModel->where(" status=1")->getField('id,name');
     $this->assign("DutyList", $DutyList);
     //根据当前用户的部门选择select下拉框的部门
     $this->_before_everymethor($deptid);
 }
开发者ID:tmlsoft,项目名称:main,代码行数:22,代码来源:MisHrPersonnelApplicationInfoAction.class.php


示例8: render

 public function render($data)
 {
     $tablename = MODULE_NAME;
     // 当前类名
     $where = array();
     $where['tablename'] = $tablename;
     //查询当前tablename是否存在编码方案
     $MisSystemOrdernoModel = D("MisSystemOrderno");
     $vo = $MisSystemOrdernoModel->where($where)->find();
     $nodetitle = getFieldBy($tablename, "name", "title", "node");
     if ($data) {
         $title = $nodetitle . "编码方案!";
     } else {
         $title = "暂无" . $nodetitle . ",请新增" . $nodetitle . "!";
     }
     $html = "";
     if ($vo) {
         $xstr = "*********";
         $newstr = "";
         for ($i = 1; $i <= $vo['maxlevels']; $i++) {
             $num = $vo[$MisSystemOrdernoModel->arr[$i]];
             $result = substr($xstr, 0, $num);
             $newstr .= $result . " ";
         }
         $html .= '<div class="tips_add_info">';
         $html .= '   <p><span><span class="icon-comments"></span><span> 提示:</span></span>' . $title . '</p>';
         $html .= '   <p>编码方案:<span>' . $newstr . '</span></p>';
         $html .= '   <p>最大级数:<span>' . $vo['maxlevels'] . '</span></p>';
         $html .= '   <p>最大长度:<span>' . $vo['maxlenght'] . '</span></p>';
         $html .= '	<p>单级最大长度:<span>' . $vo['singlelenght'] . '</span></p>';
         $html .= '</div>';
     } else {
         $html .= '<div class="tips_add_info">';
         $html .= '   <p><span><span class="icon-comments"></span><span> 提示:</span></span>' . $title . '</p>';
         $html .= '   <p>编码方案:<span>无</span></p>';
         $html .= '   <p>最大级数:<span>0</span></p>';
         $html .= '   <p>最大长度:<span>0</span></p>';
         $html .= '	<p>单级最大长度:<span>0</span></p>';
         $html .= '</div>';
     }
     return $html;
 }
开发者ID:tmlsoft,项目名称:main,代码行数:42,代码来源:MisSystemOrdernoWidget.class.php


示例9: _before_insert

 public function _before_insert()
 {
     //获得部门
     $deptid = $_POST['deptid'];
     //获得职级
     $dutyid = $_POST['dutyid'];
     //判断当前添加的部门职级是否已经存在了。
     $name = $this->getActionName();
     $model = D($name);
     $where = array();
     $where['deptid'] = $deptid;
     $where['dutyid'] = $dutyid;
     $where['userid'] = $_POST['userid'];
     $list = $model->where($where)->find();
     $username = getFieldBy($_POST['userid'], 'id', 'name', 'user');
     $dutyname = getFieldBy($dutyid, 'id', 'name', 'duty');
     $deptname = getFieldBy($deptid, 'id', 'name', 'mis_system_department');
     if ($list) {
         $this->error($username . "已经是" . $deptname . "的" . $dutyname . "! 请勿重复添加");
     }
 }
开发者ID:tmlsoft,项目名称:main,代码行数:21,代码来源:UserDeptDutyAction.class.php


示例10: getNestedForm

 /**
  * 获取套表的所有子项,只获取直属关系,套表 调用 套表 不考虑、
  * @Title: getNestedForm
  * @Description: todo(这里用一句话描述这个方法的作用) 
  * @param string	 $mainAction  主入口action名称
  * @param boolean	$isContentSelf	是否包含自己,默认false 不包含	 
  * @author quqiang 
  * @date 2015年3月4日 下午1:55:23 
  * @throws
  */
 protected function getNestedForm($mainAction, $isContentSelf = false)
 {
     $MisAutoBindModel = D("MisAutoBind");
     //获取主表formid
     $formid = getFieldBy($mainAction, "actionname", "id", "mis_dynamic_form_manage");
     //是否为套表主表
     if (getFieldBy($mainAction, "bindaname", "pid", "mis_auto_bind", "typeid", 2) == 0) {
         $map = array();
         $map['level'] = $formid;
         $map['typeid'] = 2;
         // 是否包换自己
         if (!$isContentSelf) {
             //$map['pid'] = array('neq' , '0');
         }
         $list = $MisAutoBindModel->where($map)->getField("id,inbindaname");
         if ($isContentSelf) {
             echo $MisAutoBindModel->getLastSql();
         }
         return $list;
     } else {
         return false;
     }
 }
开发者ID:tmlsoft,项目名称:main,代码行数:33,代码来源:FormMenuWidget.class.php


示例11: getNodeTree

 public function getNodeTree($map)
 {
     if ($map) {
         $map = " status=1  and  " . $map;
     } else {
         $map = "status=1";
     }
     //查询全部三级数据
     $NodeTreeList = $this->where($map)->select();
     $nodeTree = array();
     $pname = array();
     foreach ($NodeTreeList as $key => $val) {
         $nodeTree[] = array('id' => $val['id'], 'name' => $val['title'], 'title' => $val['title'], 'ename' => $val['name'], 'pId' => "-" . $val['pid'], 'url' => "__URL__/index/jump/1/nodename/" . $val['name'], 'target' => 'ajax', 'rel' => 'ProcessManageBox', 'open' => false);
         $pid[] = $val['pid'];
     }
     $pid = array_unique($pid);
     foreach ($pid as $k => $v) {
         if (getFieldBy($v, "id", "name", "node")) {
             $nodeTree[] = array('id' => "-" . $v, 'name' => getFieldBy($v, "id", "title", "node"), 'title' => getFieldBy($v, "id", "title", "node"), 'pId' => 0);
         }
     }
     return $nodeTree;
 }
开发者ID:tmlsoft,项目名称:main,代码行数:23,代码来源:NodeModel.class.php


示例12: render

 /**
  * (non-PHPdoc)
  * @see Widget::render(系统三级页面左树与导航切换)
  */
 public function render($data)
 {
     return;
     //获取改模型所在分组的菜单
     $name = MODULE_NAME;
     $groupid = getFieldBy($name, 'name', 'group_id', 'node');
     //实例化缓存 有就读缓存的内容
     $mrdmodel = D('MisRuntimeData');
     $html = $mrdmodel->getRuntimeCache($name, $groupid . 'ShowToLevelMenu');
     if (empty($html)) {
         $model = D('Public');
         $accessNode = $model->menuLeftTree($groupid);
         //组合html
         $html .= '<script src="__PUBLIC__/Js/showtolevelmemu.js" type="text/javascript"></script>';
         $html .= '<a class="menu_tag" href="#"><span class="icon-reorder"></span></a>';
         $html .= '<div class="nbmaccordionFloat">';
         $html .= '<div class="nbmaccordion"  data-option="close:icon-double-angle-down;open:icon-double-angle-up" layouth="85">';
         foreach ($accessNode as $k => $vo) {
             $html .= '<div title="' . $vo["title"] . '">';
             $html .= '<ul>';
             foreach ($vo['levelthree'] as $k1 => $vv) {
                 $html .= '<li>';
                 $html .= '<a title="' . $vv["title"] . '" href="__APP__/' . $vv["name"] . '/index" target="navTab">';
                 $html .= '<span class="icon icon-tags mr10"></span>';
                 $html .= '<span>' . $vv["title"] . '</span>';
                 $html .= '</a>';
                 $html .= '</li>';
             }
             $html .= '</ul>';
             $html .= '</div>';
         }
         $html .= '</div>';
         $html .= '</div>';
         $mrdmodel->setRuntimeCache($html, $name, $groupid . 'ShowToLevelMenu');
     }
     return $html;
 }
开发者ID:tmlsoft,项目名称:main,代码行数:41,代码来源:ShowToLevelMenuWidget.class.php


示例13: insertsub

 public function insertsub()
 {
     $model = M("mis_system_intercalate_sub");
     if ($_POST['modelid']) {
         $_POST['modelname'] = getFieldBy($_POST['modelid'], "id", "name", "node");
     }
     $data = $model->create();
     if (false === $data) {
         $this->error($model->getError());
     }
     //保存当前数据对象
     try {
         $list = $model->add($data);
         //echo $model->getlastsql();
     } catch (Exception $e) {
         $this->error($e->__toString());
     }
     $msg = $model->getlastsql() . arr2string($data);
     if (false === $list) {
         $this->error($msg);
     } else {
         $this->success("操作成功!");
     }
 }
开发者ID:tmlsoft,项目名称:main,代码行数:24,代码来源:MisSystemIntercalateMasAction.class.php


示例14: _before_add

 public function _before_add()
 {
     //查询所有部门信息
     $deptmodel = D("MisSystemDepartment");
     $deptlist = $deptmodel->where("status=1")->select();
     $deptlists = $this->selectTree($deptlist, 0, 0, $_REQUEST['departmentid']);
     $this->assign("deptlist", $deptlists);
     //echo $_REQUEST['departmentid'].">>>".getFieldBy($_REQUEST['departmentid'], "id", "companyid", "mis_system_department");exit;
     //查询当前部门是否有下级部门
     $deptVo = $deptmodel->where("status=1 and parentid=" . $_REQUEST['departmentid'])->field("id")->find();
     $departmentid = "";
     if ($deptVo) {
         $departmentid = $deptVo['id'];
     } else {
         $departmentid = $_REQUEST['departmentid'];
     }
     $this->assign("departmentid", $departmentid);
     $this->assign("companyid", getFieldBy($departmentid, "id", "companyid", "mis_system_department"));
     //公司信息进入新增
     if ($_REQUEST['com']) {
         $this->assign("com", $_REQUEST['com']);
     }
     $this->assign('depdata', $this->getCompanyDept());
 }
开发者ID:tmlsoft,项目名称:main,代码行数:24,代码来源:MisRoleGroupAction.class.php


示例15: format

 /**
  * 原始数据格式化为组件属性数据。
  * @Title: format
  * @Description: todo(将原始数据格式化为以组件为主的属性数据)
  *
  * @param array $data
  *        	原始数据
  * @author quqiang
  *         @date 2015年1月29日 上午11:02:37
  * @example $data = array('ActionName','nodeName|nodeID','tplName'
  *          array(
  *          array('name',true,false),//	$arr[0]:字段名	$arr[1]:写入权限	$arr[2]:读取权限
  *          array('age',true,true),
  *          array('sex',false,false),
  *          )
  *          );
  *          $fmtData = format($data);
  *          权限值 为 true时 表示不做过滤操作,没有读取权限包含没有写入权限
  *          tplName:可为空,表示使用index模板。做后续可能的扩展用。
  * @throws Exception 需要异常处理
  */
 private function format($data)
 {
     if (!is_array($data)) {
         throw new Exception("没有可用数据用于解析!");
         exit;
     }
     $actionName = $data[0];
     $nodeName = $data[1];
     $tplName = $data[2] ? $data[2] : 'index';
     if (!$actionName) {
         throw new Exception('传入Action名称为空');
         exit;
     }
     $this->actionName = $actionName;
     if (!$nodeName) {
         throw new Exception('传入节点标识为空');
         exit;
     }
     $this->nodeName = $nodeName;
     if (!is_dir(TMPL_PATH . C('DEFAULT_THEME') . '/' . $actionName)) {
         throw new Exception("文件路径 " . TMPL_PATH . C('DEFAULT_THEME') . '/' . $actionName . " 不存在!");
         exit;
     }
     $formid = getFieldBy($actionName, "actionname", "id", "mis_dynamic_form_manage");
     if (!$formid) {
         throw new Exception("传入表单Action[{$actionName}]不存在于表单记录表中,请查证!");
         exit;
     }
     $this->formid = $formid;
     $dataSouce = $data[3];
     // if (! is_array ( $dataSouce )) {
     // throw new Exception ( "过滤条件为空!" );
     // return false;
     // }
     $this->dataSouce = $dataSouce;
 }
开发者ID:tmlsoft,项目名称:main,代码行数:57,代码来源:MisFieldFilterModel.class.php


示例16: createView

    /**
     * @Title: createView
     * @Description: todo(生成查询视图代码)
     * @param string $actionName	Action名称
     * @author renling
     * @date 2014-10-?
     * @throws
     * @modify
     * 	屈强@2014-10-08 16:21	视图查询字段添加主表的ID
     *
     */
    protected function createView($actionName)
    {
        // 通过action名称称获取所有表信息
        if (!$this->nodeName) {
            $this->error('Action名称丢失!!');
        }
        $mis_dynamic_form_manageObj = M('mis_dynamic_form_manage');
        $forminfo = $mis_dynamic_form_manageObj->where("`actionname`='{$this->nodeName}'")->find();
        if (!is_array($forminfo)) {
            $this->error('没有获取到表单记录信息');
        }
        // 得到字段记录。
        $MisDynamicDatabaseMasViewModel = D("MisDynamicDatabaseMasView");
        $allTableFiledArr = $MisDynamicDatabaseMasViewModel->where('mis_dynamic_database_mas.status=1 and  mis_dynamic_database_sub.status and  mis_dynamic_database_mas.formid=' . $forminfo['id'])->select();
        // 将字段信息按所属表分组
        $tablelist = array();
        $newAllTableFieldArr = array();
        foreach ($allTableFiledArr as $key => $val) {
            if ($val['category'] != "datatable") {
                $tablearr = array('tablename' => $val['tablename'], 'tabletitle' => $val['tabletitle'], 'isprimary' => $val['isprimary'], 'ischoise' => $val['isprimary']);
                $tablelist[$val['masid']][] = $val;
            }
        }
        logs("=============endview ===" . __LINE__ . "-----》》》》==========" . $this->nodeName);
        //$dir = ROOT . "/Dynamicconf/autoformconfig/MisAutoAnameList.inc.php";
        //$tablelist=require $dir;
        $modelPath = LIB_PATH . "Model/" . $this->nodeName . "ViewModel.class.php";
        logs("=============endview ===" . __LINE__ . "-----》》》》==========" . $this->nodeName);
        $listArr = "";
        $primaryname = "";
        foreach ($tablelist as $stkey => $stval) {
            if (getFieldBy($stkey, "id", "isprimary", "mis_dynamic_database_mas")) {
                $listArr .= "\t'" . getFieldBy($stkey, "id", "tablename", "mis_dynamic_database_mas") . "'=>array('id',";
                foreach ($stval as $sctkey => $sctval) {
                    $listArr .= "'" . $sctval['field'] . "',";
                }
                /**
                 * 系统默认字段
                 */
                foreach ($this->systemUserField as $bkey => $bval) {
                    if ($bval != id) {
                        $listArr .= "'" . $bval . "',";
                    }
                }
                $listArr .= "'_type'=>'LEFT'),\r\n";
                $primaryname = $sctval['tablename'];
            }
        }
        logs($tablelist, 'view', '', __CLASS__, __FUNCTION__, __METHOD__);
        foreach ($tablelist as $tkey => $tval) {
            if (!getFieldBy($tkey, "id", "isprimary", "mis_dynamic_database_mas")) {
                $listArr .= "\t'" . getFieldBy($tkey, "id", "tablename", "mis_dynamic_database_mas") . "'=>array(";
                foreach ($tval as $ctkey => $ctval) {
                    if (trim($ctval['field'])) {
                        $listArr .= "'" . $ctval['field'] . "',";
                    }
                }
                $listArr .= "'_on'=>'" . $primaryname . ".id=" . getFieldBy($tkey, "id", "tablename", "mis_dynamic_database_mas") . ".masid'),\r\n";
            }
        }
        $phpcode .= "<?php\r\n/**";
        $phpcode .= "\r\n * @Title: " . $this->nodeName . "ModelView";
        $phpcode .= "\r\n * @Package package_name";
        $phpcode .= "\r\n * @Description: todo(动态表单_自动生成-" . $this->nodeTitle . ")";
        $phpcode .= "\r\n * @author " . $_SESSION['loginUserName'];
        $phpcode .= "\r\n * @company Aqo5Re65bSr5zG755m45t92YuQnZvNHbtRnL3d3d";
        $phpcode .= "\r\n * @copyright 本文件归属于Aqo5Re65bSr5zG755m45t92YuQnZvNHbtRnL3d3d";
        $phpcode .= "\r\n * @date " . date('Y-m-d H:i:s');
        $phpcode .= "\r\n * @version V1.0";
        $phpcode .= "\r\n*/";
        $phpcode .= "\r\nclass ";
        $phpcode .= $this->nodeName . "ViewModel extends ViewModel {\r\n\t";
        $phpcode .= <<<EOF
\t\t
\tfunction __construct(){
\t\tparent::__construct();
\t\t\$arr = getModelFilterByNodeSetting();
\t\tif(is_array(\$arr)){
\t\t\t\$this->_filter = \$arr;
\t\t}
\t}
\t// 字段权限过滤
\tprotected \$_filter = array();
\t\t
EOF;
        $phpcode .= "public \$viewFields = array(\r\n" . $listArr . ");";
        $phpcode .= "\r\n}\r\n?>";
        if (!is_dir(dirname($modelPath))) {
            mk_dir(dirname($modelPath), 0777);
//.........这里部分代码省略.........
开发者ID:tmlsoft,项目名称:main,代码行数:101,代码来源:MisDynamicFormModelAction.class.php


示例17: openRulesPage

 /**
  * @Title: openRulesPage
  * @Description: todo(打开规则条件编辑页面)   
  * @author 谢友志 
  * @date 2015-3-12 下午2:47:13 
  * @throws
  */
 function openRulesPage()
 {
     $modelname = $_POST['sourcemodel'];
     $tablename = D($modelname)->getTableName();
     $datatableModel = M("mis_dynamic_form_datatable");
     $formid = $datatableModel->where("tablename='{$tablename}'")->getField("formid");
     if ($formid) {
         $modelname = getFieldBy($formid, 'id', "actionname", "mis_dynamic_form_manage");
         $inlinetable = $tablename;
     }
     $this->assign("modelname", $modelname);
     $this->assign("inlinetable", $inlinetable);
     $this->assign("multitype", $_POST['multitype']);
     $rulespageinfo = json_decode(base64_decode($_POST['rulespageinfo']), true);
     $rulespageinfo['sourcetype'] = explode(',', $rulespageinfo);
     foreach ($rulespageinfo as $k => $v) {
         if (empty($v)) {
             unset($rulespageinfo[$k]);
         }
     }
     $this->assign("rulespageinfo", $rulespageinfo);
     $this->display();
 }
开发者ID:tmlsoft,项目名称:main,代码行数:30,代码来源:MisSystemDataRoamMasAction.class.php


示例18: getNoticeDetail

 /**
  * @Title: getNoticeDetail
  * @Description: todo(获得系统公告详细信息,返回的是json)
  * @param unknown_type $id  公告id
  * @author xiafengqin
  * @date 2014-4-3 下午3:45:52
  * @throws
  */
 public function getNoticeDetail()
 {
     //获取系统公告ID
     $id = $_REQUEST['id'];
     //判断当前用户是否已查看 未查看则添加记录
     $mSAUmodel = M("mis_system_announcement_user");
     $readStatus = $mSAUmodel->where("userid=" . $this->userid . " and announceid=" . $id)->getField("status");
     $readData = array();
     $readData['userid'] = $this->userid;
     $readData['announceid'] = $id;
     $readData['status'] = 1;
     if ($readStatus == NULL) {
         //新增
         $mSAUmodel->data($readData)->add();
     } else {
         if ($readStatus == 0) {
             //状态为未读时
             $mSAUmodel->where("userid=" . $this->userid . " and announceid=" . $_REQUEST['id'])->setField('status', 1);
         }
     }
     $MisSystemAnnouncementModel = D('MisSystemAnnouncement');
     $map = array();
     $map['status'] = 1;
     $map['commit'] = 1;
     $map['id'] = $id;
     $returnData = $MisSystemAnnouncementModel->where($map)->field('id,title,createid,createtime,content')->find();
     if ($returnData) {
         //声明相关附件表
         $modelMAR = M('MisAttachedRecord');
         //获取附件信息
         $num = 0;
         $map = array();
         $map["status"] = 1;
         $map["orderid"] = $returnData['id'];
         $map["type"] = 78;
         $attarry = $modelMAR->field("upname,attached")->where($map)->select();
         if ($attarry) {
             $returnData['attach'] = array();
             foreach ($attarry as $attkey => $attval) {
                 $returnData['attach'][$num]['attachname'] = $attval['upname'];
                 //注意这里的路径,必须是__APP__."/MisSystemAnnouncement/misFileManageDownload/:对应模型名称,不能是__URL__."/misFileManageDownload/;将取不到数据
                 $returnData['attach'][$num]['attachurl'] = __APP__ . "/MisSystemAnnouncement/misFileManageDownload/path/" . base64_encode($attval['attached']) . "/rename/" . $attval['upname'];
                 $num++;
             }
         } else {
             //你存在数据是赋予空值
             $returnData['attach'] = null;
         }
     }
     //将id转化成人名,将时间戳转换成日期格式,将部门取出
     $returnData['username'] = getFieldBy($returnData['createid'], 'id', 'name', 'user');
     $deptid = getFieldBy($returnData['createid'], 'id', 'dept_id', 'user');
     $returnData['deptname'] = getFieldBy($deptid, 'id', 'name', 'mis_system_department');
     $returnData['createtime'] = transTime($returnData['createtime']);
     $returnData['content'] = strip_tags($returnData['content']);
     unset($returnData['createid']);
     if ($returnData) {
         //echo '[{"error":"没有找到数据"}]';
         echo json_encode($returnData);
     } else {
         echo '{"error":"没有找到数据"}';
     }
 }
开发者ID:tmlsoft,项目名称:main,代码行数:71,代码来源:OAHelperAction.class.php


示例19: upDanju

 /**
  * 
  * @Title: upDanju
  * @Description: todo(上传单据时修改上传单据状态 并加入推送 让货主确认) 
  * @param unknown $tableid
  * @return unknown  
  * @author 刘智宏 
  * @date 2016年3月23日 下午3:38:39 
  * @throws
  */
 function upDanju($tableid, $orderno, $huozhu)
 {
     //加入自动确认
     $MisAutoGhk = D("MisAutoGhk");
     $map = array();
     $map["moxing"] = "MisAutoCpl";
     //主城配送模型
     $peizhi = $MisAutoGhk->where($map)->field("peizhitianshu")->find();
     //获取配置
     $tianshu = $peizhi["peizhitianshu"];
     //获取配置天数
     $huodanid = getFieldBy($tableid, "id", "peisongdanhao", "MisAutoHbz");
     //获取货单id
     $MisAutoQgl = D("MisAutoQgl");
     $data = array();
     $data["suoshumoxing"] = "mis_auto_evuyl";
     $data["dengdaitianshu"] = time() + $tianshu * 86400;
     //自动完成时间
     $data["shifuqueren"] = 0;
     $data["danhao"] = $huodanid;
     $data["wanchengziduan"] = "zuizhongqueren";
     $data["wanchengziduanzhuang"] = "1";
     $data["createtime"] = time();
     //加入时间
     $result = $this->CURD("MisAutoQgl", 'add', $data);
     //加入推送
     $MobileApicloudBase = D("MobileApicloudBase");
     $MobileApicloudBase->getTuisong("您的订单" . $orderno . "已送达并上传单据请确认", $huozhu, "1", "type=1&winname=frame2/hyxq_window&huodanid=" . $tableid);
     // 内容     货主ID   推送端1货主0司机
     $map = array();
     $map['id'] = $tableid;
     $data = array();
     $data['danjushifushangchuan'] = 1;
     $result = $this->CURD('MisAutoHbz', 'save', $data, $map);
     return $result;
 }
开发者ID:tmlsoft,项目名称:main,代码行数:46,代码来源:MobileFileBaseAction.class.php


示例20: setZhuanShouCurAuditUser

 /**
  * @Title: setZhuanShouCurAuditUser 
  * @Description: todo(流程转授,替换当前审核人) 
  * @param 当前审核人 $curAuditUser
  * @param 当前模型名称 $tablename
  * @return string  
  * @author liminggang
  * @date 2015-7-24 下午5:19:37 
  * @throws
  */
 private function setZhuanShouCurAuditUser($curAuditUser, $tablename)
 {
     $newarr['curAuditUser'] = $curAuditUser;
     $newarr['zhua 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getFieldByReportLabel函数代码示例发布时间:2022-05-15
下一篇:
PHP getField函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap