PresaleOrder.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com
  8. * =========================================================
  9. */
  10. namespace addon\presale\model;
  11. use app\model\BaseModel;
  12. /**
  13. * 商品预售
  14. */
  15. class PresaleOrder extends BaseModel
  16. {
  17. /**
  18. * 获取预售订单信息
  19. * @param array $condition
  20. * @param string $field
  21. * @return array
  22. */
  23. public function getPresaleOrderInfo($condition = [], $field = '*')
  24. {
  25. $info = model('promotion_presale_order')->getInfo($condition, $field);
  26. return $this->success($info);
  27. }
  28. /**
  29. * 获取预售订单分页列表
  30. * @param array $condition
  31. * @param int $page
  32. * @param int $page_size
  33. * @param string $order
  34. * @param string $field
  35. * @return array
  36. */
  37. public function getPresaleOrderPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = 'id desc', $field = '*')
  38. {
  39. $join = [
  40. [ 'member m', 'ppo.member_id = m.member_id', 'left' ]
  41. ];
  42. $field = 'ppo.*,m.nickname';
  43. $list = model('promotion_presale_order')->pageList($condition, $field, $order, $page, $page_size, 'ppo', $join);
  44. return $this->success($list);
  45. }
  46. }