recuperateRepository = $recuperateRepository; } /** * 前台获取列表 */ public function list($key = '', $page = '') { //搜索条件 $where = []; $where[] = ['is_display', '=', '1']; if ($key) { $where[] = ['title', 'like', '%' . $key . '%']; } //获取列表 $list = $this->recuperateRepository->getRecuperate($where, $page); //列表处理 if ($list->toArray()) { foreach ($list as $k => $v) { $list[$k]->origin_title = $v->title; $style = ''; if ($v->tit_color) { $style .= 'color:' . $v->tit_color . ';'; } if ($v->tit_b == '1') { $style .= 'font-weight:bold;'; } if ($style) { $list[$k]->title = '' . $v->title . ''; } } } return $list; } /** * 获取前台显示的疗养信息 */ public function getRecuperateInfo($id) { $where = array( 'id' => $id, 'is_display' => '1', ); $article_info = $this->recuperateRepository->firstWhere($where); return $article_info; } /** * 增加数量 */ public function incrementData($where, $num, $filed) { return $this->recuperateRepository->incrementData($where, $num, $filed); } }