1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- /**
- * Created by PhpStorm.
- * User: wuzhenke
- * Date: 2018/12/13
- * Time: 14:04
- */
- namespace App\Repositories;
- use App\Models\Tpl;
- use Prettus\Repository\Criteria\RequestCriteria;
- use Prettus\Repository\Eloquent\BaseRepository;
- class TplRepository extends BaseRepository
- {
- public function model()
- {
- return Tpl::class;
- }
- public function boot()
- {
- $this->pushCriteria(app(RequestCriteria::class));
- }
- public function findTpl($where)
- {
- $where['display'] = 1;
- return $this->model->where($where)->get();
- }
-
- public function getDefaultTpl($where)
- {
- return $this->model->where($where)->first();
- }
- }
|