From c5c8157cc14b45ede951f0f04acf56ceb8448d97 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Thu, 30 Nov 2023 10:35:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=A7=E5=93=81=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Product.php | 6 + .../index/view/administrator/index.html | 6 +- application/index/view/product/index.html | 169 ++++++++---------- 3 files changed, 83 insertions(+), 98 deletions(-) diff --git a/application/index/controller/Product.php b/application/index/controller/Product.php index 1ad79ed..68603ad 100644 --- a/application/index/controller/Product.php +++ b/application/index/controller/Product.php @@ -3,6 +3,7 @@ namespace app\index\controller; use think\Db; +use think\Request; use think\response\Json; use think\Exception; use think\db\exception\DataNotFoundException; @@ -34,6 +35,8 @@ class Product extends Base */ public function productList() { + $request = Request::instance(); + $receive = $request->get(); $page = input("get.page") ? input("get.page") : 1; $page = intval($page); $limit = input("get.limit") ? input("get.limit") : 1; @@ -41,6 +44,9 @@ class Product extends Base $start = $limit * ($page - 1); $where = []; + if (isset($receive['productId']) && !empty($receive['productId'])) { + $where['productId'] = $receive['productId']; + } $result = Db::table("bs_product")->where($where)->order('id desc')->limit($start, $limit)->select(); $num = Db::table("bs_product")->where($where)->count(); diff --git a/application/index/view/administrator/index.html b/application/index/view/administrator/index.html index 8d2c173..f442b25 100644 --- a/application/index/view/administrator/index.html +++ b/application/index/view/administrator/index.html @@ -116,13 +116,13 @@