| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 | <?php/** * Created by PhpStorm. * User: wuzhenke * Date: 2019/1/28 * Time: 10:49 */namespace App\Repositories\Jobfair;use App\Models\Jobfair\FloorplanStand;use Prettus\Repository\Eloquent\BaseRepository;class JobfairFloorplanStandRepository extends BaseRepository{    public function model()    {        return FloorplanStand::class;    }    public function standsTotal($where)    {        return $this->model->where($where)->select(['id'])->get();    }    public function getOne($where)    {        return $this->model->where($where)->first();    }    public function getOpenJobfair($where){        return $this->model->with(['jobfair_company','jobfair'])->whereHas('jobfair', function ($query) {            $query->where([                ['holddate_start', '<', strtotime("+60 minute")],                ['holddate_end', '>', time()],                ['subsite_id',get_subsite_id()]            ]);        })->whereHas('jobfair_company',function($query){            $query->where('audit',1);        })->where($where)->first();    }}
 |