1
0

bookModel.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. class flow_bookClassModel extends flowModel
  3. {
  4. public function flowrsreplace($rs,$isv=0)
  5. {
  6. if(isset($rs['typeid']))$rs['typeid'] = $this->db->getmou('[Q]option','name',"`id`='".$rs['typeid']."'");
  7. return $rs;
  8. }
  9. protected function flowbillwhere($uid, $lx)
  10. {
  11. $where = '';
  12. $typeid = $this->rock->post('typeid','0');
  13. $key = $this->rock->post('key');
  14. if($typeid!='0'){
  15. $where .= ' and `typeid`='.$typeid.'';
  16. }
  17. //if($key != '')$where.=" and (`title` like '%$key%' or `author` like '%$key%')";
  18. return array(
  19. 'where' => $where,
  20. 'order' => 'optdt desc'
  21. );
  22. }
  23. //导入数据的测试显示
  24. public function flowdaorutestdata()
  25. {
  26. return array(
  27. 'typeid' => '计算机/编程',
  28. 'title' => 'PHP从入门到放弃',
  29. 'num' => 'TS-003',
  30. 'author' => '磐石',
  31. 'chuban' => '信呼开发团队',
  32. 'cbdt' => '2017-01-17',
  33. 'price' => '49.9',
  34. 'shul' => '5',
  35. 'weizhi' => '不知道',
  36. 'isbn' => 'PANSHI-001',
  37. );
  38. }
  39. //导入之前
  40. public function flowdaorubefore($rows)
  41. {
  42. $inarr = array();
  43. $num = 'booktype';
  44. if(ISMORECOM && $cnum=$this->adminmodel->getcompanynum())$num.='_'.$cnum.'';
  45. foreach($rows as $k=>$rs){
  46. $rs['typeid'] = $this->option->gettypeid($num,$rs['typeid']);
  47. $inarr[] = $rs;
  48. }
  49. return $inarr;
  50. }
  51. }
粤ICP备19079148号