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 @@