/** * 获取条码资料基本参数 * */ public static function getCodeParameter() { $dao = new SystemDao(); $result = $dao->findAll("type = 'coderule'")->toResultSet(); $codeparm = array(); foreach ($result as $item) { $ret = explode(',', $item['paramvalue']); $codeparm[$item['paramname']]['start'] = $ret[0]; $codeparm[$item['paramname']]['length'] = $ret[1]; } //system_out("codeparm:".print_r($codeparm,true)); Session::set('codeparm', $codeparm); $sdao = new CodeDictDao(); $result = $sdao->findAll()->toResultSet(); $codedict = array(); foreach ($result as $item) { $codedict[$item['type']][$item['code']] = $item['value']; } //system_out("codedict:".print_r($codedict,true)); Session::set('codedict', $codedict); $rtn['codeparm'] = $codeparm; $rtn['codedict'] = $codedict; return $rtn; }
/** * 查询条码对照表 * * @param string $condition * @return object */ public function queryCodeDict($condition) { $dao = new CodeDictDao(); $result = $dao->findAll($condition)->toResultSet(); system_out(print_r($result, true)); return $result; }