diff --git a/app/Http/Admin/Services/Stat.php b/app/Http/Admin/Services/Stat.php
index afb3cd0b..51868a37 100644
--- a/app/Http/Admin/Services/Stat.php
+++ b/app/Http/Admin/Services/Stat.php
@@ -23,11 +23,11 @@ class Stat extends Service
return [
[
- 'title' => "{$year}-{$month}",
+ 'title' => sprintf('%02d-%02d', $year, $month),
'sales' => $this->handleHotSales($type, $year, $month),
],
[
- 'title' => "{$prev['year']}-{$prev['month']}",
+ 'title' => sprintf('%02d-%02d', $prev['year'], $prev['month']),
'sales' => $this->handleHotSales($type, $prev['year'], $prev['month']),
],
];
@@ -42,12 +42,13 @@ class Stat extends Service
$currSales = $this->handleSales($year, $month);
$prevSales = $this->handleSales($prev['year'], $prev['month']);
+ $currMonth = sprintf('%02d-%02d', $year, $month);
+ $prevMonth = sprintf('%02d-%02d', $prev['year'], $prev['month']);
+
$items = [];
foreach (range(1, 31) as $day) {
$date = sprintf('%02d', $day);
- $prevMonth = "{$prev['year']}-{$prev['month']}";
- $currMonth = "{$year}-{$month}";
$items[] = [
'date' => $date,
$currMonth => $currSales[$date] ?? 0,
@@ -67,12 +68,13 @@ class Stat extends Service
$currRefunds = $this->handleRefunds($year, $month);
$prevRefunds = $this->handleRefunds($prev['year'], $prev['month']);
+ $currMonth = sprintf('%02d-%02d', $year, $month);
+ $prevMonth = sprintf('%02d-%02d', $prev['year'], $prev['month']);
+
$items = [];
foreach (range(1, 31) as $day) {
$date = sprintf('%02d', $day);
- $prevMonth = "{$prev['year']}-{$prev['month']}";
- $currMonth = "{$year}-{$month}";
$items[] = [
'date' => $date,
$currMonth => $currRefunds[$date] ?? 0,
@@ -92,12 +94,13 @@ class Stat extends Service
$currUsers = $this->handleRegisteredUsers($year, $month);
$prevUsers = $this->handleRegisteredUsers($prev['year'], $prev['month']);
+ $currMonth = sprintf('%02d-%02d', $year, $month);
+ $prevMonth = sprintf('%02d-%02d', $prev['year'], $prev['month']);
+
$items = [];
foreach (range(1, 31) as $day) {
$date = sprintf('%02d', $day);
- $prevMonth = "{$prev['year']}-{$prev['month']}";
- $currMonth = "{$year}-{$month}";
$items[] = [
'date' => $date,
$currMonth => $currUsers[$date] ?? 0,
@@ -117,12 +120,13 @@ class Stat extends Service
$currUsers = $this->handleOnlineUsers($year, $month);
$prevUsers = $this->handleOnlineUsers($prev['year'], $prev['month']);
+ $currMonth = sprintf('%02d-%02d', $year, $month);
+ $prevMonth = sprintf('%02d-%02d', $prev['year'], $prev['month']);
+
$items = [];
foreach (range(1, 31) as $day) {
$date = sprintf('%02d', $day);
- $prevMonth = "{$prev['year']}-{$prev['month']}";
- $currMonth = "{$year}-{$month}";
$items[] = [
'date' => $date,
$currMonth => $currUsers[$date] ?? 0,
@@ -154,7 +158,10 @@ class Stat extends Service
protected function isCurrMonth($year, $month)
{
- return date('Y-m') == "{$year}-{$month}";
+ $yearOk = date('Y') == $year;
+ $monthOk = date('m') == $month;
+
+ return $yearOk && $monthOk;
}
protected function getLifetime()
diff --git a/app/Http/Admin/Views/audit/list.volt b/app/Http/Admin/Views/audit/list.volt
index b40d81be..1e4029f4 100644
--- a/app/Http/Admin/Views/audit/list.volt
+++ b/app/Http/Admin/Views/audit/list.volt
@@ -34,8 +34,8 @@
用户IP |
请求路由 |
请求路径 |
- 请求时间 |
- 请求内容 |
+ 创建时间 |
+ 操作 |
@@ -91,4 +91,4 @@
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/app/Http/Admin/Views/audit/search.volt b/app/Http/Admin/Views/audit/search.volt
index 7a8ce8c4..10289cdf 100644
--- a/app/Http/Admin/Views/audit/search.volt
+++ b/app/Http/Admin/Views/audit/search.volt
@@ -13,9 +13,9 @@
@@ -31,7 +31,7 @@
-
+
@@ -70,4 +70,4 @@
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/app/Listeners/Trade.php b/app/Listeners/Trade.php
index f49f8ae0..aeae2cdb 100644
--- a/app/Listeners/Trade.php
+++ b/app/Listeners/Trade.php
@@ -44,12 +44,7 @@ class Trade extends Listener
$task = new TaskModel();
- $itemInfo = [
- 'order' => ['id' => $order->id]
- ];
-
$task->item_id = $order->id;
- $task->item_info = $itemInfo;
$task->item_type = TaskModel::TYPE_DELIVER;
$task->create();
@@ -69,4 +64,4 @@ class Trade extends Listener
}
}
-}
\ No newline at end of file
+}
diff --git a/app/Services/Logic/Point/GiftRedeem.php b/app/Services/Logic/Point/GiftRedeem.php
index ff3e257c..79372aff 100644
--- a/app/Services/Logic/Point/GiftRedeem.php
+++ b/app/Services/Logic/Point/GiftRedeem.php
@@ -84,18 +84,8 @@ class GiftRedeem extends LogicService
$task = new TaskModel();
- $itemInfo = [
- 'point_gift_redeem' => [
- 'id' => $redeem->id,
- 'user_id' => $redeem->user_id,
- 'gift_id' => $redeem->gift_id,
- ]
- ];
-
$task->item_id = $redeem->id;
$task->item_type = TaskModel::TYPE_POINT_GIFT_DELIVER;
- $task->item_info = $itemInfo;
-
$result = $task->create();
if ($result === false) {
diff --git a/app/Validators/Chapter.php b/app/Validators/Chapter.php
index 03510a42..80dbad80 100644
--- a/app/Validators/Chapter.php
+++ b/app/Validators/Chapter.php
@@ -183,7 +183,7 @@ class Chapter extends Validator
public function checkPublishStatus($status)
{
if (!in_array($status, [0, 1])) {
- throw new BadRequestException('course.invalid_publish_status');
+ throw new BadRequestException('chapter.invalid_publish_status');
}
return $status;
diff --git a/public/static/home/css/common.css b/public/static/home/css/common.css
index 15a0a743..1d13844f 100644
--- a/public/static/home/css/common.css
+++ b/public/static/home/css/common.css
@@ -78,9 +78,33 @@
height: 100px;
}
+.img-viewer {
+ display: none;
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background: rgba(0, 0, 0, 0.5);
+ z-index: 1000;
+}
+
+.img-viewer img {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ max-width: 90%;
+ max-height: 90%;
+ background-color: white;
+ transform: translate(-50%, -50%);
+ transition: transform 0.3s ease-in-out;
+ padding: 5px;
+ cursor: zoom-out;
+}
+
.kg-zoom img {
max-width: 100%;
- cursor: pointer;
+ cursor: zoom-in;
}
.breadcrumb {
@@ -2245,4 +2269,4 @@
.gift-details {
min-height: 450px;
-}
\ No newline at end of file
+}
diff --git a/public/static/home/css/content.css b/public/static/home/css/content.css
index 481996b0..ea344416 100644
--- a/public/static/home/css/content.css
+++ b/public/static/home/css/content.css
@@ -12,7 +12,6 @@
.ke-content img {
max-width: 100%;
- cursor: pointer;
}
.ke-content a:hover {
@@ -244,4 +243,4 @@
.ke-content pre:hover > span.kg-copy {
display: block;
-}
\ No newline at end of file
+}
diff --git a/public/static/home/js/common.js b/public/static/home/js/common.js
index 6083f45c..6c3452c5 100644
--- a/public/static/home/js/common.js
+++ b/public/static/home/js/common.js
@@ -129,20 +129,15 @@ layui.use(['jquery', 'form', 'element', 'layer', 'helper'], function () {
* 内容图片放大
*/
$('body').on('click', '.kg-zoom img', function () {
- var width = $(window).width() * 0.8 + 'px';
- var height = $(window).height() * 0.8 + 'px';
- var src = $(this).attr('src');
- var style = 'max-width:' + width + ';max-height:' + height;
- var content = '

';
- layer.open({
- type: 1,
- title: false,
- closeBtn: 0,
- area: ['auto'],
- skin: 'layui-layer-nobg',
- shadeClose: true,
- content: content,
- });
+ var src = $(this).attr('src').replace('!content_800', '');
+ if ($('#img-viewer').length === 0) {
+ $('body').append('
');
+ }
+ $('#img-viewer').append('

').fadeIn();
+ });
+
+ $('body').on('click', '#img-viewer', function () {
+ $(this).empty().fadeOut();
});
/**
@@ -195,4 +190,4 @@ layui.use(['jquery', 'form', 'element', 'layer', 'helper'], function () {
});
});
-});
\ No newline at end of file
+});