lizhen_gitee 3 mēneši atpakaļ
vecāks
revīzija
1925e6d414
1 mainītis faili ar 14 papildinājumiem un 1 dzēšanām
  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(){