Commit a75196cb a75196cb6ccea8f72f7b0091f3048816a45992c8 by lemon

验证分享链接

1 parent 05e8fa68
......@@ -14,6 +14,5 @@ class PropertyShare extends BaseModel
use SoftDeletes;
protected $updated_at = false;
protected $guarded = [];
}
......
......@@ -182,7 +182,7 @@ class PropertyTrackService extends Service
{
$url = $this->request->input('url');
if (!$res = PropertyShare::withTrashed()->where(['share_url_hash'=>crc64($url), 'phone'=>$this->request->input('phone'), 'from'=>$this->request->input('from')])->where('expire_time', '<=', $this->now)->first()) {
if (!$res = PropertyShare::withTrashed()->where(['share_url_hash'=>crc64($url), 'phone'=>$this->request->input('phone'), 'from'=>$this->request->input('from')])->where('expire_time', '>', $this->now)->first()) {
return Response::error(ErrorCode::URL_CHECK_FAIL);
}
if (!is_null($res->deleted_at)) return Response::error(ErrorCode::URL_CHECK_FAIL);
......