12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2018/11/23
- * Time: 17:35
- */
- namespace App\Repositories;
- use App\Models\Report;
- use Prettus\Repository\Eloquent\BaseRepository;
- /**
- * Class ReportRepositoryEloquent.
- *
- * @package namespace App\Repositories;
- */
- class ReportRepository extends BaseRepository
- {
- /**
- * Specify Model class name
- *
- * @return string
- */
- public function model()
- {
- return Report::class;
- }
- public function getTypes($type)
- {
- return $this->model->getReportTypes($type);
- }
- public function getReport($where)
- {
- return $this->model->where($where)->first();
- }
- public function addInfo($data)
- {
- return $this->model->create($data);
- }
- public function getCount($where)
- {
- return $this->model->where($where)->count();
- }
- }
|