Ejemplo n.º 1
0
 /**
  * 保存未确认表位
  *
  * @param  array $data   表位
  * @param String $state  状态    "U" 挂表 ; "D" 取表
  */
 public function saveUnconfirmStation($data, $struct, $state)
 {
     $unconfirm = new UnconfirmstationDao();
     $unconfirm->startTrans();
     try {
         foreach ($data as $value) {
             for ($i = 0; $i < sizeof($value); $i++) {
                 $station = $value[$i];
                 if ($station == '' || $station == null) {
                     continue;
                 }
                 $result = $unconfirm->getCount("station = '{$station}'");
                 if ($result == 0) {
                     $vo = $unconfirm->createVo('add', '', 'id', 0, $value[$i]);
                     $vo->confirm = 0;
                     $vo->struct = $struct;
                     $vo->station = $station;
                     $vo->state = $state;
                     $unconfirm->add($vo);
                 }
             }
         }
     } catch (Executive $e) {
         $unconfirm->rollback();
         throw new Exception($e);
     }
     $unconfirm->commit();
 }