Просмотр исходного кода

券兑换记录增加券码搜索条件

lcl 2 лет назад
Родитель
Сommit
53ebb1d37a

+ 20 - 0
Areas/Admin/Controllers/MainServer/PosCouponExchangeRecordController.cs

@@ -69,6 +69,16 @@ namespace MySystem.Areas.Admin.Controllers
                 string end = datelist[1];
                 condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
+            //来源券码
+            if (!string.IsNullOrEmpty(data.SourceCoupons))
+            {
+                condition += " and SourceCoupons like '%" + data.SourceCoupons + "%'";
+            }
+            //兑换券码
+            if (!string.IsNullOrEmpty(data.ToCoupons))
+            {
+                condition += " and ToCoupons like '%" + data.ToCoupons + "%'";
+            }
 
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosCouponExchangeRecord", Fields, "Id desc", "0", page, limit, condition);
@@ -110,6 +120,16 @@ namespace MySystem.Areas.Admin.Controllers
                 string end = datelist[1];
                 condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
+            //来源券码
+            if (!string.IsNullOrEmpty(data.SourceCoupons))
+            {
+                condition += " and SourceCoupons like '%" + data.SourceCoupons + "%'";
+            }
+            //兑换券码
+            if (!string.IsNullOrEmpty(data.ToCoupons))
+            {
+                condition += " and ToCoupons like '%" + data.ToCoupons + "%'";
+            }
 
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PosCouponExchangeRecord", Fields, "Id desc", "0", 1, 20000, condition, "FromUserId,ToUserId,OrderNo,BeforeStock,BeforeTotal,BeforeOut,AfterStock,AfterTotal,AfterOut,ChangeCount,ChangeKind", false);

+ 12 - 0
Areas/Admin/Views/MainServer/PosCouponExchangeRecord/Index.cshtml

@@ -50,6 +50,18 @@
                                 placeholder="" autocomplete="off">
                         </div>
                     </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">来源券码</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="SourceCoupons" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">兑换券码</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="ToCoupons" autocomplete="off">
+                        </div>
+                    </div>
 
                     <div class="layui-inline ml50">
                         <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">

+ 0 - 1
wwwroot/layuiadmin/modules_main/PosCouponExchangeRecord_Admin.js

@@ -101,7 +101,6 @@ layui.config({
             , { field: 'ToCoupons', width: 300, title: '兑换券', sort: true }
         ]]
         , where: {
-            OrderNo: OrderNo
         }
         , page: true
         , limit: 30