Store.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2019-2029 上海牛之云网络科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
  9. * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
  10. * =========================================================
  11. */
  12. namespace addon\store\api\controller;
  13. use addon\store\model\Label;
  14. use app\api\controller\BaseApi;
  15. class Store extends BaseApi
  16. {
  17. /**
  18. * 门店标签
  19. * @return false|string
  20. */
  21. public function labelPage()
  22. {
  23. $label_id_arr = isset($this->params[ 'label_id_arr' ]) ? $this->params[ 'label_id_arr' ] : ''; // 门店标签id集合
  24. $page = isset($this->params[ 'page' ]) ? $this->params[ 'page' ] : 1;
  25. $page_size = isset($this->params[ 'page_size' ]) ? $this->params[ 'page_size' ] : PAGE_LIST_ROWS;
  26. $condition = [
  27. [ 'site_id', '=', $this->site_id ]
  28. ];
  29. if (!empty($label_id_arr)) {
  30. $condition[] = [ 'label_id', 'in', $label_id_arr ];
  31. }
  32. $label_model = new Label();
  33. $res = $label_model->getStoreLabelPageList($condition, $page, $page_size, 'sort asc,label_id desc', 'label_id,label_name');
  34. return $this->response($res);
  35. }
  36. }