public function queryCard($condition = '') { try { $action = new CheckoutCardAction(); $result = $action->query($condition); return $result; } catch (Exception $e) { system_out("queryCard error:" . $e); throw new Exception($e); } }
private function getStation($code) { $dao = new StocksDao(); $table = StocksIndexAction::getTableNameByCode($code); if (!$table) { return false; } rsort($table); $result = $dao->findAll("code = '{$code}' ", $table[0])->toResultSet(); if (!$result) { return false; } $row = sizeof($result) - 1; $rtn['code'] = $code; $rtn['factoryNo'] = $result[$row]['factoryNo']; $rtn['goodsName'] = $result[$row]['goodsName']; $rtn['spec'] = $result[$row]['spec']; $rtn['madeIn'] = $result[$row]['madeIn']; //如果在库存,则写上当前库 $currentstocks = new StocksManagerAction(); $curren = $currentstocks->queryCurrentStocks("code = '{$code}'"); if ($curren) { $rtn["location"] = '在库[' . $curren[0]['place'] . ']'; } else { //写上用途/去向 switch ($result[$row]['billType']) { case '调拨出库': $rtn['location'] = "调拨到[" . $result[$row]['toplace'] . "]途中"; break; case '安装领表': $checkout = new CheckoutCardAction(); //print_r($result); $install = $checkout->query("clientNo = '" . $result[$row]['clientNo'] . "'"); if ($install) { $rtn["location"] = "安装到[" . $result[$row]['client'] . "]"; } else { $rtn['location'] = "安装到[" . $result[$row]['client'] . "]途中"; } break; default: $rtn['location'] = '内部移库途中'; } } return $rtn; }