invoiceRefund.php 1.6 KB

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