_table . " where staff= '" . $sid . "' " . $dateCondition . " and status=2 "; // echo '
'; $query = Doo::db ()->query ( $sql ); $result = $query->fetch (); return $result; } function getReceiptBySid($sid = '', $year = '', $month = '') { Doo::loadClass ( 'XDeode' ); $XDeode = new XDeode ( 5 ); if (empty ( $sid )) return array (); $sql = 'select a.* from ' . $this->_table . ' as a left join CLD_receiptDetail as b on b.rid=a.rid where b.staff =' . $sid . ' and Month(b.pastDate)=' . $month . ' and Year(b.pastDate)=' . $year . ' and b.status=1 GROUP BY b.rid'; $query = Doo::db ()->query ( $sql ); $list = $query->fetchAll (); foreach ( $list as $key => $value ) { $list [$key] ['ridKey'] = $XDeode->encode ( $value ['rid'] ); } return $list; } function getReceiptByRid($rid = '') { Doo::loadClass ( 'XDeode' ); $XDeode = new XDeode ( 5 ); Doo::loadModel ( 'L_category' ); $Lcategory = new L_category (); Doo::loadModel ( 'staff' ); $staff = new staff (); if (! is_numeric ( $rid )) $rid = $XDeode->decode ( $rid ); $rinfo = $this->getOne ( array ( 'where' => 'rid=' . $rid, 'asArray' => true ) ); $rinfo['ridKey']=$XDeode->encode ( $rinfo ['rid'] ); $rinfo['category']=$Lcategory->getCategoryById($rinfo['cid']); $rinfo['staffDetail']=$staff->getStaffBySid($rinfo['staff']); return $rinfo; } } ?>