|
@@ -16,7 +16,7 @@ use think\Validate; |
|
@@ -16,7 +16,7 @@ use think\Validate; |
16
|
*/
|
16
|
*/
|
17
|
class Lists extends Api
|
17
|
class Lists extends Api
|
18
|
{
|
18
|
{
|
19
|
- protected $noNeedLogin = ['get_list','type_title','type_list','ke_list','index','policy','download','index_info','policy_info','video_list','video_detail','study','password_login','find_pwd','ke_list_detail','getcode','verify'];
|
19
|
+ protected $noNeedLogin = ['get_list','type_title','type_list','ke_list','index','policy','download','index_info','policy_info','download_info','video_list','video_detail','study','password_login','find_pwd','ke_list_detail','getcode','verify'];
|
20
|
protected $noNeedRight = ['*'];
|
20
|
protected $noNeedRight = ['*'];
|
21
|
|
21
|
|
22
|
/**
|
22
|
/**
|
|
@@ -375,6 +375,58 @@ class Lists extends Api |
|
@@ -375,6 +375,58 @@ class Lists extends Api |
375
|
}
|
375
|
}
|
376
|
|
376
|
|
377
|
/**
|
377
|
/**
|
|
|
378
|
+ * @ApiTitle (下载专区详情)
|
|
|
379
|
+ * @ApiSummary (下载专区详情)
|
|
|
380
|
+ * @ApiMethod (POST)
|
|
|
381
|
+ * @ApiRoute (/api/lists/download_info)
|
|
|
382
|
+ *
|
|
|
383
|
+ * @ApiParams (name="id", type="int", required=true, description="下载专区ID")
|
|
|
384
|
+ *
|
|
|
385
|
+ * @ApiReturn({
|
|
|
386
|
+ "code": 1,
|
|
|
387
|
+ "msg": "成功",
|
|
|
388
|
+ "time": "1571492001",
|
|
|
389
|
+ "data": {
|
|
|
390
|
+ "id"://ID
|
|
|
391
|
+ "title"://标题
|
|
|
392
|
+ "from"://转载于
|
|
|
393
|
+ "content"://内容详情
|
|
|
394
|
+ "file_name"://附件名称
|
|
|
395
|
+ "file"://附件
|
|
|
396
|
+ "is_up"://是否上架0否1是
|
|
|
397
|
+ "createtime"://创建时间
|
|
|
398
|
+ }
|
|
|
399
|
+ })
|
|
|
400
|
+ */
|
|
|
401
|
+ public function download_info()
|
|
|
402
|
+ {
|
|
|
403
|
+ $qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
404
|
+ $id = $this->request->param('id');
|
|
|
405
|
+ if(empty($id)){
|
|
|
406
|
+ $this->error('缺少必要参数');
|
|
|
407
|
+ }
|
|
|
408
|
+ $data = Db::name('download')
|
|
|
409
|
+ ->where('id',$id)
|
|
|
410
|
+ ->field('updatetime',true)
|
|
|
411
|
+ ->find();
|
|
|
412
|
+ if(!empty($data['file'])){
|
|
|
413
|
+ $base_url = $data['file'];
|
|
|
414
|
+ $qiniu_url = $qiniu.$data['file'];
|
|
|
415
|
+ $a = file_get_contents($qiniu_url);
|
|
|
416
|
+ $path = './uploads/'.explode('/',$base_url)[2].'/';
|
|
|
417
|
+ if(!file_exists($path)) {
|
|
|
418
|
+ mkdir($path,0777,true);
|
|
|
419
|
+ }
|
|
|
420
|
+ file_put_contents('.'.$base_url,$a);
|
|
|
421
|
+ $data['file'] = request()->domain().$base_url;
|
|
|
422
|
+ }else{
|
|
|
423
|
+ $data['file'] = '';
|
|
|
424
|
+ }
|
|
|
425
|
+ $data['createtime'] = date('Y-m-d H:i:s',$data['createtime']);
|
|
|
426
|
+ $this->success('success',$data);
|
|
|
427
|
+ }
|
|
|
428
|
+
|
|
|
429
|
+ /**
|
378
|
* @ApiTitle (优选课程列表)
|
430
|
* @ApiTitle (优选课程列表)
|
379
|
* @ApiSummary (优选课程列表)
|
431
|
* @ApiSummary (优选课程列表)
|
380
|
* @ApiMethod (POST)
|
432
|
* @ApiMethod (POST)
|