caipin 5 năm trước cách đây
mục cha
commit
09e5249bb4
1 tập tin đã thay đổi với 7 bổ sung12 xóa
  1. 7 12
      app/models/curing.js

+ 7 - 12
app/models/curing.js

@@ -28,6 +28,12 @@ module.exports = (sequelize, DataTypes) => {
 
     
     curing.getCuringInMobile=async function(mobile,compilation_id){
+    	
+    	if(!hash.isExistence(mobile)){
+    		return [];
+        }
+    	
+    
     	var option={
         		where: {
         			mobile: {
@@ -40,18 +46,7 @@ module.exports = (sequelize, DataTypes) => {
             option.where={compilation_id: compilation_id};
         }
     	
-    	
-    	
-    	
-        if(mobile==undefined){
-            return [];
-        }
-        var condition={
-            raw:true,
-            where: {
-                mobile: mobile
-            }};
-        var curingList = await this.findOne(condition);
+        var curingList = await this.findAll(option);
         return curingList;
     };