From cf61323695f06ac4209c1d7cee836ac38a90100d Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Thu, 30 Nov 2023 11:40:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=BE=E5=A4=87=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/Device.php | 67 ++++ .../index/view/administrator/index.html | 2 +- application/index/view/device/index.html | 328 ++++++++++++++++++ 3 files changed, 396 insertions(+), 1 deletion(-) create mode 100644 application/index/controller/Device.php create mode 100644 application/index/view/device/index.html diff --git a/application/index/controller/Device.php b/application/index/controller/Device.php new file mode 100644 index 0000000..b84f0d0 --- /dev/null +++ b/application/index/controller/Device.php @@ -0,0 +1,67 @@ +error('亲,您还没有登录呢!', '/'); + } + } + + public function index() + { + return $this->fetch(); + } + + /** + * 获取产品列表 + * @return Json + * @throws DataNotFoundException + * @throws DbException + * @throws Exception + * @throws ModelNotFoundException + */ + public function deviceList() + { + $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; + $limit = intval($limit); + $start = $limit * ($page - 1); + + $where = []; + if (isset($receive['message']) && !empty($receive['message'])) { + $where['deviceId'] = $receive['message']; + } + $result = Db::table("bs_product_device")->where($where)->order('id desc')->limit($start, $limit)->select(); + $num = Db::table("bs_product_device")->where($where)->count(); + + foreach ($result as &$item) { + + } + + $list["msg"] = ""; + $list["code"] = 0; + $list["count"] = $num; + $list["data"] = $result; + + return json($list); + } + +} \ No newline at end of file diff --git a/application/index/view/administrator/index.html b/application/index/view/administrator/index.html index f442b25..1909b7d 100644 --- a/application/index/view/administrator/index.html +++ b/application/index/view/administrator/index.html @@ -135,7 +135,7 @@