| 1234567891011121314151617181920212223242526272829303132333435 | 
							- <?php
 
- namespace App\Http\Controllers\Api\Crontab;
 
- use App\Http\Controllers\Api\ApiBaseController;
 
- use App\Models\TalentHouse;
 
- use App\Models\TalentHouseApply;
 
- use App\Models\TalentHousePeople;
 
- class OneHourController extends ApiBaseController
 
- {
 
-     public function index()
 
-     {
 
-         $this->clearSock();
 
-     }
 
-     /**
 
-      * 人才购房 - 清除名额锁定
 
-      */
 
-     private function clearSock()
 
-     {
 
-         $list = TalentHouse::where('is_end', 2)->where('supply_time', '<=', date('Y-m-d H:i:s'))->get();
 
-         if ($list->isEmpty()) {
 
-             return true;
 
-         }
 
-         foreach ($list as $v) {
 
-             TalentHouseApply::where('house_id', $v['id'])->where('status', '<>', 2)->update(['is_sock' => 2]);
 
-             $v->is_end = 1;
 
-             $v->save();
 
-         }
 
-         return true;
 
-     }
 
- }
 
 
  |