1
0

mode_bookborrowAction.php 738 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. class mode_bookborrowClassAction extends inputAction{
  3. protected function savebefore($table, $arr, $id, $addbo){
  4. $bookid = $arr['bookid'];
  5. $jydt = $arr['jydt'];
  6. if($id==0 && $jydt<$this->date)return '借阅日期不能是过去';
  7. $shul = m('book')->getjieshu($bookid, $jydt, $id);
  8. if($shul<1)return '该书数量不够了';
  9. }
  10. protected function saveafter($table, $arr, $id, $addbo){
  11. }
  12. public function getbookdata()
  13. {
  14. $where = m('admin')->getcompanywhere(1);
  15. $rows = m('book')->getrows('shul>0'.$where.'','id,title,typeid','typeid');
  16. $arr = array();
  17. foreach($rows as $k=>$rs){
  18. $arr[] = array('value'=>$rs['id'],'name'=>$rs['title']);
  19. }
  20. return $arr;
  21. }
  22. }
粤ICP备19079148号