From 7873135d6c1142384e258382639e62a6e2bd7fcc Mon Sep 17 00:00:00 2001 From: 13507605001 Date: Wed, 30 Nov 2022 10:54:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8A=A5=E8=A1=A8=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db_logic/medicament_record.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db_logic/medicament_record.py b/db_logic/medicament_record.py index 12c0f2f..4087d05 100644 --- a/db_logic/medicament_record.py +++ b/db_logic/medicament_record.py @@ -222,6 +222,7 @@ class BllMedicamentRecord(Repository): ) a LEFT JOIN( select avatar_url, user_id from rms_user ) b on a.create_user_id= b.user_id + order by count_number desc """ data = self.execute(sql_all).fetchall() @@ -311,7 +312,7 @@ class BllMedicamentRecord(Repository): select medicament_id, `name`, english_name, speci, cas_number, purity, net_weight_unit,put_in_date, `status`,func_type from rms_medicament )as a LEFT JOIN( select medicament_id, FORMAT(sum(use_quantity),2) sum_use, count(medicament_id) c_two from rms_medicament_record where record_type=2 GROUP BY medicament_id - ) b on a.medicament_id=b.medicament_id {filter_base} GROUP BY `name`, purity, speci + ) b on a.medicament_id=b.medicament_id {filter_base} GROUP BY `name`, purity, speci order by use_level desc """ # 获取数量 @@ -360,6 +361,7 @@ class BllMedicamentRecord(Repository): LEFT JOIN (select medicament_id, func_type from rms_medicament ) as c on c.medicament_id = a.medicament_id {filter_base} + order by use_amount desc """ # 查询条件组合