12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace App\Managers;
- use App\Models\Fpdx\ActivityModel;
- /**
- * 分配对象匹配活动
- * Class PairActivityManager
- * @package App\Managers
- */
- class PairActivityManager
- {
- protected ActivityModel $activityModel;
- public function __construct(ActivityModel $activityModel)
- {
- $this->$activityModel = $activityModel;
- }
- /**
- * 获取报名中的活动
- * @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object|null
- */
- public function getEnrollingActivity()
- {
- $activity = $this->activityModel->where('signbegin_time', '<', time())->where('signend_time', '>', time())->first();
- return $activity;
- }
- }
|