12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace App\Repositories\Statistics;
- use App\Models\StatisticsUser;
- use Prettus\Repository\Eloquent\BaseRepository;
- /**
- * Class StatisticsUserRepositoryEloquent.
- *
- * @package namespace App\Repositories;
- */
- class StatisticsUserRepository extends BaseRepository
- {
- public function model()
- {
- return StatisticsUser::class;
- }
- public function getUser($account)
- {
- return $this->model->where('username', $account)->first();
- }
- public function getUsers($where, $limit = '')
- {
- $res = $this->model->where($where);
- if ($limit) {
- $res->paginate($limit);
- }
- return $res->get();
- }
- public function getUserInfo($where)
- {
- return $this->model->where($where)->first();
- }
- public function updateUserInfo($data, $where)
- {
- return $this->model->where($where)->update($data);
- }
- public function createUserInfo($data)
- {
- return $this->model->create($data);
- }
- public function deleteUserInfo($where)
- {
- return $this->model->where($where)->delete();
- }
- }
|