From 751549190b01357983235e448df6bfc20b7268b0 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Mon, 23 Sep 2024 16:06:00 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E8=AF=A6=E6=83=85=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/BusinessSchoolLogic.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/api/logic/BusinessSchoolLogic.php b/app/api/logic/BusinessSchoolLogic.php index f59a77d6..95106e92 100644 --- a/app/api/logic/BusinessSchoolLogic.php +++ b/app/api/logic/BusinessSchoolLogic.php @@ -5,6 +5,7 @@ namespace app\api\logic; use app\common\basics\Logic; use app\common\model\BusinessSchool; use app\common\model\BusinessSchoolCategory; +use app\common\model\BusinessSchoolFile; class BusinessSchoolLogic extends Logic { @@ -82,6 +83,7 @@ class BusinessSchoolLogic extends Logic $article = []; }else{ $article = $article->toArray(); + $article['file'] = BusinessSchoolFile::where('bsid', $id)->select()->toArray(); } return $article; } From 421771e24d3cdeb5edd965d7e024bc48e4974c48 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Mon, 23 Sep 2024 16:29:58 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=88=90=E5=8A=9F=EF=BC=8C=E4=BD=86=E8=BF=98?= =?UTF-8?q?=E6=98=AF=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/business_school/edit_content.html | 8 +++++--- app/common/model/BusinessSchool.php | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/admin/view/business_school/edit_content.html b/app/admin/view/business_school/edit_content.html index 14797fa7..fc8f633e 100755 --- a/app/admin/view/business_school/edit_content.html +++ b/app/admin/view/business_school/edit_content.html @@ -61,8 +61,7 @@ - -
+
x
@@ -228,9 +227,12 @@ url: '{:url("BusinessSchool/delVideo")}', data: {videoFile}, type: "post", - success: function (res) {} + success: function (res) { + + } }); + $("input[name='video']").val('') $("#upload-video-block").show() $("#video-block").hide() $("#businessSchoolVideo").attr('src', '') diff --git a/app/common/model/BusinessSchool.php b/app/common/model/BusinessSchool.php index 7a9daedd..9f6ec743 100644 --- a/app/common/model/BusinessSchool.php +++ b/app/common/model/BusinessSchool.php @@ -14,6 +14,8 @@ class BusinessSchool extends Models public function getVideoAttr($value) { - return Config::get('aliyunoss.domain') . $value; + if ($value) { + return Config::get('aliyunoss.domain') . $value; + } } } \ No newline at end of file From 43378508784f32a6ae150d41c16d26d5cf7f83bf Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Mon, 23 Sep 2024 16:55:05 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/BusinessSchoolLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/logic/BusinessSchoolLogic.php b/app/api/logic/BusinessSchoolLogic.php index 95106e92..11f83706 100644 --- a/app/api/logic/BusinessSchoolLogic.php +++ b/app/api/logic/BusinessSchoolLogic.php @@ -44,7 +44,7 @@ class BusinessSchoolLogic extends Logic $model = new BusinessSchool(); - $count = $model->alias('a')->join('article_category c', 'c.id = a.cid')->where($where)->count(); + $count = $model->alias('a')->join('business_school_category c', 'c.id = a.cid')->where($where)->count(); $list = $model->alias('a') ->join('business_school_category c', 'c.id = a.cid') From 71c72d0062089e34e813274fb1ca3a54da2a4d38 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Mon, 23 Sep 2024 17:12:21 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/BusinessSchoolLogic.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/api/logic/BusinessSchoolLogic.php b/app/api/logic/BusinessSchoolLogic.php index 11f83706..0ac5e693 100644 --- a/app/api/logic/BusinessSchoolLogic.php +++ b/app/api/logic/BusinessSchoolLogic.php @@ -83,7 +83,14 @@ class BusinessSchoolLogic extends Logic $article = []; }else{ $article = $article->toArray(); - $article['file'] = BusinessSchoolFile::where('bsid', $id)->select()->toArray(); + $file = BusinessSchoolFile::where('bsid', $id)->select()->toArray(); + foreach ($file as &$v) { + if ($v['type'] == 1) { + $article['image'][] = $v['src']; + } else if($v['type'] == 2) { + $article['file'][] = $v['src']; + } + } } return $article; } From ef3295165bf32f138e8b979452666ad9634b3a38 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Mon, 23 Sep 2024 17:26:20 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/BusinessSchoolLogic.php | 9 +++++- .../view/business_school/edit_content.html | 28 ++++++++----------- app/api/logic/BusinessSchoolLogic.php | 5 ++-- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/app/admin/logic/BusinessSchoolLogic.php b/app/admin/logic/BusinessSchoolLogic.php index f7993931..b033603b 100644 --- a/app/admin/logic/BusinessSchoolLogic.php +++ b/app/admin/logic/BusinessSchoolLogic.php @@ -155,7 +155,14 @@ class BusinessSchoolLogic extends Logic public static function detail_content($id) { $res = BusinessSchool::field(true)->findOrEmpty($id)->toArray(); - $res['file'] = BusinessSchoolFile::where('bsid', $id)->select()->toArray(); + $file = BusinessSchoolFile::where('bsid', $id)->select()->toArray(); + foreach ($file as &$v) { + if ($v['type'] == 1) { + $res['image'][] = $v['src']; + } else if($v['type'] == 2) { + $res['file'][] = $v['src']; + } + } return $res; } diff --git a/app/admin/view/business_school/edit_content.html b/app/admin/view/business_school/edit_content.html index fc8f633e..ac6a6578 100755 --- a/app/admin/view/business_school/edit_content.html +++ b/app/admin/view/business_school/edit_content.html @@ -75,15 +75,13 @@
- {if !empty($detail.file)} - {foreach $detail.file as $val} - {if $val.type == 1} -
- img - -
x
-
- {/if} + {if !empty($detail.image)} + {foreach $detail.image as $val} +
+ img + +
x
+
{/foreach} {/if} @@ -99,13 +97,11 @@
{if !empty($detail.file)} {foreach $detail.file as $val} - {if $val.type == 2} - - {/if} +
+ {$val|basename} + +
x
+
{/foreach} {/if}
diff --git a/app/api/logic/BusinessSchoolLogic.php b/app/api/logic/BusinessSchoolLogic.php index 0ac5e693..6e6593c2 100644 --- a/app/api/logic/BusinessSchoolLogic.php +++ b/app/api/logic/BusinessSchoolLogic.php @@ -83,12 +83,13 @@ class BusinessSchoolLogic extends Logic $article = []; }else{ $article = $article->toArray(); - $file = BusinessSchoolFile::where('bsid', $id)->select()->toArray(); + $file = BusinessSchoolFile::where('bsid', $id)->select()->toArray(); foreach ($file as &$v) { if ($v['type'] == 1) { $article['image'][] = $v['src']; } else if($v['type'] == 2) { - $article['file'][] = $v['src']; + $article['file']['src'] = $v['src']; + $article['file']['name'] = basename($v['src']); } } } From 6bd8e6985459f86ad3c24a21a9631a0b3ae2882a Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Mon, 23 Sep 2024 17:27:16 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/BusinessSchoolLogic.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/logic/BusinessSchoolLogic.php b/app/api/logic/BusinessSchoolLogic.php index 6e6593c2..d726a633 100644 --- a/app/api/logic/BusinessSchoolLogic.php +++ b/app/api/logic/BusinessSchoolLogic.php @@ -84,12 +84,12 @@ class BusinessSchoolLogic extends Logic }else{ $article = $article->toArray(); $file = BusinessSchoolFile::where('bsid', $id)->select()->toArray(); - foreach ($file as &$v) { + foreach ($file as $k => &$v) { if ($v['type'] == 1) { $article['image'][] = $v['src']; } else if($v['type'] == 2) { - $article['file']['src'] = $v['src']; - $article['file']['name'] = basename($v['src']); + $article['file'][$k]['src'] = $v['src']; + $article['file'][$k]['name'] = basename($v['src']); } } } From 32eba7a4f0a10816dc4984a654ed3a97f3080d5e Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Tue, 24 Sep 2024 09:25:25 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=95=86=E5=93=81=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E3=80=81=E4=BE=9B=E8=B4=A7=E5=95=86=E5=92=8C=E5=93=81=E7=89=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/shop/view/goods/goods/goods_base.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/shop/view/goods/goods/goods_base.html b/app/shop/view/goods/goods/goods_base.html index 52ad2d8b..aa4ad941 100755 --- a/app/shop/view/goods/goods/goods_base.html +++ b/app/shop/view/goods/goods/goods_base.html @@ -127,7 +127,7 @@
-
@@ -136,7 +136,7 @@
-
@@ -145,7 +145,7 @@
-
From 8681c9ee031a365c61304544ed75cdc140680edf Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Tue, 24 Sep 2024 09:29:40 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/shop/view/goods/goods/goods_base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/shop/view/goods/goods/goods_base.html b/app/shop/view/goods/goods/goods_base.html index aa4ad941..4f232e07 100755 --- a/app/shop/view/goods/goods/goods_base.html +++ b/app/shop/view/goods/goods/goods_base.html @@ -95,7 +95,7 @@
-