GoodsSku.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +---------------------------------------------------------------------+
  3. // | NiuCloud | [ WE CAN DO IT JUST NiuCloud ]  |
  4. // +---------------------------------------------------------------------+
  5. // | Copy right 2019-2029 www.niucloud.com  |
  6. // +---------------------------------------------------------------------+
  7. // | Author | NiuCloud <niucloud@outlook.com>  |
  8. // +---------------------------------------------------------------------+
  9. // | Repository | https://github.com/niucloud/framework.git  |
  10. // +---------------------------------------------------------------------+
  11. namespace addon\replacebuy\model;
  12. use app\model\BaseModel;
  13. class GoodsSku extends BaseModel
  14. {
  15. /**
  16. * 获取商品分页列表
  17. * @param array $condition
  18. * @param number $page
  19. * @param string $page_size
  20. * @param string $order
  21. * @param string $field
  22. */
  23. public function getGoodsSkuPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = 'gs.create_time desc', $field = '*')
  24. {
  25. $alias = 'gs';
  26. $join = [
  27. [
  28. 'goods g',
  29. 'g.goods_id = gs.goods_id',
  30. 'inner'
  31. ]
  32. ];
  33. $field = 'gs.*';
  34. $list = model('goods_sku')->pageList($condition, $field, $order, $page, $page_size, $alias, $join);
  35. return $this->success($list);
  36. }
  37. }