$id, 'is_show' => $find['is_show'] == 1 ? 0 : 1, 'update_time' => time(), 'update_admin_id' => $this->adminInfo['id'] ]); if (empty($res)) { return JsonService::fail('操作失败'); } return JsonService::successful('操作成功'); } public function getPageList($where) { $query = []; $query['is_delete'] = '0'; if ($where['is_show'] != -1) { $query['is_show'] = $where['is_show']; } $list = self::where($query)->page($where['page'], $where['limit'])->order('rank desc,add_time desc')->select()->toArray(); $count = count($list); // 通过行业Id获取行业名 foreach ($list as &$v) { $v['add_time'] = date('Y-m-d H:i:s', $v['add_time']); } return JsonService::successlayui(['count' => $count, 'data' => $list]); } public function add($data) { $data['add_admin_id'] = $this->adminInfo['id']; $data['add_time'] = time(); $res = self::insert($data); if (empty($res)) { return JsonService::fail('添加失败'); } return JsonService::successful('添加成功'); } public function edit($data) { $data['update_admin_id'] = $this->adminInfo['id']; $data['edit_time'] = time(); $res = self::update($data); if (empty($res)) { return JsonService::fail('修改失败'); } return JsonService::successful('修改成功'); } public function getList($where) { return self::where($where)->order('rank desc,add_time desc')->select()->toArray(); } }