bill.model.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * 结算模型
  4. *
  5. */
  6. defined('InShopNC') or exit('Access Invalid!');
  7. //以下是定义结算单状态
  8. //默认
  9. define('BILL_STATE_CREATE',1);
  10. //店铺已确认
  11. define('BILL_STATE_STORE_COFIRM',2);
  12. //平台已审核
  13. define('BILL_STATE_SYSTEM_CHECK',3);
  14. //结算完成
  15. define('BILL_STATE_SUCCESS',4);
  16. class billModel extends Model {
  17. /**
  18. * 取得平台月结算单
  19. * @param unknown $condition
  20. * @param unknown $fields
  21. * @param unknown $pagesize
  22. * @param unknown $order
  23. * @param unknown $limit
  24. */
  25. public function getOrderStatisList($condition = array(), $fields = '*', $pagesize = null, $order = '', $limit = null) {
  26. return $this->table('order_statis')->where($condition)->field($fields)->order($order)->page($pagesize)->limit($limit)->select();
  27. }
  28. /**
  29. * 取得平台月结算单条信息
  30. * @param unknown $condition
  31. * @param string $fields
  32. */
  33. public function getOrderStatisInfo($condition = array(), $fields = '*',$order = null) {
  34. return $this->table('order_statis')->where($condition)->field($fields)->order($order)->find();
  35. }
  36. /**
  37. * 取得店铺月结算单列表
  38. * @param unknown $condition
  39. * @param string $fields
  40. * @param string $pagesize
  41. * @param string $order
  42. * @param string $limit
  43. */
  44. public function getOrderBillList($condition = array(), $fields = '*', $pagesize = null, $order = '', $limit = null) {
  45. return $this->table('order_bill')->where($condition)->field($fields)->order($order)->limit($limit)->page($pagesize)->select();
  46. }
  47. /**
  48. * 取得店铺月结算单单条
  49. * @param unknown $condition
  50. * @param string $fields
  51. */
  52. public function getOrderBillInfo($condition = array(), $fields = '*') {
  53. return $this->table('order_bill')->where($condition)->field($fields)->find();
  54. }
  55. /**
  56. * 取得订单数量
  57. * @param unknown $condition
  58. */
  59. public function getOrderBillCount($condition) {
  60. return $this->table('order_bill')->where($condition)->count();
  61. }
  62. public function addOrderStatis($data) {
  63. return $this->table('order_statis')->insert($data);
  64. }
  65. public function addOrderBill($data) {
  66. return $this->table('order_bill')->insert($data);
  67. }
  68. public function editOrderBill($data, $condition = array()) {
  69. return $this->table('order_bill')->where($condition)->update($data);
  70. }
  71. }