bookModel.php 630 B

1234567891011121314151617181920212223242526
  1. <?php
  2. class bookClassModel extends Model
  3. {
  4. /**
  5. * 读取当前时间借阅数量
  6. */
  7. public function getborrowshu($bookid, $dt='', $sid=0)
  8. {
  9. if($dt=='')$dt=$this->rock->date;
  10. $where = '`bookid`='.$bookid.' and `status` in(0,1) and `isgh`=0 and `id`<>'.$sid.'';
  11. //$where.= " and `jydt`<='$dt'";
  12. $tos = $this->db->rows('[Q]bookborrow', $where);
  13. return floatval($tos);
  14. }
  15. /**
  16. * 读取数可借阅数量
  17. */
  18. public function getjieshu($bookid, $dt='', $sid=0)
  19. {
  20. $yij = $this->getborrowshu($bookid, $dt, $sid);
  21. $tos = floatval($this->getmou('shul', $bookid));
  22. return $tos-$yij;
  23. }
  24. }
粤ICP备19079148号