Index.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <?php
  2. namespace app\api\controller;
  3. use app\api\model\Chanpin;
  4. use app\api\model\HomeImages;
  5. use app\common\controller\Api;
  6. use app\common\model\Config;
  7. /**
  8. * 首页接口
  9. */
  10. class Index extends Api
  11. {
  12. protected $noNeedLogin = ['*'];
  13. protected $noNeedRight = ['*'];
  14. /**
  15. * 首页
  16. *
  17. */
  18. public function index()
  19. {
  20. $this->success('请求成功');
  21. }
  22. /**
  23. * 轮播图
  24. *
  25. */
  26. public function images(){
  27. $home_images=new HomeImages();
  28. $get_list=$home_images->where('address',1)->with('product')->where('status','1')->order('weigh desc,id desc')->select();
  29. $this->result('获取成功', $get_list, 1);
  30. }
  31. /**
  32. * 首页弹窗
  33. *
  34. */
  35. public function images_tan(){
  36. $home_images=new HomeImages();
  37. $get_list=$home_images->where('address',2)->with('product')->where('status','1')->order('weigh desc,id desc')->find();
  38. $this->result('获取成功', $get_list, 1);
  39. }
  40. /**
  41. * 商品推荐图
  42. *
  43. */
  44. public function images_pro(){
  45. $home_images=new HomeImages();
  46. $get_list=$home_images->where('address',3)->with('product')->where('status','1')->order('weigh desc,id desc')->limit('4')->select();
  47. $this->result('获取成功', $get_list, 1);
  48. }
  49. /**
  50. * 商品推荐图
  51. *
  52. */
  53. public function images_h5(){
  54. $home_images=new HomeImages();
  55. $get_list=$home_images->where('address',4)->where('status','1')->field('image')->order('weigh desc,id desc')->select();
  56. $this->result('获取成功', $get_list, 1);
  57. }
  58. /**
  59. * 关于我们
  60. *
  61. */
  62. public function aboutus(){
  63. $home_images=new Config();
  64. $get_list=$home_images->where('name','aboutus')->field('value')->find();
  65. $this->result('获取成功', $get_list, 1);
  66. }
  67. /**
  68. * 报告中心
  69. *
  70. */
  71. public function product_list(){
  72. $chanpin=new Chanpin();
  73. $get_list=$chanpin->where('status','1')->order('id desc')->select();
  74. $this->result('获取成功', $get_list, 1);
  75. }
  76. /**
  77. * g购物车须知
  78. *
  79. */
  80. public function car_info(){
  81. $home_images=new Config();
  82. $get_list=$home_images->where('name','car_info')->field('value')->find();
  83. $this->result('获取成功', $get_list, 1);
  84. }
  85. /**
  86. * g购物车须知
  87. *
  88. */
  89. public function is_show_index(){
  90. $array=[];
  91. $array['0']['name']='二手车';
  92. $array['0']['img']='/static/images/icon_buycar@2x.png';
  93. $array['0']['is_show']=1;
  94. $array['0']['url']='/pages/shop/old_car';
  95. $array['1']['name']='我要卖车';
  96. $array['1']['img']='/static/images/icon_carsale@2x.png';
  97. $array['1']['is_show']=1;
  98. $array['1']['url']='./sell';
  99. $array['2']['name']='维保查询';//打开需要改分类数据库----
  100. $array['2']['img']='/static/images/icon_insure@2x.png';
  101. $array['2']['is_show']=1;
  102. $array['2']['url']='/pages/mine/weibao';
  103. $array['3']['name']='车辆检测';
  104. $array['3']['img']='/static/images/icon_seektopurchase@2x.png';
  105. $array['3']['is_show']=1;
  106. $array['3']['url']='/pages/index/jiance';
  107. $array['4']['name']='商家入驻';
  108. $array['4']['img']='/static/images/icon_businesssettlement@2x.png';
  109. $array['4']['is_show']=1;
  110. $array['4']['url']='./intoshop';
  111. $array['5']['name']='车抵贷款';
  112. $array['5']['img']='/static/images/icon_mortgage@2x.png';
  113. $array['5']['is_show']=1;
  114. $array['5']['url']='./loan';
  115. $array['6']['name']='新车';
  116. $array['6']['img']='/static/images/icon_newcar@2x.png';
  117. $array['6']['is_show']=1;
  118. $array['6']['url']='/pages/shop/new_car';
  119. $array['7']['name']='汽车分期';
  120. $array['7']['img']='/static/images/icon_bystages@2x.png';
  121. $array['7']['is_show']=1;
  122. $array['7']['url']='../mine/jisuanqi';
  123. $array['8']['name']='商城';
  124. $array['8']['img']='/static/images/icon_automobile@2x.png';
  125. $array['8']['is_show']=1;
  126. $array['8']['url']='/pages/mine/shop';
  127. $array['9']['name']='购车需知';
  128. $array['9']['img']='/static/images/icon_carpurchasepoints@2x.png';
  129. $array['9']['is_show']=1;
  130. $array['9']['url']='./xuzhi';
  131. $this->result('获取成功', $array, 1);
  132. }
  133. /**
  134. * g购物车须知
  135. *
  136. */
  137. public function is_pay(){
  138. $array=['is_show'=>1,'is_show_shop'=>1,'is_show_article'=>1];
  139. $this->result('是否支付,店铺是否开启', $array, 1);
  140. }
  141. }