Selaa lähdekoodia

来电弹屏时获取最新的一条数据

MicroWin10-1604\Administrator 7 vuotta sitten
vanhempi
commit
32a7f0bdc3

+ 6 - 7
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/CallInScreenController.cs

119
             ActionResult res = NoToken("未知错误,请重新登录");
119
             ActionResult res = NoToken("未知错误,请重新登录");
120
             if (Request.IsAuthenticated)
120
             if (Request.IsAuthenticated)
121
             {
121
             {
122
-                DataTable dt = new DataTable();
123
-
122
+                //DataTable dt = new DataTable();
124
                 string tel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
123
                 string tel = HttpUtility.UrlDecode(RequestString.GetQueryString("tel"));
125
                 BLL.T_Cus_CustomerBase bll = new BLL.T_Cus_CustomerBase();
124
                 BLL.T_Cus_CustomerBase bll = new BLL.T_Cus_CustomerBase();
126
-                dt = bll.GetList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").Tables[0];
127
-
128
-                res = Success("客户信息加载成功", dt);
129
-
125
+                //dt = bll.GetList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").Tables[0];
126
+                //20180509 来电弹屏一个号码弹两个客户信息 machenyang
127
+                var cusmodel = bll.GetModelList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").Count() == 0 ? null : bll.GetModelList(" F_Telephone like '%" + tel + "%' or F_Mobile like '%" + tel + "%' ").OrderByDescending(p => p.F_CustomerId).First();
128
+                res = Success("客户信息加载成功", cusmodel);
130
             }
129
             }
131
             return res;
130
             return res;
132
         }
131
         }
753
                                 }
752
                                 }
754
                                 else
753
                                 else
755
                                     res = Error("获取失败,没有对应数据");
754
                                     res = Error("获取失败,没有对应数据");
756
-                            } 
755
+                            }
757
                             #endregion
756
                             #endregion
758
                             res = Success("新增成功!");
757
                             res = Success("新增成功!");
759
                         }
758
                         }