xxxrrrdddd пре 3 година
родитељ
комит
59a7416d79

+ 1 - 1
addons/yexam/service/Exam.php

@@ -152,7 +152,7 @@ class Exam
             $endtime = $examUser['endtime'];
         }
 
-        return $endtime;
+        return compact('endtime','examInfo');
     }
 
     /**

+ 7 - 1
application/admin/model/user/Id.php

@@ -2,6 +2,7 @@
 
 namespace app\admin\model\user;
 
+use app\common\model\User;
 use think\Model;
 
 
@@ -44,5 +45,10 @@ class Id extends Model
         return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
     }
 
-
+    protected static function init()
+    {
+        self::afterDelete(function (self $id){
+            User::where('user_id',$id['id'])->update(['user_id'=>null]);
+        });
+    }
 }

+ 1 - 1
application/admin/view/yexam/exam/add.html

@@ -97,7 +97,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">是否开启会员验证:</label>
         <div class="col-xs-12 col-sm-8">
-            {:build_radios('row[user_check]', ['1'=>__('Yes'), '0'=>__('No')])}
+            {:build_radios('row[check]', ['1'=>__('Yes'), '0'=>__('No')],0)}
         </div>
     </div>
 

+ 1 - 1
application/admin/view/yexam/exam/edit.html

@@ -94,7 +94,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">是否开启会员验证:</label>
         <div class="col-xs-12 col-sm-8">
-            {:build_radios('row[user_check]', ['1'=>__('Yes'), '0'=>__('No')])}
+            {:build_radios('row[check]', ['1'=>__('Yes'), '0'=>__('No')],$row['check'])}
         </div>
     </div>
 

+ 25 - 0
application/api/controller/User.php

@@ -2,6 +2,7 @@
 
 namespace app\api\controller;
 
+use app\admin\model\user\Id;
 use app\admin\model\yexam\Third;
 use app\api\library\Mp;
 use app\common\controller\Api;
@@ -351,4 +352,28 @@ class User extends Api
             $this->error($this->auth->getError());
         }
     }
+
+    /**
+     * 验证用户信息
+     * @ApiParams (name="name",description="姓名")
+     * @ApiParams (name="id_no",description="身份证号码")
+     */
+    public function verify_id(){
+        $data=input();
+        $user=$this->auth->getUser();
+        if($user['user_id']){
+            $this->success();
+        }
+        $this->validate($data,[
+            'name'=>['require'],
+            'id_no'=>['require'],
+        ]);
+        $id=Id::where('name',$data['name'])->where('id_no',$data['id_no'])->find();
+        if(!$id){
+            $this->error('认证失败');
+        }
+        $user['user_id']=$id['id'];
+        $user->save();
+        $this->success();
+    }
 }

+ 1 - 1
application/api/controller/yexam/Exam.php

@@ -159,7 +159,7 @@ class Exam extends Api
         $exam = new \addons\yexam\service\Exam();
         $result = $exam->begin($exam_id,$this->auth->id);
         if($result){
-            $this->success('请求成功',['endtime'=>$result]);
+            $this->success('请求成功',$result);
         }else{
             $this->success($exam->error,[
                 'joined'=>$exam->num,

Разлика између датотеке није приказан због своје велике величине
+ 225 - 193
public/api.html


Неке датотеке нису приказане због велике количине промена