Browse Source

接口复制

lizhen_gitee 3 months ago
parent
commit
1925e6d414
1 changed files with 14 additions and 1 deletions
  1. 14 1
      application/api/controller/Index.php

+ 14 - 1
application/api/controller/Index.php

@@ -9,9 +9,22 @@ use think\Db;
  */
 class Index extends Api
 {
-    protected $noNeedLogin = [];
+    protected $noNeedLogin = ['info'];
     protected $noNeedRight = ['*'];
 
+
+    //进行中的唯一一个投票活动
+    public function info(){
+
+        $find = Db::name('vote_subject')->where('id',1)->find();
+        if(!$find){
+            $this->error('没有进行中的投票活动');
+        }
+        $find = info_domain_image($find,['image','paihang_image']);
+
+        $this->success(1,$find);
+    }
+
     //结束后的首页
     public function index(){