| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Module\Dev\Repositorys;
- use App\Module\Dev\Models\Dev;
- use App\Repositories\BaseRepository;
- class DevRepository extends BaseRepository
- {
- /**
- * 构造函数
- */
- public function __construct()
- {
- parent::__construct(new Dev());
- }
- /**
- * 获取开发列表
- *
- * @param array $params
- * @return mixed
- */
- public function getList(array $params = [])
- {
- $query = $this->model->newQuery();
- if (!empty($params['name'])) {
- $query->where('name', 'like', '%' . $params['name'] . '%');
- }
- if (isset($params['status'])) {
- $query->where('status', $params['status']);
- }
- return $query->paginate($params['per_page'] ?? 15);
- }
- }
|