lizhen_gitee 3 months ago
parent
commit
bd1ad2194c
1 changed files with 8 additions and 2 deletions
  1. 8 2
      application/api/controller/Index.php

+ 8 - 2
application/api/controller/Index.php

@@ -52,8 +52,14 @@ class Index extends Api
 
         $exam_user_top = Db::name('exam_user_top')->where('user_id',$this->auth->id)->order('id asc')->find();
         if(!empty($exam_user_top) && !empty($exam_user_top['info'])){
-            $zhongjiang['zhongjiang_status'] = 1;
-            $zhongjiang['user_kami'] = $exam_user_top['info'];
+
+            if($exam_user_top['status'] == 0){
+                $update = [
+                    'status'  => 1,
+                    'gettime' => time(),
+                ];
+                Db::name('exam_user_top')->where('id',$exam_user_top['id'])->update($update);
+            }
         }
 
         $this->success('领取成功');