Procházet zdrojové kódy

时间判断格式修改

zhengbingbing %!s(int64=7) %!d(string=před) roky
rodič
revize
4e24e210ca

+ 48 - 48
codegit/CallCenterApi/CallCenterApi.Interface/CallCenterApi.Interface/Controllers/tel/DutyPhoneController.cs

@@ -20,60 +20,60 @@ namespace CallCenterApi.Interface.Controllers.tel
20 20
             {
21 21
                 string sql = "";
22 22
                 DataTable dt = new DataTable();
23
-               
24
-                    string strtelnum = HttpUtility.UrlDecode(RequestString.GetQueryString("telnum"));
25
-                    string strbtime = HttpUtility.UrlDecode(RequestString.GetQueryString("btime"));
26
-                    string stretime = HttpUtility.UrlDecode(RequestString.GetQueryString("etime"));
27 23
 
28
-                    string strpageindex = RequestString.GetQueryString("page");
29
-                    int pageindex = 1;
30
-                    string strpagesize = RequestString.GetQueryString("pagesize");
31
-                    int pagesize = 10;
24
+                string strtelnum = HttpUtility.UrlDecode(RequestString.GetQueryString("telnum"));
25
+                string strbtime = HttpUtility.UrlDecode(RequestString.GetQueryString("btime"));
26
+                string stretime = HttpUtility.UrlDecode(RequestString.GetQueryString("etime"));
32 27
 
33
-                    if (strtelnum.Trim() != "" && strtelnum != "undefined")
34
-                    {
35
-                        sql += " and F_ZBDH like '%" + strtelnum.Trim() + "%' ";
36
-                    }
37
-                    if (strbtime.Trim() != "" && strbtime != "undefined")
38
-                    {
39
-                        sql += " and F_CreateTime >= '" +strbtime.Trim() + "' ";
40
-                    }
41
-                    if (stretime.Trim() != "" && stretime != "undefined")
42
-                    {
43
-                        sql += " and F_CreateTime <= '" + stretime.Trim() + "' ";
44
-                    }
28
+                string strpageindex = RequestString.GetQueryString("page");
29
+                int pageindex = 1;
30
+                string strpagesize = RequestString.GetQueryString("pagesize");
31
+                int pagesize = 10;
45 32
 
46
-                    if (strpageindex.Trim() != "")
47
-                    {
48
-                        pageindex = Convert.ToInt32(strpageindex);
49
-                    }
33
+                if (strtelnum.Trim() != "" && strtelnum != "undefined")
34
+                {
35
+                    sql += " and F_ZBDH like '%" + strtelnum.Trim() + "%' ";
36
+                }
37
+                if (strbtime.Trim() != "" && strbtime != "undefined")
38
+                {
39
+                    sql += " and datediff(day,'" + strbtime.Trim() + "', F_CreateTime )>=0  ";
40
+                }
41
+                if (stretime.Trim() != "" && stretime != "undefined")
42
+                {
43
+                    sql += " and datediff(day,'" + stretime.Trim() + "', F_CreateTime )<=0  ";
44
+                }
50 45
 
51
-                    if (strpagesize.Trim() != "")
52
-                    {
53
-                        pagesize = Convert.ToInt32(strpagesize);
54
-                    }
55
-                    int recordCount = 0;
56
-                    dt = BLL.PagerBLL.GetListPager(
57
-                   "T_Call_ZBDH",
58
-                   "F_ZBID",
59
-                   "*",
60
-                   sql,
61
-                   "ORDER BY F_ZBID desc",
62
-                   pagesize,
63
-                   pageindex,
64
-                   true,
65
-                   out recordCount);
46
+                if (strpageindex.Trim() != "")
47
+                {
48
+                    pageindex = Convert.ToInt32(strpageindex);
49
+                }
66 50
 
67
-                    var obj = new
68
-                    {
69
-                        state = "success",
70
-                        message = "成功",
71
-                        rows = dt,
72
-                        total = recordCount
73
-                    };
51
+                if (strpagesize.Trim() != "")
52
+                {
53
+                    pagesize = Convert.ToInt32(strpagesize);
54
+                }
55
+                int recordCount = 0;
56
+                dt = BLL.PagerBLL.GetListPager(
57
+               "T_Call_ZBDH",
58
+               "F_ZBID",
59
+               "*",
60
+               sql,
61
+               "ORDER BY F_ZBID desc",
62
+               pagesize,
63
+               pageindex,
64
+               true,
65
+               out recordCount);
66
+
67
+                var obj = new
68
+                {
69
+                    state = "success",
70
+                    message = "成功",
71
+                    rows = dt,
72
+                    total = recordCount
73
+                };
74
+
75
+                res = Content(obj.ToJson());
74 76
 
75
-                    res = Content(obj.ToJson());
76
-           
77 77
             }
78 78
             return res;
79 79
         }