12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace App\Repositories;
- use App\Models\CompanyContact;
- use Prettus\Repository\Eloquent\BaseRepository;
- use Prettus\Repository\Criteria\RequestCriteria;
- use Illuminate\Support\Facades\DB;
- class CompanyContactsRepository extends BaseRepository
- {
- /**
- * Specify Model class name
- *
- * @return string
- */
- public function model()
- {
- return CompanyContact::class;
- }
-
- /**
- * Boot up the repository, pushing criteria
- */
- public function boot()
- {
- $this->pushCriteria(app(RequestCriteria::class));
- }
- //获取企业信息
- public function getContacts($where)
- {
- return $this->model->where($where)->get();
- }
- //获取一条信息
- public function getOne($id)
- {
- return $this->model->find($id);
- }
- }
|