staffLeaveManage.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. Doo::loadCore ( 'db/DooModel' );
  3. /**
  4. *
  5. * @author CP.
  6. * @version 1.0
  7. * @namespace invoice
  8. * @package invoiceModel
  9. */
  10. class staffLeaveManage extends DooModel {
  11. /**
  12. *
  13. * @var integer $iid 管理组ID
  14. */
  15. public $icid;
  16. /**
  17. *
  18. * @var string $staff 管理组人员
  19. */
  20. public $staff;
  21. public $category;
  22. public $cid;
  23. public $CC;
  24. public $_table = 'CLD_staffLeaveManage';
  25. public $_primarykey = 'icid';
  26. public $_fields = array (
  27. 'icid',
  28. 'staff',
  29. 'category',
  30. 'CC',
  31. 'cid'
  32. );
  33. /**
  34. * 获得查看人员
  35. * @param number $icid
  36. */
  37. public function getInvoiceCMByIcid($icid=0){
  38. $lsit=array();
  39. if (! empty ( $icid ))
  40. $lsit = $this->getOne ( array (
  41. 'where' => 'icid='.$icid,
  42. 'asArray' => TRUE
  43. ) );
  44. return $lsit;
  45. }
  46. /**
  47. * 是否有该用户在权限列表中
  48. * @param number $sid
  49. */
  50. public function getInvoiceCMByStaff($sid = 0) {
  51. $lsit=array();
  52. if (! empty ( $sid ))
  53. $lsit = $this->find ( array (
  54. 'select'=>'cid',
  55. 'where' => 'staff like "%[\"' . $sid . '\",%"',
  56. 'asArray' => TRUE
  57. ) );
  58. return $lsit;
  59. }
  60. /**
  61. * 根据cid获得审批组
  62. * @param string $cidMode
  63. */
  64. public function getStaffManageByCid($cidMode = '') {
  65. $detail = array ();
  66. if (! empty ( $cidMode ))
  67. $detail = $this->getOne ( array (
  68. 'where' => 'cid ="' . $cidMode . '" ',
  69. 'asArray' => true
  70. ) );
  71. if (empty ( $detail ['staff'] ))
  72. $detail ['staffList'] = array ();
  73. else
  74. $detail ['staffList'] = json_decode ( $detail ['staff'], true );
  75. return $detail;
  76. }
  77. }
  78. // ?>