生成链接过期时间
Showing
1 changed file
with
4 additions
and
2 deletions
... | @@ -140,18 +140,20 @@ class PropertyTrackService extends Service | ... | @@ -140,18 +140,20 @@ class PropertyTrackService extends Service |
140 | //将上一条链接删除 | 140 | //将上一条链接删除 |
141 | PropertyShare::query()->where(['pf_id'=>$this->request->input('track_id')])->orderByDesc('id')->limit(1)->delete(); | 141 | PropertyShare::query()->where(['pf_id'=>$this->request->input('track_id')])->orderByDesc('id')->limit(1)->delete(); |
142 | 142 | ||
143 | $expire_time = date('Y-m-d H:i:s', $expire_time); | ||
144 | |||
143 | //生成新链接 | 145 | //生成新链接 |
144 | PropertyShare::query()->create([ | 146 | PropertyShare::query()->create([ |
145 | 'pf_id' => $this->request->input('track_id'), | 147 | 'pf_id' => $this->request->input('track_id'), |
146 | 'phone' => $this->request->input('phone'), | 148 | 'phone' => $this->request->input('phone'), |
147 | 'share_url' => $share, | 149 | 'share_url' => $share, |
148 | 'share_url_hash'=> $share_url_hash, | 150 | 'share_url_hash'=> $share_url_hash, |
149 | 'expire_time' => date('Y-m-d H:i:s', $expire_time), | 151 | 'expire_time' => $expire_time, |
150 | 'from' => $this->request->input('from'), | 152 | 'from' => $this->request->input('from'), |
151 | 'user_id' => $this->request->input('from') ? $this->request->get('identifier')->company_id : $this->request->input('user_id'), //用户 | 153 | 'user_id' => $this->request->input('from') ? $this->request->get('identifier')->company_id : $this->request->input('user_id'), //用户 |
152 | ]); | 154 | ]); |
153 | 155 | ||
154 | return Response::success(['url'=>$share]); | 156 | return Response::success(['url'=>$share, 'expire_time'=>$expire_time]); |
155 | } catch (\Throwable $throwable) { | 157 | } catch (\Throwable $throwable) { |
156 | return Response::error(); | 158 | return Response::error(); |
157 | } | 159 | } | ... | ... |
-
Please register or sign in to post a comment