课程:
diff --git a/app/Http/Home/Views/templates/layer.volt b/app/Http/Home/Views/templates/layer.volt
index 45b9c517..76533493 100644
--- a/app/Http/Home/Views/templates/layer.volt
+++ b/app/Http/Home/Views/templates/layer.volt
@@ -5,7 +5,7 @@
-
即时通讯
+
酷瓜云课堂
{{ icon_link('favicon.ico') }}
{{ css_link('lib/layui/css/layui.css') }}
{{ css_link('home/css/common.css') }}
diff --git a/app/Services/Logic/Chapter/BasicInfo.php b/app/Services/Logic/Chapter/BasicInfo.php
index f86ddc86..50e7b66a 100644
--- a/app/Services/Logic/Chapter/BasicInfo.php
+++ b/app/Services/Logic/Chapter/BasicInfo.php
@@ -71,6 +71,7 @@ class BasicInfo extends Service
'summary' => $chapter->summary,
'model' => $chapter->model,
'play_urls' => $playUrls,
+ 'resource_count' => $chapter->resource_count,
'user_count' => $chapter->user_count,
'like_count' => $chapter->like_count,
];
@@ -97,6 +98,7 @@ class BasicInfo extends Service
'start_time' => $live->start_time,
'end_time' => $live->end_time,
'status' => $live->status,
+ 'resource_count' => $chapter->resource_count,
'user_count' => $chapter->user_count,
'like_count' => $chapter->like_count,
];
@@ -114,6 +116,7 @@ class BasicInfo extends Service
'summary' => $chapter->summary,
'model' => $chapter->model,
'content' => $read->content,
+ 'resource_count' => $chapter->resource_count,
'user_count' => $chapter->user_count,
'like_count' => $chapter->like_count,
];
diff --git a/app/Services/Logic/Chapter/ResourceList.php b/app/Services/Logic/Chapter/ResourceList.php
new file mode 100644
index 00000000..6ace34eb
--- /dev/null
+++ b/app/Services/Logic/Chapter/ResourceList.php
@@ -0,0 +1,34 @@
+checkChapter($id);
+
+ $resourceRepo = new ResourceRepo();
+
+ $resources = $resourceRepo->findByChapterId($chapter->id);
+
+ if ($resources->count() == 0) {
+ return [];
+ }
+
+ $builder = new ResourceListBuilder();
+
+ $relations = $resources->toArray();
+
+ return $builder->getUploads($relations);
+ }
+
+}
diff --git a/bootstrap/HttpErrorHandler.php b/bootstrap/HttpErrorHandler.php
index d88b1bc0..d49d22a5 100644
--- a/bootstrap/HttpErrorHandler.php
+++ b/bootstrap/HttpErrorHandler.php
@@ -71,13 +71,7 @@ class HttpErrorHandler extends Component
*/
protected function report($e)
{
- $config = $this->getConfig();
-
- if ($config->get('env') == ENV_DEV) {
- $content = $e->getTraceAsString();
- } else {
- $content = sprintf('%s(%d): %s', $e->getFile(), $e->getLine(), $e->getMessage());
- }
+ $content = sprintf('%s(%d): %s', $e->getFile(), $e->getLine(), $e->getMessage());
$logger = $this->getLogger();
diff --git a/public/static/home/css/common.css b/public/static/home/css/common.css
index 9cd749e6..a78ec345 100644
--- a/public/static/home/css/common.css
+++ b/public/static/home/css/common.css
@@ -1500,14 +1500,15 @@
}
.consult-info .item {
- clear: both;
margin-bottom: 15px;
+ line-height: 1.5em;
+ height: 1.5em;
+ clear: both;
}
.consult-info .item .label {
float: left;
width: 50px;
- height: 32px;
text-align: right;
}
diff --git a/public/static/home/js/chapter.action.js b/public/static/home/js/chapter.action.js
index 6058ad3e..f5a2ee60 100644
--- a/public/static/home/js/chapter.action.js
+++ b/public/static/home/js/chapter.action.js
@@ -47,4 +47,19 @@ layui.use(['jquery', 'helper'], function () {
});
});
+ /**
+ * 资料
+ */
+ $('.icon-resource').on('click', function () {
+ var url = $(this).parent().data('url');
+ helper.checkLogin(function () {
+ layer.open({
+ type: 2,
+ title: '资料下载',
+ content: [url, 'no'],
+ area: ['640px', '300px']
+ });
+ });
+ });
+
});
\ No newline at end of file