作者 lyh

变更数据

... ... @@ -80,13 +80,20 @@ class GeoController extends BaseController
'content.max' => '内容过长保存失败',
]);
$token = trim($this->param['token']);
$data = GeoWritings::where(['uniqid' => $token])->first();
if (empty($data)){
$geoWritingsModel = new GeoWritings();
$info = $geoWritingsModel->read(['uniqid' => $token]);
if ($info === false){
return $this->error('非法请求');
}
if ($data->status != GeoWritings::STATUS_RUNNING){
if ($info['status'] != GeoWritings::STATUS_RUNNING){
return $this->error('当前文章已确认,不可再次确认');
}
$param = [
'confirm_ip'=>$this->request->ip(),
'confirm_at'=>date('Y-m-d H:i:s'),
'content_length'=>$info['content'],
'status'
];
// FIXME 验证完成,保存数据,计算内容长度,处理内容中的资源, IP 确认时间 状态
return $data;
}
... ...
... ... @@ -58,7 +58,6 @@ class GeoWritingsLogic extends BaseLogic
$this->param['uniqid'] = uniqid().$this->param['project_id'];
$id = $this->model->addReturnId($this->param);
}
GeoWritings::sendConfirmMessage($id);
}catch (\Exception $e){
$this->fail('保存数据失败,请联系管理员'.$e->getMessage());
}
... ...
... ... @@ -99,7 +99,6 @@ class GeoWritings extends Base
'thumbUrl' => 'https://hub.globalso.com/logocm.png',
'url' => 'https://oa.quanqiusou.cn/public-geo-article-list?token=' . $token
];
$content = json_encode($content_array, JSON_UNESCAPED_UNICODE);
MessagePush::insert(compact('project_id', 'friend_id', 'type', 'content_type', 'content', 'send_time', 'updated_at', 'created_at'));
return true;
}
... ...