model = Db::name('servicetype'); } /** * 服务类型列表 * @return void */ public function getList() { try { $isUpkeep = $this->request->param('is_upkeep',-1); $field = 'id,title'; $where = []; if ($isUpkeep != -1) { $where['is_upkeep'] = $isUpkeep; } $result = $this->model->field($field)->where($where)->order('weigh asc createtime desc')->select(); $this->success('获取成功',$result); } catch (Exception $e) { $this->error($e->getMessage()); } } }