wngur6076 hace 2 meses
padre
commit
fd9a31f1dd

+ 7 - 3
function-in-db/procedures/dash_board/shop_dash/lt1_shop_dash_2_left_top.sql

@@ -55,6 +55,7 @@ SELECT
         END
     ) AS c2,
     CONCAT(
+    IF(COUNT(*) = 0, 0,
         FLOOR(
             COUNT(
                 CASE
@@ -64,9 +65,10 @@ SELECT
                     THEN mx.id
                 END
             ) * 100 / COUNT(*)
-        ),
-        '%'
-    ) AS c3
+        )
+    ),
+    '%'
+) AS c3
 FROM
     dbr_sorder AS mx;
 
@@ -76,3 +78,5 @@ DELIMITER ;
 
 CALL lt1_shop_dash_2_left_top('', '', '', '', '', '', '', '',
 '', '', '', '', '', 1, 1, 1, 1);
+
+