作者 刘朕
1 个管道 的构建 失败 耗费 22 秒

新增用户仅可查看一个视频播放功能逻辑

@@ -19,7 +19,7 @@ class Set extends Backend @@ -19,7 +19,7 @@ class Set extends Backend
19 */ 19 */
20 protected $model = null; 20 protected $model = null;
21 // 允许批量修改字段 21 // 允许批量修改字段
22 - protected $multiFields = 'switch,fast_switch,status'; 22 + protected $multiFields = 'switch,fast_switch,status,only_switch';
23 23
24 public function _initialize() 24 public function _initialize()
25 { 25 {
@@ -4,5 +4,6 @@ return [ @@ -4,5 +4,6 @@ return [
4 'Id' => 'id', 4 'Id' => 'id',
5 'Stopnum' => '多久暂停一次', 5 'Stopnum' => '多久暂停一次',
6 'Switch' => '是否开启', 6 'Switch' => '是否开启',
  7 + 'Only_switch'=> '用户是否仅可查看一个视频开关',
7 'Createtime' => '创建时间' 8 'Createtime' => '创建时间'
8 ]; 9 ];
@@ -31,5 +31,6 @@ return [ @@ -31,5 +31,6 @@ return [
31 'Status' => '状态', 31 'Status' => '状态',
32 'Study_id' => '考试科目id', 32 'Study_id' => '考试科目id',
33 'Periodtime' => '考试有效期', 33 'Periodtime' => '考试有效期',
  34 + 'View_status' => '是否正在观看视频',
34 'Leave password blank if dont want to change' => '不修改密码请留空', 35 'Leave password blank if dont want to change' => '不修改密码请留空',
35 ]; 36 ];
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 2
3 namespace app\api\controller; 3 namespace app\api\controller;
4 4
  5 +use app\admin\model\Set;
5 use app\common\controller\Api; 6 use app\common\controller\Api;
6 use function fast\e; 7 use function fast\e;
7 use think\Cache; 8 use think\Cache;
@@ -29,6 +30,8 @@ class User extends Api @@ -29,6 +30,8 @@ class User extends Api
29 { 30 {
30 protected $noNeedLogin = ['video_list']; 31 protected $noNeedLogin = ['video_list'];
31 protected $noNeedRight = ['*']; 32 protected $noNeedRight = ['*'];
  33 + // 允许批量修改字段
  34 + protected $multiFields = 'view_status';
32 35
33 /** 36 /**
34 * @ApiTitle (我的资料) 37 * @ApiTitle (我的资料)
@@ -284,6 +287,11 @@ class User extends Api @@ -284,6 +287,11 @@ class User extends Api
284 }else{ 287 }else{
285 $third_study['periodtime'] < time() && $this->error('学习期限已过,无法观看视频'); 288 $third_study['periodtime'] < time() && $this->error('学习期限已过,无法观看视频');
286 } 289 }
  290 + // 判断用户查看视频状态
  291 + $admin_option = Set::get(1);
  292 + if($admin_option['only_switch'] == 1 && $this->auth->view_status == 1) {
  293 + $this->error('当前用户正在观看视频,无法查看其他视频');
  294 + }
287 295
288 //查看播放秒数 296 //查看播放秒数
289 $class_detail = Db::name('class_detail') 297 $class_detail = Db::name('class_detail')
@@ -326,6 +334,59 @@ class User extends Api @@ -326,6 +334,59 @@ class User extends Api
326 } 334 }
327 335
328 /** 336 /**
  337 + * @ApiTitle (记录用户播放状态)
  338 + * @ApiSummary (记录用户播放状态)
  339 + * @ApiMethod (POST)
  340 + * @ApiRoute (/api/user/change_view_status)
  341 + *
  342 + * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
  343 + * @ApiParams (name="view_status", type="int", required=true, description="观看视频状态:0=结束观看,1=开始观看")
  344 + * @ApiParams (name="view_id", type="int", required=true, description="培训课程id")
  345 + *
  346 + * @ApiReturn({
  347 + "code": 1,
  348 + "msg": "成功",
  349 + "time": "1571492001"
  350 + })
  351 + */
  352 + public function change_view_status()
  353 + {
  354 + $user_id = $this->auth->id;
  355 + $view_status = $this->request->param('view_status',0);
  356 + $id = $this->request->param('view_id');
  357 + if(empty($id)){
  358 + $this->error('缺少必要参数');
  359 + }
  360 + $user_info = Db::name('user')->where('id',$user_id)->find();
  361 + if(empty($user_info['image'])){
  362 + $this->error('请先完善个人头像信息');
  363 + }
  364 + $data = Db::name('classes')
  365 + ->alias('a')
  366 + ->join('study b','a.study_id = b.id')
  367 + ->where('a.id',$id)
  368 + ->field('a.*,b.expirationtime')
  369 + ->find();
  370 + // 查看用户是否有权限
  371 + $third_study = Db::name('third_study')->where('third_id',$user_id)->where('study_id',$data['study_id'])->find();
  372 + if(empty($third_study)){
  373 + $this->error('您没有该场考试的权限,无法观看视频');
  374 + }else{
  375 + $third_study['periodtime'] < time() && $this->error('学习期限已过,无法观看视频');
  376 + }
  377 + $user_update = [
  378 + 'view_status' => $view_status,
  379 + 'view_id' => $view_status == 1 ? $id : 0
  380 + ];
  381 + if($view_status == 0 || $id != $this->auth->view_id) {
  382 + // 修改用户观看视频状态
  383 + $res = \app\common\model\User::update($user_update,['id'=>$user_id]);
  384 + if(!$res) $this->error('修改失败');
  385 + }
  386 + $this->success('修改成功');
  387 + }
  388 +
  389 + /**
329 * @ApiTitle (记录播放时间) 390 * @ApiTitle (记录播放时间)
330 * @ApiSummary (记录播放时间) 391 * @ApiSummary (记录播放时间)
331 * @ApiMethod (POST) 392 * @ApiMethod (POST)
@@ -26,7 +26,7 @@ class Auth @@ -26,7 +26,7 @@ class Auth
26 //默认配置 26 //默认配置
27 protected $config = []; 27 protected $config = [];
28 protected $options = []; 28 protected $options = [];
29 - protected $allowFields = ['id', 'username', 'nickname', 'mobile', 'avatar', 'score']; 29 + protected $allowFields = ['id', 'username', 'nickname', 'mobile', 'avatar', 'score', 'view_status', 'view_id'];
30 30
31 public function __construct($options = []) 31 public function __construct($options = [])
32 { 32 {
@@ -306,6 +306,7 @@ class Auth @@ -306,6 +306,7 @@ class Auth
306 $this->_user = $user; 306 $this->_user = $user;
307 307
308 $this->_token = Random::uuid(); 308 $this->_token = Random::uuid();
  309 + Token::clear($user->id);
309 Token::set($this->_token, $user->id, $this->keeptime); 310 Token::set($this->_token, $user->id, $this->keeptime);
310 311
311 $this->_logined = true; 312 $this->_logined = true;
@@ -208,13 +208,14 @@ @@ -208,13 +208,14 @@
208 <a href="javascript:;" data-id="50" class="list-group-item">修改我的资料</a> 208 <a href="javascript:;" data-id="50" class="list-group-item">修改我的资料</a>
209 <a href="javascript:;" data-id="51" class="list-group-item">培训课程列表</a> 209 <a href="javascript:;" data-id="51" class="list-group-item">培训课程列表</a>
210 <a href="javascript:;" data-id="52" class="list-group-item">培训课程详情</a> 210 <a href="javascript:;" data-id="52" class="list-group-item">培训课程详情</a>
211 - <a href="javascript:;" data-id="53" class="list-group-item">记录播放时间</a>  
212 - <a href="javascript:;" data-id="54" class="list-group-item">加入学习计划</a>  
213 - <a href="javascript:;" data-id="55" class="list-group-item">加入学习计划-批量</a>  
214 - <a href="javascript:;" data-id="56" class="list-group-item">移除学习计划</a>  
215 - <a href="javascript:;" data-id="57" class="list-group-item">我的考试</a>  
216 - <a href="javascript:;" data-id="58" class="list-group-item">查看证书</a>  
217 - <a href="javascript:;" data-id="59" class="list-group-item"></a> 211 + <a href="javascript:;" data-id="53" class="list-group-item">记录用户播放状态</a>
  212 + <a href="javascript:;" data-id="54" class="list-group-item">记录播放时间</a>
  213 + <a href="javascript:;" data-id="55" class="list-group-item">加入学习计划</a>
  214 + <a href="javascript:;" data-id="56" class="list-group-item">加入学习计划-批量</a>
  215 + <a href="javascript:;" data-id="57" class="list-group-item">移除学习计划</a>
  216 + <a href="javascript:;" data-id="58" class="list-group-item">我的考试</a>
  217 + <a href="javascript:;" data-id="59" class="list-group-item">查看证书</a>
  218 + <a href="javascript:;" data-id="60" class="list-group-item"></a>
218 </div> 219 </div>
219 </div> 220 </div>
220 </div> 221 </div>
@@ -7063,7 +7064,7 @@ @@ -7063,7 +7064,7 @@
7063 <div class="panel-heading" id="heading-53"> 7064 <div class="panel-heading" id="heading-53">
7064 <h4 class="panel-title"> 7065 <h4 class="panel-title">
7065 <span class="label label-primary">POST</span> 7066 <span class="label label-primary">POST</span>
7066 - <a data-toggle="collapse" data-parent="#accordion53" href="#collapseOne53"> 记录播放时间 <span class="text-muted">/api/user/bofang</span></a> 7067 + <a data-toggle="collapse" data-parent="#accordion53" href="#collapseOne53"> 记录用户播放状态 <span class="text-muted">/api/user/change_view_status</span></a>
7067 </h4> 7068 </h4>
7068 </div> 7069 </div>
7069 <div id="collapseOne53" class="panel-collapse collapse"> 7070 <div id="collapseOne53" class="panel-collapse collapse">
@@ -7081,7 +7082,7 @@ @@ -7081,7 +7082,7 @@
7081 7082
7082 <div class="tab-pane active" id="info53"> 7083 <div class="tab-pane active" id="info53">
7083 <div class="well"> 7084 <div class="well">
7084 - 记录播放时间 </div> 7085 + 记录用户播放状态 </div>
7085 <div class="panel panel-default"> 7086 <div class="panel panel-default">
7086 <div class="panel-heading"><strong>Headers</strong></div> 7087 <div class="panel-heading"><strong>Headers</strong></div>
7087 <div class="panel-body"> 7088 <div class="panel-body">
@@ -7119,16 +7120,16 @@ @@ -7119,16 +7120,16 @@
7119 </thead> 7120 </thead>
7120 <tbody> 7121 <tbody>
7121 <tr> 7122 <tr>
7122 - <td>id</td> 7123 + <td>view_status</td>
7123 <td>int</td> 7124 <td>int</td>
7124 <td></td> 7125 <td></td>
7125 - <td>培训课程id</td> 7126 + <td>观看视频状态:0=结束观看,1=开始观看</td>
7126 </tr> 7127 </tr>
7127 <tr> 7128 <tr>
7128 - <td>duration</td> 7129 + <td>view_id</td>
7129 <td>int</td> 7130 <td>int</td>
7130 <td></td> 7131 <td></td>
7131 - <td>播放时间</td> 7132 + <td>培训课程id</td>
7132 </tr> 7133 </tr>
7133 </tbody> 7134 </tbody>
7134 </table> 7135 </table>
@@ -7158,14 +7159,14 @@ @@ -7158,14 +7159,14 @@
7158 <div class="panel panel-default"> 7159 <div class="panel panel-default">
7159 <div class="panel-heading"><strong>参数</strong></div> 7160 <div class="panel-heading"><strong>参数</strong></div>
7160 <div class="panel-body"> 7161 <div class="panel-body">
7161 - <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/bofang" method="POST" name="form53" id="form53"> 7162 + <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/change_view_status" method="POST" name="form53" id="form53">
7162 <div class="form-group"> 7163 <div class="form-group">
7163 - <label class="control-label" for="id">id</label>  
7164 - <input type="int" class="form-control input-sm" id="id" required placeholder="培训课程id" name="id"> 7164 + <label class="control-label" for="view_status">view_status</label>
  7165 + <input type="int" class="form-control input-sm" id="view_status" required placeholder="观看视频状态:0=结束观看,1=开始观看" name="view_status">
7165 </div> 7166 </div>
7166 <div class="form-group"> 7167 <div class="form-group">
7167 - <label class="control-label" for="duration">duration</label>  
7168 - <input type="int" class="form-control input-sm" id="duration" required placeholder="播放时间" name="duration"> 7168 + <label class="control-label" for="view_id">view_id</label>
  7169 + <input type="int" class="form-control input-sm" id="view_id" required placeholder="培训课程id" name="view_id">
7169 </div> 7170 </div>
7170 <div class="form-group"> 7171 <div class="form-group">
7171 <button type="submit" class="btn btn-success send" rel="53">提交</button> 7172 <button type="submit" class="btn btn-success send" rel="53">提交</button>
@@ -7201,9 +7202,7 @@ @@ -7201,9 +7202,7 @@
7201 <pre id="sample_response53">{ 7202 <pre id="sample_response53">{
7202 "code": 1, 7203 "code": 1,
7203 "msg": "成功", 7204 "msg": "成功",
7204 - "time": "1571492001",  
7205 - "data": {  
7206 - } 7205 + "time": "1571492001"
7207 }</pre> 7206 }</pre>
7208 </div> 7207 </div>
7209 </div> 7208 </div>
@@ -7217,7 +7216,7 @@ @@ -7217,7 +7216,7 @@
7217 <div class="panel-heading" id="heading-54"> 7216 <div class="panel-heading" id="heading-54">
7218 <h4 class="panel-title"> 7217 <h4 class="panel-title">
7219 <span class="label label-primary">POST</span> 7218 <span class="label label-primary">POST</span>
7220 - <a data-toggle="collapse" data-parent="#accordion54" href="#collapseOne54"> 加入学习计划 <span class="text-muted">/api/user/join</span></a> 7219 + <a data-toggle="collapse" data-parent="#accordion54" href="#collapseOne54"> 记录播放时间 <span class="text-muted">/api/user/bofang</span></a>
7221 </h4> 7220 </h4>
7222 </div> 7221 </div>
7223 <div id="collapseOne54" class="panel-collapse collapse"> 7222 <div id="collapseOne54" class="panel-collapse collapse">
@@ -7235,7 +7234,7 @@ @@ -7235,7 +7234,7 @@
7235 7234
7236 <div class="tab-pane active" id="info54"> 7235 <div class="tab-pane active" id="info54">
7237 <div class="well"> 7236 <div class="well">
7238 - 加入学习计划 </div> 7237 + 记录播放时间 </div>
7239 <div class="panel panel-default"> 7238 <div class="panel panel-default">
7240 <div class="panel-heading"><strong>Headers</strong></div> 7239 <div class="panel-heading"><strong>Headers</strong></div>
7241 <div class="panel-body"> 7240 <div class="panel-body">
@@ -7278,6 +7277,12 @@ @@ -7278,6 +7277,12 @@
7278 <td></td> 7277 <td></td>
7279 <td>培训课程id</td> 7278 <td>培训课程id</td>
7280 </tr> 7279 </tr>
  7280 + <tr>
  7281 + <td>duration</td>
  7282 + <td>int</td>
  7283 + <td></td>
  7284 + <td>播放时间</td>
  7285 + </tr>
7281 </tbody> 7286 </tbody>
7282 </table> 7287 </table>
7283 </div> 7288 </div>
@@ -7306,12 +7311,16 @@ @@ -7306,12 +7311,16 @@
7306 <div class="panel panel-default"> 7311 <div class="panel panel-default">
7307 <div class="panel-heading"><strong>参数</strong></div> 7312 <div class="panel-heading"><strong>参数</strong></div>
7308 <div class="panel-body"> 7313 <div class="panel-body">
7309 - <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/join" method="POST" name="form54" id="form54"> 7314 + <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/bofang" method="POST" name="form54" id="form54">
7310 <div class="form-group"> 7315 <div class="form-group">
7311 <label class="control-label" for="id">id</label> 7316 <label class="control-label" for="id">id</label>
7312 <input type="int" class="form-control input-sm" id="id" required placeholder="培训课程id" name="id"> 7317 <input type="int" class="form-control input-sm" id="id" required placeholder="培训课程id" name="id">
7313 </div> 7318 </div>
7314 <div class="form-group"> 7319 <div class="form-group">
  7320 + <label class="control-label" for="duration">duration</label>
  7321 + <input type="int" class="form-control input-sm" id="duration" required placeholder="播放时间" name="duration">
  7322 + </div>
  7323 + <div class="form-group">
7315 <button type="submit" class="btn btn-success send" rel="54">提交</button> 7324 <button type="submit" class="btn btn-success send" rel="54">提交</button>
7316 <button type="reset" class="btn btn-info" rel="54">重置</button> 7325 <button type="reset" class="btn btn-info" rel="54">重置</button>
7317 </div> 7326 </div>
@@ -7361,7 +7370,7 @@ @@ -7361,7 +7370,7 @@
7361 <div class="panel-heading" id="heading-55"> 7370 <div class="panel-heading" id="heading-55">
7362 <h4 class="panel-title"> 7371 <h4 class="panel-title">
7363 <span class="label label-primary">POST</span> 7372 <span class="label label-primary">POST</span>
7364 - <a data-toggle="collapse" data-parent="#accordion55" href="#collapseOne55"> 加入学习计划-批量 <span class="text-muted">/api/user/joinBatch</span></a> 7373 + <a data-toggle="collapse" data-parent="#accordion55" href="#collapseOne55"> 加入学习计划 <span class="text-muted">/api/user/join</span></a>
7365 </h4> 7374 </h4>
7366 </div> 7375 </div>
7367 <div id="collapseOne55" class="panel-collapse collapse"> 7376 <div id="collapseOne55" class="panel-collapse collapse">
@@ -7379,7 +7388,7 @@ @@ -7379,7 +7388,7 @@
7379 7388
7380 <div class="tab-pane active" id="info55"> 7389 <div class="tab-pane active" id="info55">
7381 <div class="well"> 7390 <div class="well">
7382 - 加入学习计划-批量 </div> 7391 + 加入学习计划 </div>
7383 <div class="panel panel-default"> 7392 <div class="panel panel-default">
7384 <div class="panel-heading"><strong>Headers</strong></div> 7393 <div class="panel-heading"><strong>Headers</strong></div>
7385 <div class="panel-body"> 7394 <div class="panel-body">
@@ -7417,10 +7426,10 @@ @@ -7417,10 +7426,10 @@
7417 </thead> 7426 </thead>
7418 <tbody> 7427 <tbody>
7419 <tr> 7428 <tr>
7420 - <td>ids</td>  
7421 - <td>string</td> 7429 + <td>id</td>
  7430 + <td>int</td>
7422 <td></td> 7431 <td></td>
7423 - <td>培训课程id集合(多个id用英文逗号隔开)</td> 7432 + <td>培训课程id</td>
7424 </tr> 7433 </tr>
7425 </tbody> 7434 </tbody>
7426 </table> 7435 </table>
@@ -7450,10 +7459,10 @@ @@ -7450,10 +7459,10 @@
7450 <div class="panel panel-default"> 7459 <div class="panel panel-default">
7451 <div class="panel-heading"><strong>参数</strong></div> 7460 <div class="panel-heading"><strong>参数</strong></div>
7452 <div class="panel-body"> 7461 <div class="panel-body">
7453 - <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/joinBatch" method="POST" name="form55" id="form55"> 7462 + <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/join" method="POST" name="form55" id="form55">
7454 <div class="form-group"> 7463 <div class="form-group">
7455 - <label class="control-label" for="ids">ids</label>  
7456 - <input type="string" class="form-control input-sm" id="ids" required placeholder="培训课程id集合(多个id用英文逗号隔开)" name="ids"> 7464 + <label class="control-label" for="id">id</label>
  7465 + <input type="int" class="form-control input-sm" id="id" required placeholder="培训课程id" name="id">
7457 </div> 7466 </div>
7458 <div class="form-group"> 7467 <div class="form-group">
7459 <button type="submit" class="btn btn-success send" rel="55">提交</button> 7468 <button type="submit" class="btn btn-success send" rel="55">提交</button>
@@ -7487,10 +7496,11 @@ @@ -7487,10 +7496,11 @@
7487 <div class="row"> 7496 <div class="row">
7488 <div class="col-md-12"> 7497 <div class="col-md-12">
7489 <pre id="sample_response55">{ 7498 <pre id="sample_response55">{
7490 - "code": 1,  
7491 - "msg": "成功",  
7492 - "time": "1571492001",  
7493 - "data": null 7499 + "code": 1,
  7500 + "msg": "成功",
  7501 + "time": "1571492001",
  7502 + "data": {
  7503 + }
7494 }</pre> 7504 }</pre>
7495 </div> 7505 </div>
7496 </div> 7506 </div>
@@ -7504,7 +7514,7 @@ @@ -7504,7 +7514,7 @@
7504 <div class="panel-heading" id="heading-56"> 7514 <div class="panel-heading" id="heading-56">
7505 <h4 class="panel-title"> 7515 <h4 class="panel-title">
7506 <span class="label label-primary">POST</span> 7516 <span class="label label-primary">POST</span>
7507 - <a data-toggle="collapse" data-parent="#accordion56" href="#collapseOne56"> 移除学习计划 <span class="text-muted">/api/user/del_join</span></a> 7517 + <a data-toggle="collapse" data-parent="#accordion56" href="#collapseOne56"> 加入学习计划-批量 <span class="text-muted">/api/user/joinBatch</span></a>
7508 </h4> 7518 </h4>
7509 </div> 7519 </div>
7510 <div id="collapseOne56" class="panel-collapse collapse"> 7520 <div id="collapseOne56" class="panel-collapse collapse">
@@ -7522,7 +7532,7 @@ @@ -7522,7 +7532,7 @@
7522 7532
7523 <div class="tab-pane active" id="info56"> 7533 <div class="tab-pane active" id="info56">
7524 <div class="well"> 7534 <div class="well">
7525 - 移除学习计划 </div> 7535 + 加入学习计划-批量 </div>
7526 <div class="panel panel-default"> 7536 <div class="panel panel-default">
7527 <div class="panel-heading"><strong>Headers</strong></div> 7537 <div class="panel-heading"><strong>Headers</strong></div>
7528 <div class="panel-body"> 7538 <div class="panel-body">
@@ -7560,10 +7570,10 @@ @@ -7560,10 +7570,10 @@
7560 </thead> 7570 </thead>
7561 <tbody> 7571 <tbody>
7562 <tr> 7572 <tr>
7563 - <td>id</td>  
7564 - <td>int</td> 7573 + <td>ids</td>
  7574 + <td>string</td>
7565 <td></td> 7575 <td></td>
7566 - <td>培训课程id</td> 7576 + <td>培训课程id集合(多个id用英文逗号隔开)</td>
7567 </tr> 7577 </tr>
7568 </tbody> 7578 </tbody>
7569 </table> 7579 </table>
@@ -7593,10 +7603,10 @@ @@ -7593,10 +7603,10 @@
7593 <div class="panel panel-default"> 7603 <div class="panel panel-default">
7594 <div class="panel-heading"><strong>参数</strong></div> 7604 <div class="panel-heading"><strong>参数</strong></div>
7595 <div class="panel-body"> 7605 <div class="panel-body">
7596 - <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/del_join" method="POST" name="form56" id="form56"> 7606 + <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/joinBatch" method="POST" name="form56" id="form56">
7597 <div class="form-group"> 7607 <div class="form-group">
7598 - <label class="control-label" for="id">id</label>  
7599 - <input type="int" class="form-control input-sm" id="id" required placeholder="培训课程id" name="id"> 7608 + <label class="control-label" for="ids">ids</label>
  7609 + <input type="string" class="form-control input-sm" id="ids" required placeholder="培训课程id集合(多个id用英文逗号隔开)" name="ids">
7600 </div> 7610 </div>
7601 <div class="form-group"> 7611 <div class="form-group">
7602 <button type="submit" class="btn btn-success send" rel="56">提交</button> 7612 <button type="submit" class="btn btn-success send" rel="56">提交</button>
@@ -7630,11 +7640,10 @@ @@ -7630,11 +7640,10 @@
7630 <div class="row"> 7640 <div class="row">
7631 <div class="col-md-12"> 7641 <div class="col-md-12">
7632 <pre id="sample_response56">{ 7642 <pre id="sample_response56">{
7633 - "code": 1,  
7634 - "msg": "成功",  
7635 - "time": "1571492001",  
7636 - "data": {  
7637 - } 7643 + "code": 1,
  7644 + "msg": "成功",
  7645 + "time": "1571492001",
  7646 + "data": null
7638 }</pre> 7647 }</pre>
7639 </div> 7648 </div>
7640 </div> 7649 </div>
@@ -7648,7 +7657,7 @@ @@ -7648,7 +7657,7 @@
7648 <div class="panel-heading" id="heading-57"> 7657 <div class="panel-heading" id="heading-57">
7649 <h4 class="panel-title"> 7658 <h4 class="panel-title">
7650 <span class="label label-primary">POST</span> 7659 <span class="label label-primary">POST</span>
7651 - <a data-toggle="collapse" data-parent="#accordion57" href="#collapseOne57"> 我的考试 <span class="text-muted">/api/user/myexam</span></a> 7660 + <a data-toggle="collapse" data-parent="#accordion57" href="#collapseOne57"> 移除学习计划 <span class="text-muted">/api/user/del_join</span></a>
7652 </h4> 7661 </h4>
7653 </div> 7662 </div>
7654 <div id="collapseOne57" class="panel-collapse collapse"> 7663 <div id="collapseOne57" class="panel-collapse collapse">
@@ -7666,7 +7675,7 @@ @@ -7666,7 +7675,7 @@
7666 7675
7667 <div class="tab-pane active" id="info57"> 7676 <div class="tab-pane active" id="info57">
7668 <div class="well"> 7677 <div class="well">
7669 - 我的考试 </div> 7678 + 移除学习计划 </div>
7670 <div class="panel panel-default"> 7679 <div class="panel panel-default">
7671 <div class="panel-heading"><strong>Headers</strong></div> 7680 <div class="panel-heading"><strong>Headers</strong></div>
7672 <div class="panel-body"> 7681 <div class="panel-body">
@@ -7707,7 +7716,7 @@ @@ -7707,7 +7716,7 @@
7707 <td>id</td> 7716 <td>id</td>
7708 <td>int</td> 7717 <td>int</td>
7709 <td></td> 7718 <td></td>
7710 - <td>学习系统id</td> 7719 + <td>培训课程id</td>
7711 </tr> 7720 </tr>
7712 </tbody> 7721 </tbody>
7713 </table> 7722 </table>
@@ -7737,10 +7746,10 @@ @@ -7737,10 +7746,10 @@
7737 <div class="panel panel-default"> 7746 <div class="panel panel-default">
7738 <div class="panel-heading"><strong>参数</strong></div> 7747 <div class="panel-heading"><strong>参数</strong></div>
7739 <div class="panel-body"> 7748 <div class="panel-body">
7740 - <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/myexam" method="POST" name="form57" id="form57"> 7749 + <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/del_join" method="POST" name="form57" id="form57">
7741 <div class="form-group"> 7750 <div class="form-group">
7742 <label class="control-label" for="id">id</label> 7751 <label class="control-label" for="id">id</label>
7743 - <input type="int" class="form-control input-sm" id="id" required placeholder="学习系统id" name="id"> 7752 + <input type="int" class="form-control input-sm" id="id" required placeholder="培训课程id" name="id">
7744 </div> 7753 </div>
7745 <div class="form-group"> 7754 <div class="form-group">
7746 <button type="submit" class="btn btn-success send" rel="57">提交</button> 7755 <button type="submit" class="btn btn-success send" rel="57">提交</button>
@@ -7778,6 +7787,150 @@ @@ -7778,6 +7787,150 @@
7778 "msg": "成功", 7787 "msg": "成功",
7779 "time": "1571492001", 7788 "time": "1571492001",
7780 "data": { 7789 "data": {
  7790 + }
  7791 + }</pre>
  7792 + </div>
  7793 + </div>
  7794 + </div><!-- #sample -->
  7795 +
  7796 + </div><!-- .tab-content -->
  7797 + </div>
  7798 + </div>
  7799 + </div>
  7800 + <div class="panel panel-default">
  7801 + <div class="panel-heading" id="heading-58">
  7802 + <h4 class="panel-title">
  7803 + <span class="label label-primary">POST</span>
  7804 + <a data-toggle="collapse" data-parent="#accordion58" href="#collapseOne58"> 我的考试 <span class="text-muted">/api/user/myexam</span></a>
  7805 + </h4>
  7806 + </div>
  7807 + <div id="collapseOne58" class="panel-collapse collapse">
  7808 + <div class="panel-body">
  7809 +
  7810 + <!-- Nav tabs -->
  7811 + <ul class="nav nav-tabs" id="doctab58">
  7812 + <li class="active"><a href="#info58" data-toggle="tab">基础信息</a></li>
  7813 + <li><a href="#sandbox58" data-toggle="tab">在线测试</a></li>
  7814 + <li><a href="#sample58" data-toggle="tab">返回示例</a></li>
  7815 + </ul>
  7816 +
  7817 + <!-- Tab panes -->
  7818 + <div class="tab-content">
  7819 +
  7820 + <div class="tab-pane active" id="info58">
  7821 + <div class="well">
  7822 + 我的考试 </div>
  7823 + <div class="panel panel-default">
  7824 + <div class="panel-heading"><strong>Headers</strong></div>
  7825 + <div class="panel-body">
  7826 + <table class="table table-hover">
  7827 + <thead>
  7828 + <tr>
  7829 + <th>名称</th>
  7830 + <th>类型</th>
  7831 + <th>必选</th>
  7832 + <th>描述</th>
  7833 + </tr>
  7834 + </thead>
  7835 + <tbody>
  7836 + <tr>
  7837 + <td>token</td>
  7838 + <td>string</td>
  7839 + <td></td>
  7840 + <td>请求的Token</td>
  7841 + </tr>
  7842 + </tbody>
  7843 + </table>
  7844 + </div>
  7845 + </div>
  7846 + <div class="panel panel-default">
  7847 + <div class="panel-heading"><strong>参数</strong></div>
  7848 + <div class="panel-body">
  7849 + <table class="table table-hover">
  7850 + <thead>
  7851 + <tr>
  7852 + <th>名称</th>
  7853 + <th>类型</th>
  7854 + <th>必选</th>
  7855 + <th>描述</th>
  7856 + </tr>
  7857 + </thead>
  7858 + <tbody>
  7859 + <tr>
  7860 + <td>id</td>
  7861 + <td>int</td>
  7862 + <td></td>
  7863 + <td>学习系统id</td>
  7864 + </tr>
  7865 + </tbody>
  7866 + </table>
  7867 + </div>
  7868 + </div>
  7869 + <div class="panel panel-default">
  7870 + <div class="panel-heading"><strong>正文</strong></div>
  7871 + <div class="panel-body">
  7872 +</div>
  7873 + </div>
  7874 + </div><!-- #info -->
  7875 +
  7876 + <div class="tab-pane" id="sandbox58">
  7877 + <div class="row">
  7878 + <div class="col-md-12">
  7879 + <div class="panel panel-default">
  7880 + <div class="panel-heading"><strong>Headers</strong></div>
  7881 + <div class="panel-body">
  7882 + <div class="headers">
  7883 + <div class="form-group">
  7884 + <label class="control-label" for="token">token</label>
  7885 + <input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token">
  7886 + </div>
  7887 + </div>
  7888 + </div>
  7889 + </div>
  7890 + <div class="panel panel-default">
  7891 + <div class="panel-heading"><strong>参数</strong></div>
  7892 + <div class="panel-body">
  7893 + <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/myexam" method="POST" name="form58" id="form58">
  7894 + <div class="form-group">
  7895 + <label class="control-label" for="id">id</label>
  7896 + <input type="int" class="form-control input-sm" id="id" required placeholder="学习系统id" name="id">
  7897 + </div>
  7898 + <div class="form-group">
  7899 + <button type="submit" class="btn btn-success send" rel="58">提交</button>
  7900 + <button type="reset" class="btn btn-info" rel="58">重置</button>
  7901 + </div>
  7902 + </form>
  7903 + </div>
  7904 + </div>
  7905 + <div class="panel panel-default">
  7906 + <div class="panel-heading"><strong>响应输出</strong></div>
  7907 + <div class="panel-body">
  7908 + <div class="row">
  7909 + <div class="col-md-12" style="overflow-x:auto">
  7910 + <pre id="response_headers58"></pre>
  7911 + <pre id="response58"></pre>
  7912 + </div>
  7913 + </div>
  7914 + </div>
  7915 + </div>
  7916 + <div class="panel panel-default">
  7917 + <div class="panel-heading"><strong>返回参数</strong></div>
  7918 + <div class="panel-body">
  7919 +
  7920 + </div>
  7921 + </div>
  7922 + </div>
  7923 + </div>
  7924 + </div><!-- #sandbox -->
  7925 +
  7926 + <div class="tab-pane" id="sample58">
  7927 + <div class="row">
  7928 + <div class="col-md-12">
  7929 + <pre id="sample_response58">{
  7930 + "code": 1,
  7931 + "msg": "成功",
  7932 + "time": "1571492001",
  7933 + "data": {
7781 "exam":[ 7934 "exam":[
7782 "id"://id, 7935 "id"://id,
7783 "examname"://考试名称 7936 "examname"://考试名称
@@ -7810,26 +7963,26 @@ @@ -7810,26 +7963,26 @@
7810 </div> 7963 </div>
7811 </div> 7964 </div>
7812 <div class="panel panel-default"> 7965 <div class="panel panel-default">
7813 - <div class="panel-heading" id="heading-58"> 7966 + <div class="panel-heading" id="heading-59">
7814 <h4 class="panel-title"> 7967 <h4 class="panel-title">
7815 <span class="label label-primary">POST</span> 7968 <span class="label label-primary">POST</span>
7816 - <a data-toggle="collapse" data-parent="#accordion58" href="#collapseOne58"> 查看证书 <span class="text-muted">/api/user/certificate</span></a> 7969 + <a data-toggle="collapse" data-parent="#accordion59" href="#collapseOne59"> 查看证书 <span class="text-muted">/api/user/certificate</span></a>
7817 </h4> 7970 </h4>
7818 </div> 7971 </div>
7819 - <div id="collapseOne58" class="panel-collapse collapse"> 7972 + <div id="collapseOne59" class="panel-collapse collapse">
7820 <div class="panel-body"> 7973 <div class="panel-body">
7821 7974
7822 <!-- Nav tabs --> 7975 <!-- Nav tabs -->
7823 - <ul class="nav nav-tabs" id="doctab58">  
7824 - <li class="active"><a href="#info58" data-toggle="tab">基础信息</a></li>  
7825 - <li><a href="#sandbox58" data-toggle="tab">在线测试</a></li>  
7826 - <li><a href="#sample58" data-toggle="tab">返回示例</a></li> 7976 + <ul class="nav nav-tabs" id="doctab59">
  7977 + <li class="active"><a href="#info59" data-toggle="tab">基础信息</a></li>
  7978 + <li><a href="#sandbox59" data-toggle="tab">在线测试</a></li>
  7979 + <li><a href="#sample59" data-toggle="tab">返回示例</a></li>
7827 </ul> 7980 </ul>
7828 7981
7829 <!-- Tab panes --> 7982 <!-- Tab panes -->
7830 <div class="tab-content"> 7983 <div class="tab-content">
7831 7984
7832 - <div class="tab-pane active" id="info58"> 7985 + <div class="tab-pane active" id="info59">
7833 <div class="well"> 7986 <div class="well">
7834 查看证书 </div> 7987 查看证书 </div>
7835 <div class="panel panel-default"> 7988 <div class="panel panel-default">
@@ -7885,7 +8038,7 @@ @@ -7885,7 +8038,7 @@
7885 </div> 8038 </div>
7886 </div><!-- #info --> 8039 </div><!-- #info -->
7887 8040
7888 - <div class="tab-pane" id="sandbox58"> 8041 + <div class="tab-pane" id="sandbox59">
7889 <div class="row"> 8042 <div class="row">
7890 <div class="col-md-12"> 8043 <div class="col-md-12">
7891 <div class="panel panel-default"> 8044 <div class="panel panel-default">
@@ -7902,14 +8055,14 @@ @@ -7902,14 +8055,14 @@
7902 <div class="panel panel-default"> 8055 <div class="panel panel-default">
7903 <div class="panel-heading"><strong>参数</strong></div> 8056 <div class="panel-heading"><strong>参数</strong></div>
7904 <div class="panel-body"> 8057 <div class="panel-body">
7905 - <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/certificate" method="POST" name="form58" id="form58"> 8058 + <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/certificate" method="POST" name="form59" id="form59">
7906 <div class="form-group"> 8059 <div class="form-group">
7907 <label class="control-label" for="id">id</label> 8060 <label class="control-label" for="id">id</label>
7908 <input type="int" class="form-control input-sm" id="id" required placeholder="考试记录id" name="id"> 8061 <input type="int" class="form-control input-sm" id="id" required placeholder="考试记录id" name="id">
7909 </div> 8062 </div>
7910 <div class="form-group"> 8063 <div class="form-group">
7911 - <button type="submit" class="btn btn-success send" rel="58">提交</button>  
7912 - <button type="reset" class="btn btn-info" rel="58">重置</button> 8064 + <button type="submit" class="btn btn-success send" rel="59">提交</button>
  8065 + <button type="reset" class="btn btn-info" rel="59">重置</button>
7913 </div> 8066 </div>
7914 </form> 8067 </form>
7915 </div> 8068 </div>
@@ -7919,8 +8072,8 @@ @@ -7919,8 +8072,8 @@
7919 <div class="panel-body"> 8072 <div class="panel-body">
7920 <div class="row"> 8073 <div class="row">
7921 <div class="col-md-12" style="overflow-x:auto"> 8074 <div class="col-md-12" style="overflow-x:auto">
7922 - <pre id="response_headers58"></pre>  
7923 - <pre id="response58"></pre> 8075 + <pre id="response_headers59"></pre>
  8076 + <pre id="response59"></pre>
7924 </div> 8077 </div>
7925 </div> 8078 </div>
7926 </div> 8079 </div>
@@ -7935,10 +8088,10 @@ @@ -7935,10 +8088,10 @@
7935 </div> 8088 </div>
7936 </div><!-- #sandbox --> 8089 </div><!-- #sandbox -->
7937 8090
7938 - <div class="tab-pane" id="sample58"> 8091 + <div class="tab-pane" id="sample59">
7939 <div class="row"> 8092 <div class="row">
7940 <div class="col-md-12"> 8093 <div class="col-md-12">
7941 - <pre id="sample_response58">{ 8094 + <pre id="sample_response59">{
7942 "code": 1, 8095 "code": 1,
7943 "msg": "成功", 8096 "msg": "成功",
7944 "time": "1571492001", 8097 "time": "1571492001",
@@ -7956,26 +8109,26 @@ @@ -7956,26 +8109,26 @@
7956 </div> 8109 </div>
7957 </div> 8110 </div>
7958 <div class="panel panel-default"> 8111 <div class="panel panel-default">
7959 - <div class="panel-heading" id="heading-59"> 8112 + <div class="panel-heading" id="heading-60">
7960 <h4 class="panel-title"> 8113 <h4 class="panel-title">
7961 <span class="label label-success">GET</span> 8114 <span class="label label-success">GET</span>
7962 - <a data-toggle="collapse" data-parent="#accordion59" href="#collapseOne59"> <span class="text-muted">/api/user/get_video_first_image</span></a> 8115 + <a data-toggle="collapse" data-parent="#accordion60" href="#collapseOne60"> <span class="text-muted">/api/user/get_video_first_image</span></a>
7963 </h4> 8116 </h4>
7964 </div> 8117 </div>
7965 - <div id="collapseOne59" class="panel-collapse collapse"> 8118 + <div id="collapseOne60" class="panel-collapse collapse">
7966 <div class="panel-body"> 8119 <div class="panel-body">
7967 8120
7968 <!-- Nav tabs --> 8121 <!-- Nav tabs -->
7969 - <ul class="nav nav-tabs" id="doctab59">  
7970 - <li class="active"><a href="#info59" data-toggle="tab">基础信息</a></li>  
7971 - <li><a href="#sandbox59" data-toggle="tab">在线测试</a></li>  
7972 - <li><a href="#sample59" data-toggle="tab">返回示例</a></li> 8122 + <ul class="nav nav-tabs" id="doctab60">
  8123 + <li class="active"><a href="#info60" data-toggle="tab">基础信息</a></li>
  8124 + <li><a href="#sandbox60" data-toggle="tab">在线测试</a></li>
  8125 + <li><a href="#sample60" data-toggle="tab">返回示例</a></li>
7973 </ul> 8126 </ul>
7974 8127
7975 <!-- Tab panes --> 8128 <!-- Tab panes -->
7976 <div class="tab-content"> 8129 <div class="tab-content">
7977 8130
7978 - <div class="tab-pane active" id="info59"> 8131 + <div class="tab-pane active" id="info60">
7979 <div class="well"> 8132 <div class="well">
7980 </div> 8133 </div>
7981 <div class="panel panel-default"> 8134 <div class="panel panel-default">
@@ -7997,19 +8150,19 @@ @@ -7997,19 +8150,19 @@
7997 </div> 8150 </div>
7998 </div><!-- #info --> 8151 </div><!-- #info -->
7999 8152
8000 - <div class="tab-pane" id="sandbox59"> 8153 + <div class="tab-pane" id="sandbox60">
8001 <div class="row"> 8154 <div class="row">
8002 <div class="col-md-12"> 8155 <div class="col-md-12">
8003 <div class="panel panel-default"> 8156 <div class="panel panel-default">
8004 <div class="panel-heading"><strong>参数</strong></div> 8157 <div class="panel-heading"><strong>参数</strong></div>
8005 <div class="panel-body"> 8158 <div class="panel-body">
8006 - <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/get_video_first_image" method="get" name="form59" id="form59"> 8159 + <form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/get_video_first_image" method="get" name="form60" id="form60">
8007 <div class="form-group"> 8160 <div class="form-group">
8008 8161
8009 </div> 8162 </div>
8010 <div class="form-group"> 8163 <div class="form-group">
8011 - <button type="submit" class="btn btn-success send" rel="59">提交</button>  
8012 - <button type="reset" class="btn btn-info" rel="59">重置</button> 8164 + <button type="submit" class="btn btn-success send" rel="60">提交</button>
  8165 + <button type="reset" class="btn btn-info" rel="60">重置</button>
8013 </div> 8166 </div>
8014 </form> 8167 </form>
8015 </div> 8168 </div>
@@ -8019,8 +8172,8 @@ @@ -8019,8 +8172,8 @@
8019 <div class="panel-body"> 8172 <div class="panel-body">
8020 <div class="row"> 8173 <div class="row">
8021 <div class="col-md-12" style="overflow-x:auto"> 8174 <div class="col-md-12" style="overflow-x:auto">
8022 - <pre id="response_headers59"></pre>  
8023 - <pre id="response59"></pre> 8175 + <pre id="response_headers60"></pre>
  8176 + <pre id="response60"></pre>
8024 </div> 8177 </div>
8025 </div> 8178 </div>
8026 </div> 8179 </div>
@@ -8035,10 +8188,10 @@ @@ -8035,10 +8188,10 @@
8035 </div> 8188 </div>
8036 </div><!-- #sandbox --> 8189 </div><!-- #sandbox -->
8037 8190
8038 - <div class="tab-pane" id="sample59"> 8191 + <div class="tab-pane" id="sample60">
8039 <div class="row"> 8192 <div class="row">
8040 <div class="col-md-12"> 8193 <div class="col-md-12">
8041 - <pre id="sample_response59"></pre> 8194 + <pre id="sample_response60"></pre>
8042 </div> 8195 </div>
8043 </div> 8196 </div>
8044 </div><!-- #sample --> 8197 </div><!-- #sample -->
@@ -8053,7 +8206,7 @@ @@ -8053,7 +8206,7 @@
8053 8206
8054 <div class="row mt0 footer"> 8207 <div class="row mt0 footer">
8055 <div class="col-md-6" align="left"> 8208 <div class="col-md-6" align="left">
8056 - Generated on 2021-12-20 16:16:43 </div> 8209 + Generated on 2022-07-20 17:34:05 </div>
8057 <div class="col-md-6" align="right"> 8210 <div class="col-md-6" align="right">
8058 <a href="./" target="_blank">企智帮</a> 8211 <a href="./" target="_blank">企智帮</a>
8059 </div> 8212 </div>
@@ -28,6 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -28,6 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
28 {field: 'stopnum', title: __('多久暂停一次(单位分)')}, 28 {field: 'stopnum', title: __('多久暂停一次(单位分)')},
29 {field: 'switch', title: __('Switch'), table: table, formatter: Table.api.formatter.toggle}, 29 {field: 'switch', title: __('Switch'), table: table, formatter: Table.api.formatter.toggle},
30 {field: 'fast_switch', title: __('快进开关'), table: table, formatter: Table.api.formatter.toggle}, 30 {field: 'fast_switch', title: __('快进开关'), table: table, formatter: Table.api.formatter.toggle},
  31 + {field: 'only_switch', title: __('Only_switch'), table: table, formatter: Table.api.formatter.toggle},
31 {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, 32 {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
32 {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: function (value, row, index) { 33 {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: function (value, row, index) {
33 var that = $.extend({}, this); 34 var that = $.extend({}, this);
@@ -83,6 +83,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -83,6 +83,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
83 {field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {normal: __('Normal'), hidden: __('Hidden')}}, 83 {field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {normal: __('Normal'), hidden: __('Hidden')}},
84 {field: 'mobile', title: __('手机号')}, 84 {field: 'mobile', title: __('手机号')},
85 {field: 'group_id', title: __('角色'), searchList: {"0":"普通用户","1":"企业管理员"},formatter: Table.api.formatter.flag}, 85 {field: 'group_id', title: __('角色'), searchList: {"0":"普通用户","1":"企业管理员"},formatter: Table.api.formatter.flag},
  86 + {field: 'view_status', title: __('View_status'), table: table, formatter: Table.api.formatter.toggle},
86 {field: 'createtime', title: __('注册时间'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, 87 {field: 'createtime', title: __('注册时间'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
87 {field: 'user.mobile_exam_ids', title: __('参加的考试'), operate: 'FIND_IN_SET', searchList: Config.mobileExamList,formatter: Table.api.formatter.flag}, 88 {field: 'user.mobile_exam_ids', title: __('参加的考试'), operate: 'FIND_IN_SET', searchList: Config.mobileExamList,formatter: Table.api.formatter.flag},
88 {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} 89 {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}