/**
  * 仅仅通过条码获取表名
  *
  * @param string $code
  * @return array
  */
 public static function getTableNameByCode($code)
 {
     try {
         $indexdate = CodeIndexAction::queryIndexByCode($code);
         if (!$indexdate) {
             return false;
         }
         sort($indexdate);
         $result = array();
         foreach ($indexdate as $item) {
             $rtn = StocksIndexAction::getTableNameByDate($item);
             $search = array_search($rtn, $result);
             if ($rtn && $search == false && is_bool($search)) {
                 array_push($result, $rtn);
             }
         }
         return $result;
     } catch (Exception $e) {
         throw new Exception($e);
     }
 }
 /**
  * 增加条码索引
  *
  * @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);
     }
 }