| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\api\controller;
- use app\common\controller\Api;
- use think\Db;
- /**
- * 首页接口
- */
- class Index extends Api
- {
- protected $noNeedLogin = ['*'];
- protected $noNeedRight = ['*'];
- /**
- * 首页
- *
- */
- public function index()
- {
- $this->success('请求成功');
- }
- public function getConfiguration()
- {
- $name = $this->request->post('name');
- $website = $this->request->post('website');
- $where['name']=$name;
- $where['website']=$website;
- $where['status']='normal';
- $list = Db::name('functional')->where($where)->find();
- unset($where);
- $where['fid']=$list['id'];
- $where['status']='normal';
- $domain2 = $this->request->domain();
- if($list['image']){
- $list['image']=$domain2.$list['image'];
- }
- if($list['image_m']){
- $list['image_m']=$domain2.$list['image_m'];
- }
- $list['details']=Db::name('functional_del')->where($where)->select();
- foreach ($list['details'] as $k=>$v){
- if($v['image']){
- $list['details'][$k]['image']=$domain2.$v['image'];
- }
- if($v['image_m']){
- $list['details'][$k]['image_m']=$domain2.$v['image_m'];
- }
- }
- $this->success('请求成功',$list);
- }
- }
|