xhPictureCategoryService.php 810 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace common\services;
  3. use common\models\xhPicture;
  4. use common\models\xhPictureCategory;
  5. use Yii;
  6. use common\models\xhOrder;
  7. use common\components\stringUtil;
  8. use common\components\dict;
  9. class xhPictureCategoryService {
  10. public static function showCategory($sjId)
  11. {
  12. $data = xhPictureCategory::find()->where(['sjId'=>$sjId])->asArray()->all();
  13. return $data;
  14. }
  15. /**
  16. * 获取学员相关的分类
  17. * @author ssh
  18. * @time 2019.3.17
  19. */
  20. public static function getStudent($sjId)
  21. {
  22. $data = self::showCategory($sjId);
  23. if(!empty($data)){
  24. foreach($data as $key => $info){
  25. if($info['type'] != 0){
  26. unset($data[$key]);
  27. }
  28. }
  29. }
  30. return $data;
  31. }
  32. }