invoice.model.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * 买家发票模型
  4. *
  5. */
  6. defined('InShopNC') or exit('Access Invalid!');
  7. class invoiceModel extends Model {
  8. public function __construct() {
  9. parent::__construct('invoice');
  10. }
  11. /**
  12. * 取得买家默认发票
  13. *
  14. * @param array $condition
  15. */
  16. public function getDefaultInvInfo($condition = array()) {
  17. return $this->where($condition)->order('inv_state asc')->find();
  18. }
  19. /**
  20. * 取得单条发票信息
  21. *
  22. * @param array $condition
  23. */
  24. public function getInvInfo($condition = array()) {
  25. return $this->where($condition)->find();
  26. }
  27. /**
  28. * 取得发票列表
  29. *
  30. * @param unknown_type $condition
  31. * @return unknown
  32. */
  33. public function getInvList($condition, $limit = '', $field = '*') {
  34. return $this->field($field)->where($condition)->limit($limit)->select();
  35. }
  36. /**
  37. * 删除发票信息
  38. *
  39. * @param unknown_type $condition
  40. * @return unknown
  41. */
  42. public function delInv($condition) {
  43. return $this->where($condition)->delete();
  44. }
  45. /**
  46. * 新增发票信息
  47. *
  48. * @param unknown_type $data
  49. * @return unknown
  50. */
  51. public function addInv($data) {
  52. return $this->insert($data);
  53. }
  54. }