1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Repositories;
- use App\Models\PlatformContent;
- use Symfony\Component\HttpKernel\Exception\HttpException;
- /**
- * Created by PhpStorm.
- * User: durong
- * Date: 2019/6/17
- * Time: 下午6:46
- */
- class PlatformContentRepository
- {
- public function __construct(PlatformContent $platformContent)
- {
- $this->platformContent = $platformContent;
- }
- public function index($request)
- {
- $where = [];
- if(isset($request['id'])){
- $where[] = ['id',$request['id']];
- }
- $this->platformContent = $this->platformContent
- ->where($where)->orderBy('id', 'desc')->get();
- return $this->platformContent;
- }
- }
|