1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Repositories;
- use App\Models\CompanyContact;
- use Prettus\Repository\Eloquent\BaseRepository;
- /**
- * Class CompanyContactRepositoryEloquent.
- *
- * @package namespace App\Repositories;
- */
- class CompanyContactRepository extends BaseRepository
- {
- /**
- * Specify Model class name
- *
- * @return string
- */
- public function model()
- {
- return CompanyContact::class;
- }
- public function getList($where, $page_num = '')
- {
- $rst = $this->model->where($where)->orderBy('updated_at', 'desc');
- if ($page_num) {
- return $rst->paginate($page_num);
- } else {
- return $rst->get();
- }
- }
- public function deleteContact($where, $whereIn = array())
- {
- $rst = $this->model->where($where);
- if ($whereIn) {
- foreach ($whereIn as $k => $v) {
- $rst->whereIn($k, $v);
- }
- }
- return $rst->delete();
- }
- public function getContact($where)
- {
- return $this->model->where($where)->first();
- }
- public function save($data, $id)
- {
- return $this->update($data, $id);
- }
- public function ContactUpdate($where,$data){
- return $this->model->where($where)->update($data);
- }
- }
|