invoiceManage.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. /**
  49. * 获取所有管理组数据
  50. * @return array|array() 该管理组相关数据,人员数据数组化
  51. */
  52. public function getInvoiceByAll(){
  53. $lsit=$this->find(array (
  54. 'asArray' => TRUE
  55. ));
  56. foreach ($lsit as $key=>$value){
  57. $lsit[$key]['staffList']=json_decode ( $value ['staff'],true );
  58. }
  59. return $lsit;
  60. }
  61. }
  62. // ?>