invoiceOperationLog.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?php
  2. Doo::loadCore ( 'db/DooModel' );
  3. /**
  4. * 开票操作日志 业务逻辑
  5. *
  6. * @author CP.
  7. * @version 1.0
  8. * @namespace invoice
  9. * @package invoiceModel
  10. */
  11. class invoiceOperationLog extends DooModel {
  12. /**
  13. *
  14. * @var integer $lid 操作日志ID
  15. *
  16. */
  17. public $lid;
  18. /**
  19. *
  20. * @var string $username 操作员相关:名称,头像
  21. * @var string $img 操作员相关:名称,头像
  22. */
  23. public $username, $img;
  24. /**
  25. *
  26. * @var integer $uid 用户ID
  27. */
  28. public $uid;
  29. /**
  30. * 操作时间
  31. *
  32. * @var datetime
  33. */
  34. public $date;
  35. /**
  36. * 操作动作
  37. *
  38. * @var string
  39. */
  40. public $operation;
  41. /**
  42. * 开票ID
  43. *
  44. * @var integer
  45. */
  46. public $iid;
  47. /**
  48. * 发票操作时的状态
  49. *
  50. * @var integer
  51. */
  52. public $status;
  53. /**
  54. * 表名
  55. *
  56. * @var string
  57. */
  58. public $_table = 'CLD_invoiceOperationLog';
  59. /**
  60. * 表主键
  61. *
  62. * @var string
  63. */
  64. public $_primarykey = 'lid';
  65. /**
  66. * 表字段
  67. *
  68. * @var array
  69. */
  70. public $_fields = array (
  71. 'lid',
  72. 'username',
  73. 'uid',
  74. 'date',
  75. 'operation',
  76. 'img',
  77. 'iid',
  78. 'status'
  79. );
  80. public function __construct() {
  81. parent::setupModel ( __CLASS__ );
  82. }
  83. /**
  84. * 添加相关开票操作日志
  85. *
  86. * @param array $item 要记录的相关发票操作数据
  87. *
  88. * @return integer|0 返回操作ID
  89. */
  90. public function setInvoiceOperationLog($item = array()) {
  91. $lid = 0;
  92. if (is_array ( $item ) && ! empty ( $item )) {
  93. foreach ( $item as $key => $value ) {
  94. $this->$key = $value;
  95. }
  96. $lid = $this->insert ();
  97. }
  98. return $lid;
  99. }
  100. }
  101. ?>