PtItemCatRelateClass.php 966 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace biz\item\classes;
  3. use biz\base\classes\BaseClass;
  4. use common\components\imgUtil;
  5. class PtItemCatRelateClass extends BaseClass
  6. {
  7. public static $baseFile = '\biz\item\models\PtItemCatRelate';
  8. public static function getItemList($where)
  9. {
  10. $data = self::getList('*', $where, 'inTurn DESC');
  11. $list = $data['list'];
  12. if (!empty($list)) {
  13. $ids = array_column($list, 'itemId');
  14. $list = PtItemClass::getAllByCondition(['id' => ['in', $ids]], 'inTurn DESC', '*');
  15. if (!empty($list)) {
  16. foreach ($list as $key => $val) {
  17. $shortCover = $val['cover'] ?? '';
  18. $list[$key]['shortCover'] = $shortCover;
  19. $list[$key]['cover'] = imgUtil::groupImg($shortCover) . "?x-oss-process=image/resize,m_fill,h_700,w_700";
  20. }
  21. }
  22. $data['list'] = $list;
  23. }
  24. return $data;
  25. }
  26. }