invoiceRefund.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 invoiceRefund extends DooModel {
  11. public $ireid;
  12. public $irid;
  13. public $refundType;
  14. public $refundCompany;
  15. public $refundNumber;
  16. public $refundPrice;
  17. public $refundLog;
  18. public $date;
  19. public $_table = 'CLD_invoiceRefund';
  20. public $_primarykey = 'ireid';
  21. public $_fields = array (
  22. 'ireid',
  23. 'irid',
  24. 'refundType',
  25. 'refundCompany',
  26. 'refundNumber',
  27. 'refundPrice',
  28. 'refundLog',
  29. 'date'
  30. );
  31. /**
  32. * 根据irid获得退款信息
  33. */
  34. public function getInvoiceRefundIrid($irid=0){
  35. if (empty($irid))
  36. return array();
  37. return $list = $this->find ( array (
  38. 'where' => 'irid='.$irid,
  39. 'asArray' => TRUE
  40. ));
  41. }
  42. /**
  43. * 添加一个发票并进入审批状态
  44. * @param array $item 发票相关数据
  45. * @return number 返回发票ID
  46. */
  47. public function addInvoiceRefund($item = array()) {
  48. $lid = 0;
  49. if (is_array ( $item ) && ! empty ( $item )) {
  50. foreach ( $item as $key => $value ) {
  51. $this->$key = $value;
  52. }
  53. $lid = $this->insert ();
  54. }
  55. return $lid;
  56. }
  57. /**
  58. * 根据参数字段更新相应字段(主键ID必须传)
  59. * @param array $item 相关需要更新的字段信息
  60. * @return number 返回发票ID
  61. */
  62. public function setInvoicePaperByCondition($item = array()) {
  63. $lid = 0;
  64. if (is_array ( $item ) && ! empty ( $item )) {
  65. foreach ( $item as $key => $value ) {
  66. $this->$key = $value;
  67. }
  68. $lid = $this->update ();
  69. }
  70. return $lid;
  71. }
  72. }
  73. ?>