123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace App\Services\Recuperate;
- use App\Repositories\RecuperateApplyRepository;
- class RecuperateApplyService
- {
- protected $recuperateApplyRepository;
- public function __construct(RecuperateApplyRepository $recuperateApplyRepository)
- {
- $this->recuperateApplyRepository = $recuperateApplyRepository;
- }
- /**
- * 前台获取列表
- */
- public function list($status = null, $year=null,$page = '', $with = [])
- {
- //搜索条件
- $where = [];
- $where[] = ['uid', '=', auth('web-member')->id()];
- if (isset($status)) {
- $where[] = ['status', '=', $status];
- }
- if (isset($year)) {
- $where[] = ['recuperate_time_id', '=', $year];
- }
- //获取列表
- $list = $this->recuperateApplyRepository->getRecuperate($where, $page, $with);
- return $list;
- }
- /**
- * 获取前台显示信息
- */
- public function getRecuperateInfo($id)
- {
- $where = ['id' => $id];
- $article_info = $this->recuperateApplyRepository->firstWhere($where);
- return $article_info;
- }
- /**
- * 添加数据
- */
- public function create($attr)
- {
- return $this->recuperateApplyRepository->createApply($attr);
- }
- }
|