companyModel.php 955 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * 单位管理
  4. */
  5. class flow_companyClassModel extends flowModel
  6. {
  7. public $flowcompanyidfieds = 'none';
  8. public $baseall = array();
  9. public function flowdeletebillbefore()
  10. {
  11. if($this->rows('pid='.$this->id.'')>0)return '有下级不允许删除';
  12. }
  13. public function getallbase()
  14. {
  15. if($this->baseall)return $this->baseall;
  16. $rows = $this->db->getall('show DATABASES');
  17. foreach($rows as $k=>$rs){
  18. $this->baseall[] = $rs['Database'];
  19. }
  20. return $this->baseall;
  21. }
  22. //替换
  23. public function flowrsreplace($rs)
  24. {
  25. $iscreate = 0;
  26. if(!isempt($rs['num'])){
  27. $base = ''.DB_BASE.'_company_'.$rs['num'].'';
  28. $arr = $this->getallbase();
  29. if(in_array($base, $arr))$iscreate = 1;
  30. }
  31. if(isset($rs['iscreate']) && $iscreate!=$rs['iscreate'])$this->update('`iscreate`='.$iscreate.'', $rs['id']);
  32. $rs['iscreate'] = $iscreate;
  33. return $rs;
  34. }
  35. public function testabc()
  36. {
  37. }
  38. }
粤ICP备19079148号