Index.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use think\Db;
  5. /**
  6. * 首页接口
  7. */
  8. class Index extends Api
  9. {
  10. protected $noNeedLogin = ['*'];
  11. protected $noNeedRight = ['*'];
  12. /**
  13. * 首页
  14. *
  15. */
  16. public function index()
  17. {
  18. $this->success('请求成功');
  19. }
  20. public function getConfiguration()
  21. {
  22. $name = $this->request->post('name');
  23. $website = $this->request->post('website');
  24. $where['name']=$name;
  25. $where['website']=$website;
  26. $where['status']='normal';
  27. $list = Db::name('functional')->where($where)->find();
  28. unset($where);
  29. $where['fid']=$list['id'];
  30. $where['status']='normal';
  31. $domain2 = $this->request->domain();
  32. if($list['image']){
  33. $list['image']=$domain2.$list['image'];
  34. }
  35. $list['details']=Db::name('functional_del')->where($where)->select();
  36. foreach ($list['details'] as $k=>$v){
  37. if($v['image']){
  38. $list['details'][$k]['image']=$domain2.$v['image'];
  39. }
  40. }
  41. $this->success('请求成功',$list);
  42. }
  43. }