Example #1
0
 /**
  * 输出出仓数据
  *
  * @param $data
  */
 public function outPut($data, $dbconfig)
 {
     //无条码不用做
     if (!$data["code"]) {
         return true;
     }
     $unicode = $dbconfig['unicode'];
     if (!$unicode) {
         $unicode = 'gb2312';
     }
     $billtypedao = new BilltypeDao();
     $billtype = $data["billType"];
     $result = $billtypedao->find("billtypeDesc='{$billtype}'");
     $result = $result->toArray();
     if ($result["stype"] != 'OUT') {
         return true;
     }
     $dao = new Dao('', 'jk_dnb_hgk_send', '', false, $dbconfig);
     $dao->startTrans();
     try {
         if ($data["memo"] == '电能表') {
             $sql = "insert into jk_dnb_hgk_recieve (fc_tm) values('" . $data["code"] . "')";
         } else {
             $sql = "insert into jk_hgq_hgk_recieve (fc_tm) values('" . $data["code"] . "')";
         }
         $sql = $this->auto_charset($sql, 'utf8', $unicode);
         $result = $dao->execute($sql);
     } catch (Exception $e) {
         $dao->rollback();
         throw new Exception($e);
     }
     $dao->commit();
     return true;
 }
Example #2
0
 /**
  * 删除
  *
  * @param $data
  * @return boolean
  */
 public function del($data)
 {
     try {
         $dao = new BilltypeDao();
         if ($data["id"] != '') {
             $dao->deleteById($data["id"]);
         }
     } catch (Exception $e) {
         system_out("BilltypeSetup exception:" . $e);
         return false;
     }
 }
Example #3
0
 public function getBilltype($condition = '', $field = '*')
 {
     $dao = new BilltypeDao();
     $result = $dao->findAll($condition, '', $field)->toResultSet();
     return $result;
 }