HomeServiceController.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\api\controller;
  3. use app\api\lists\HomeServiceLists;
  4. use app\api\lists\HomeSpecialLists;
  5. use app\api\logic\HomeSpecialLogic;
  6. use app\common\model\home_service\HomeSpecial;
  7. class HomeServiceController extends BaseApiController
  8. {
  9. public array $notNeedLogin = ['lists','specialHot','specialLists'];
  10. public function lists()
  11. {
  12. return $this->dataLists(new HomeServiceLists());
  13. }
  14. public function specialHot()
  15. {
  16. //活动专题页:special_type = 0
  17. $result['special_type_0'] = [
  18. 'title'=>'活动专题',
  19. 'special_type'=>0,
  20. 'status'=>1,
  21. 'data'=>HomeSpecialLogic::getLists(['special_type'=>0,'status'=>1],6)
  22. ];
  23. //热销服务:special_type = 1
  24. $result['special_type_1'] = [
  25. 'title'=>'热销服务',
  26. 'special_type'=>1,
  27. 'status'=>1,
  28. 'data'=>HomeSpecialLogic::getLists(['special_type'=>1,'status'=>1],6)
  29. ];
  30. //当季精选:special_type = 2
  31. $result['special_type_2'] = [
  32. 'title'=>'当季精选',
  33. 'special_type'=>2,
  34. 'status'=>1,
  35. 'data'=>HomeSpecialLogic::getLists(['special_type'=>2,'status'=>1],6)
  36. ];
  37. return $this->data($result);
  38. }
  39. public function specialLists()
  40. {
  41. return $this->dataLists(new HomeSpecialLists());
  42. }
  43. }