promoteManage.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 promoteManage 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_promoteManage';
  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 (!is_numeric($sid)){
  53. Doo::loadClass ( 'XDeode' );
  54. $XDeode = new XDeode ( 5 );
  55. $sid = $XDeode->decode ( $sid );
  56. }
  57. if (! empty ( $sid ))
  58. $lsit = $this->find ( array (
  59. 'select' => 'cid',
  60. 'where' => 'staff like "%[\"' . $sid . '\",%"',
  61. 'asArray' => TRUE
  62. ) );
  63. return $lsit;
  64. }
  65. /**
  66. * 根据cid获得审批组
  67. * @param string $cidMode
  68. */
  69. public function getStaffManageByCid($cidMode = '') {
  70. $detail = array ();
  71. if (! empty ( $cidMode ))
  72. $detail = $this->getOne ( array (
  73. 'where' => 'cid ="' . $cidMode . '" ',
  74. 'asArray' => true
  75. ) );
  76. if (empty ( $detail ['staff'] ))
  77. $detail ['staffList'] = array ();
  78. else
  79. $detail ['staffList'] = json_decode ( $detail ['staff'], true );
  80. return $detail;
  81. }
  82. }
  83. // ?>