invoiceManage.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 invoiceManage extends DooModel {
  11. /**
  12. *
  13. * @var integer $iid 管理组ID
  14. */
  15. public $iid;
  16. /**
  17. *
  18. * @var string $staff 管理组人员
  19. */
  20. public $staff;
  21. /**
  22. *
  23. * @var string $mold 管理组名称
  24. */
  25. public $mold;
  26. public $_table = 'CLD_invoiceManage';
  27. public $_primarykey = 'iid';
  28. public $_fields = array (
  29. 'iid',
  30. 'staff',
  31. 'mold'
  32. );
  33. /**
  34. * 根据管理组获取审批组成员
  35. * @return array|array() 该管理组相关数据,人员数据数组化
  36. */
  37. public function getInvoiceByMold($mold = "") {
  38. $detail = array ();
  39. if (! empty ( $mold )) {
  40. $detail = $this->getOne ( array (
  41. 'where' => 'mold="' . $mold . '"',
  42. 'asArray' => TRUE
  43. ) );
  44. $detail ['staffList'] = json_decode ( $detail ['staff'], true );
  45. }
  46. return $detail;
  47. }
  48. public function getInvoiceByStaff($sid = 0) {
  49. $lsit=array();
  50. if (! empty ( $sid ))
  51. $lsit = $this->find ( array (
  52. 'select'=>'mold',
  53. 'where' => 'staff like "%[\"' . $sid . '\",%"',
  54. 'asArray' => TRUE
  55. ) );
  56. return $lsit;
  57. }
  58. /**
  59. * 获取所有管理组数据
  60. * @return array|array() 该管理组相关数据,人员数据数组化
  61. */
  62. public function getInvoiceByAll() {
  63. $lsit = $this->find ( array (
  64. 'asArray' => TRUE
  65. ) );
  66. foreach ( $lsit as $key => $value ) {
  67. $lsit [$key] ['staffList'] = json_decode ( $value ['staff'], true );
  68. }
  69. return $lsit;
  70. }
  71. }
  72. // ?>