瀏覽代碼

根据设计图调整接口

lizhen_gitee 5 月之前
父節點
當前提交
d162be0f90

+ 1 - 1
addons/alioss/config.php

@@ -120,7 +120,7 @@ return [
         'title' => '最大可上传',
         'type' => 'string',
         'content' => [],
-        'value' => '500M',
+        'value' => '1000M',
         'rule' => 'required',
         'msg' => '',
         'tip' => '',

+ 15 - 3
application/api/controller/Player.php

@@ -102,6 +102,10 @@ class Player extends Api
         //今日投票次数,自增一次
         RedisUtil::getInstance(RedisKeyEnum::VOTE_RECORD.date('Y-m-d').':'.$this->auth->id)->incr_expire(86400);
 
+
+        //剩余票数,
+        $check_rs['uservote'] - 1;
+
         $this->success('投票成功');
     }
 
@@ -111,6 +115,7 @@ class Player extends Api
             'status'=>true,
             'code'=>1,
             'msg'=>'',
+            'uservote' => 0,
         );
 
 
@@ -126,7 +131,8 @@ class Player extends Api
         if($today_record >= $gift_votes + $exam_times){
             $result['status'] = false;
             $result['code'] = 0;
-            $result['msg'] = '今天的票已经用光了,明天再来吧';
+            $result['msg'] = '投票失败,您今日剩余投票次数: 0次,明天再来吧';
+            $result['uservote'] = 0;
             return $result;
         }
 
@@ -138,7 +144,8 @@ class Player extends Api
         if($today_record >= $gift_votes + $question_vote){
             $result['status'] = false;
             $result['code'] = 0;
-            $result['msg'] = '今天的票已经用光了,明天再来吧';
+            $result['msg'] = '投票失败,您今日剩余投票次数: 0次,明天再来吧';
+            $result['uservote'] = 0;
 
             //今天,用户答题的次数
 //            $today_question = Db::name('user_question_log')->where('createdate',strtotime(date('Y-m-d')))->where('user_id',$uid)->count();
@@ -146,13 +153,18 @@ class Player extends Api
 
             //还有答题机会
             if($exam_times > $today_question){
+                $result['status'] = false;
                 $result['code'] = 2;
-                $result['msg'] = '票已经用光了,去答题获得票?';
+                $result['msg'] = '投票失败,您今日剩余投票次数: 0次,可通过答题增加票数';
+                $result['uservote'] = 0;
             }
 
             return $result;
         }
 
+        //剩余票数
+        $result['uservote'] = $gift_votes + $question_vote - $today_record;
+
 
         return $result;
     }

+ 22 - 1
application/api/controller/Subject.php

@@ -26,7 +26,7 @@ class Subject extends Api
         $this->success(1,$find);
     }
 
-    //选手列表
+    //作品页,选手列表
     public function playerlist(){
         $subject_id = 1;
 
@@ -72,6 +72,27 @@ class Subject extends Api
         $this->success(1,$lists);
     }
 
+    //选手详情
+    public function playerinfo(){
+        $player_id = input('player_id','');
+        if(!$player_id){
+            $this->error();
+        }
+
+        $map = [
+            'player_id' => $player_id,
+        ];
+
+        $info = Db::name('vote_player')->where($map)->find();
+
+        $info['video_thumb'] = '';
+        if(!empty($info['video_file'])){
+            $info['video_thumb'] = $info['video_file'].'?x-oss-process=video/snapshot,t_0,m_fast,f_jpg';
+        }
+
+        $this->success(1,$info);
+    }
+
     //选手票数排行榜,按票
     public function playerlist_votes(){
         $subject_id = 1;

+ 1 - 1
application/extra/upload.php

@@ -17,7 +17,7 @@ return [
     /**
      * 最大可上传大小
      */
-    'maxsize'   => '200mb',
+    'maxsize'   => '1000mb',
     /**
      * 可上传的文件类型
      */