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 @@
  • - + 产品管理