From 7ad82b6c82c2181905c4627df9ffd0071f3315cb Mon Sep 17 00:00:00 2001 From: liuxiaoquan Date: Mon, 13 Mar 2023 10:01:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E4=BF=9D=E8=AF=81=E9=87=91?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6=E9=A1=B5=E9=9D=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/model/EbStoreProduct.php | 24 +-- .../system/merchant/intention/lst.html | 143 ++++++++++++------ 2 files changed, 108 insertions(+), 59 deletions(-) diff --git a/app/admin/model/EbStoreProduct.php b/app/admin/model/EbStoreProduct.php index 67c889a..c8b7617 100644 --- a/app/admin/model/EbStoreProduct.php +++ b/app/admin/model/EbStoreProduct.php @@ -49,22 +49,22 @@ class EbStoreProduct extends Model */ public function getList(?int $mer_id, array $where, int $page, int $limit) { - $query = self::search($mer_id, $where); - // ->with(['merCateId.category', 'storeCategory', 'brand']); + $query = self::search($mer_id, $where) + ->with(['merCateId.category', 'storeCategory', 'brand']); $count = $query->count(); $data = $query->field($this->filed)->page($page, $limit)->select(); - // $data->append(['us_status']); + $data->append(['us_status']); - // $list = hasMany( - // $data, - // 'mer_labels', - // ProductLabel::class, - // 'product_label_id', - // 'mer_labels', - // ['status' => 1], - // 'product_label_id,product_label_id id,label_name name' - // ); + $list = hasMany( + $data, + 'mer_labels', + ProductLabel::class, + 'product_label_id', + 'mer_labels', + ['status' => 1], + 'product_label_id,product_label_id id,label_name name' + ); return compact('count', 'list'); } diff --git a/app/admin/view/merchant/system/merchant/intention/lst.html b/app/admin/view/merchant/system/merchant/intention/lst.html index 25f3cc8..8389bb8 100644 --- a/app/admin/view/merchant/system/merchant/intention/lst.html +++ b/app/admin/view/merchant/system/merchant/intention/lst.html @@ -9,36 +9,41 @@
-
+
-
- -
-
- -
-
-
-
- +
+ +
+ +
+
+ + + + + + + + +
-
- -
- +
+
+ +
+
-
+
+ +
-
--> - -
+
@@ -47,12 +52,13 @@
- +
+ + + + + +
@@ -61,7 +67,7 @@
- {volist name="category" key="k" id="vo"} @@ -82,7 +88,7 @@
- {volist name="type" key="k" id="vo"} @@ -253,29 +259,72 @@ }); - //监听搜索提交 - // form.on('submit(searchform)', function(data) { - // layui.pageTable.reload({ - // where: { - // keywords: data.field.keywords - // }, - // page: { - // curr: 1 - // } - // }); - // return false; - // }); // 日期范围 - layui.use('laydate', function () { + layui.use(['laydate','table','element', 'jquery'], function () { var laydate = layui.laydate; //日期范围 laydate.render({ - elem: '#test6' + elem: '#range_date' //设置开始日期、日期日期的 input 选择器 //数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可 , range: ['#test-startDate-1', '#test-endDate-1'] + ,done: function(value, date, endDate){ + active['reload'] ? active['reload'].call(this) : ''; + } }); + + + // + var $ = layui.$, active = { + reload: function(){ + let dataRload = getformdata();; + console.log(dataRload) + //执行重载 + table.reload('intention_list', { + page: { + curr: 1 //重新从第 1 页开始 + } + ,where: { + ...dataRload + } + }); + } + }; + + + //监听button提交 + form.on('submit(searchform)', function(data) { + layui.pageTable.reload({ + where: { + ...data.field + }, + page: { + curr: 1 + } + }); + return false; + }); + + //监听select提交 + form.on('select(seleform)', function(data) { + active['reload'] ? active['reload'].call(this) : ''; + + return false; + }); + + + + // 获取表单所有参数 + function getformdata() { + var form = $('#filterform').serializeArray(); + var data = new Array(); + for(let i=0;i