/** * 增加条码索引 * * @param date $billDate 日期 * @param string $code 条码 */ public static function addCodeIndex($billDate, $code) { //增加条码索引 $code .= "/"; $codeindex = CodeIndexAction::queryIndexByDate($billDate); if ($codeindex) { $codeindex['codeindex'] .= $code; } else { $codeindex['indexdate'] = $billDate; $codeindex['codeindex'] = $code; $codeindex['closed'] = 0; } CodeIndexAction::saveIndex($codeindex); }
/** * 建立条码索引 * * @param $billdate * @param $code * @return boolean */ private function createCodeIndex($billdate, $code) { try { $index = new CodeIndexAction(); $vo = CodeIndexAction::queryIndexByDate($billdate, '0'); if ($vo) { $vo['codeindex'] .= $code . "/"; } else { $vo = new CodeIndexVo(); $vo->indexdate = $billdate; $vo->codeindex = $code . "/"; $vo->closed = 0; } $result = CodeIndexAction::saveIndex($vo); return $result; } catch (Exception $e) { throw new Exception($e); } }