123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- /**
- *
- *
- * @category xxx
- * @package PSR
- * @subpackage Documentation\API
- * @author xxx <xxx@xxx.com>
- * @license GPL https://xxx.com
- * @link https://xxx.com
- * @ctime: 2020/4/14 17:26
- */
- namespace App\Repositories;
- use App\Models\InviteNewUsersConfig;
- use Carbon\Carbon;
- class InviteNewUsersConfigRepository extends BaseRepository
- {
- public function __construct(InviteNewUsersConfig $inviteNewUsersConfig)
- {
- $this->model = $inviteNewUsersConfig;
- }
- public function getAllByAreaId($area_id){
- return $this->model->query()
- ->where('status',$this->model::STATUS_OK)
- ->where('start_time','<',Carbon::now())
- ->where('end_time','>',Carbon::now())
- ->where('area_id',$area_id)
- ->get();
- }
- public function getInviteNewUsersConfigByAreaId($area_id){
- return $this->model->query()
- ->where('status',$this->model::STATUS_OK)
- ->where('start_time','<',Carbon::now())
- ->where('end_time','>',Carbon::now())
- ->where('area_id',$area_id)
- ->first();
- }
- }
|