Browse Source

获取网站模板修改判断数组是否为空

15313670163 3 months ago
parent
commit
22ce5e81e1

+ 4 - 2
app/JsonRpc/WebsiteService.php

@@ -1263,8 +1263,8 @@ class WebsiteService implements WebsiteServiceInterface
                     ->orderBy("template.updated_at", "desc")
                     ->orderBy("template.updated_at", "desc")
                     ->get();
                     ->get();
             }
             }
+            if($rep->count()==0){
 
 
-            if(empty($rep->toArray())){
                 $message = "没有查找到相关数据!";
                 $message = "没有查找到相关数据!";
             }else{
             }else{
                 $result = [
                 $result = [
@@ -1273,7 +1273,9 @@ class WebsiteService implements WebsiteServiceInterface
                 ];
                 ];
             }
             }
         }
         }
-        if(empty($rep)){
+
+        if($rep->count()==0){
+            
             return Result::error($message,0);
             return Result::error($message,0);
         }else{
         }else{
             return Result::success($result);
             return Result::success($result);

File diff suppressed because it is too large
+ 0 - 0
runtime/container/scan.cache


+ 1 - 1
runtime/hyperf.pid

@@ -1 +1 @@
-11119
+15511

+ 8 - 0
runtime/logs/hyperf.log

@@ -114,3 +114,11 @@
 [2024-12-24T13:51:12.155510+08:00] sql.INFO: [14.54] select * from `template_class` where `id` = '1' limit 1 [] []
 [2024-12-24T13:51:12.155510+08:00] sql.INFO: [14.54] select * from `template_class` where `id` = '1' limit 1 [] []
 [2024-12-24T13:51:12.180296+08:00] sql.INFO: [16.18] select `template`.*, `template_class`.`name` from `template` left join `template_class` on `template_class`.`id` = `template`.`template_class_id` where `template_class_id` = '1' and (json_contains(`template_img`, '{"value":"1"}') and json_contains(`template_img`, '{"value":"2"}') and json_contains(`template_img`, '{"value":"3"}') and json_contains(`template_img`, '{"value":"4"}') and json_contains(`template_img`, '{"value":"5"}') and json_contains(`template_img`, '{"value":"6"}') and json_contains(`template_img`, '{"value":"7"}')) order by `template`.`updated_at` desc limit 10 offset 0 [] []
 [2024-12-24T13:51:12.180296+08:00] sql.INFO: [16.18] select `template`.*, `template_class`.`name` from `template` left join `template_class` on `template_class`.`id` = `template`.`template_class_id` where `template_class_id` = '1' and (json_contains(`template_img`, '{"value":"1"}') and json_contains(`template_img`, '{"value":"2"}') and json_contains(`template_img`, '{"value":"3"}') and json_contains(`template_img`, '{"value":"4"}') and json_contains(`template_img`, '{"value":"5"}') and json_contains(`template_img`, '{"value":"6"}') and json_contains(`template_img`, '{"value":"7"}')) order by `template`.`updated_at` desc limit 10 offset 0 [] []
 [2024-12-24T14:05:40.108246+08:00] sql.INFO: [1781.51] select * from `footer_content` where `fcat_id` = '12' order by `updated_at` desc limit 10 offset 0 [] []
 [2024-12-24T14:05:40.108246+08:00] sql.INFO: [1781.51] select * from `footer_content` where `fcat_id` = '12' order by `updated_at` desc limit 10 offset 0 [] []
+[2024-12-24T14:36:30.947533+08:00] sql.INFO: [488.51] select * from `website` where `website`.`id` = '2' limit 1 [] []
+[2024-12-24T14:36:31.189040+08:00] sql.INFO: [225.76] select `page_type` from `website_template_info` where `website_id` = '2' limit 1 [] []
+[2024-12-24T14:36:31.208594+08:00] sql.INFO: [14.35] select * from `template_class` where `id` = '1' limit 1 [] []
+[2024-12-24T14:36:31.235043+08:00] sql.INFO: [17.17] select `template`.*, `template_class`.`name` from `template` left join `template_class` on `template_class`.`id` = `template`.`template_class_id` where `template_class_id` = '1' and (json_contains(`template_img`, '{"value":"1"}') and json_contains(`template_img`, '{"value":"2"}') and json_contains(`template_img`, '{"value":"3"}') and json_contains(`template_img`, '{"value":"4"}') and json_contains(`template_img`, '{"value":"5"}') and json_contains(`template_img`, '{"value":"6"}') and json_contains(`template_img`, '{"value":"7"}')) order by `template`.`updated_at` desc limit 10 offset 0 [] []
+[2024-12-24T14:42:02.262446+08:00] sql.INFO: [66.24] select * from `website` where `website`.`id` = '2' limit 1 [] []
+[2024-12-24T14:42:02.291185+08:00] sql.INFO: [13.46] select `page_type` from `website_template_info` where `website_id` = '2' limit 1 [] []
+[2024-12-24T14:42:02.313244+08:00] sql.INFO: [16.89] select * from `template_class` where `id` = '1' limit 1 [] []
+[2024-12-24T14:42:02.336343+08:00] sql.INFO: [15.95] select `template`.*, `template_class`.`name` from `template` left join `template_class` on `template_class`.`id` = `template`.`template_class_id` where `template_class_id` = '1' and (json_contains(`template_img`, '{"value":"1"}') and json_contains(`template_img`, '{"value":"2"}') and json_contains(`template_img`, '{"value":"3"}') and json_contains(`template_img`, '{"value":"4"}') and json_contains(`template_img`, '{"value":"5"}') and json_contains(`template_img`, '{"value":"6"}') and json_contains(`template_img`, '{"value":"7"}')) order by `template`.`updated_at` desc limit 10 offset 0 [] []

+ 2 - 2
vendor/composer/installed.php

@@ -3,7 +3,7 @@
         'name' => 'hyperf/hyperf-skeleton',
         'name' => 'hyperf/hyperf-skeleton',
         'pretty_version' => 'dev-master',
         'pretty_version' => 'dev-master',
         'version' => 'dev-master',
         'version' => 'dev-master',
-        'reference' => '452c3aad61513066c145fd9a77d1bae540191494',
+        'reference' => 'e026b57ebbb3629d42294c69880d16ce535b7c2f',
         'type' => 'project',
         'type' => 'project',
         'install_path' => __DIR__ . '/../../',
         'install_path' => __DIR__ . '/../../',
         'aliases' => array(),
         'aliases' => array(),
@@ -439,7 +439,7 @@
         'hyperf/hyperf-skeleton' => array(
         'hyperf/hyperf-skeleton' => array(
             'pretty_version' => 'dev-master',
             'pretty_version' => 'dev-master',
             'version' => 'dev-master',
             'version' => 'dev-master',
-            'reference' => '452c3aad61513066c145fd9a77d1bae540191494',
+            'reference' => 'e026b57ebbb3629d42294c69880d16ce535b7c2f',
             'type' => 'project',
             'type' => 'project',
             'install_path' => __DIR__ . '/../../',
             'install_path' => __DIR__ . '/../../',
             'aliases' => array(),
             'aliases' => array(),

Some files were not shown because too many files changed in this diff