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 """ # 查询条件组合