作者 lyh

变更数据

@@ -85,15 +85,14 @@ class GeoController extends BaseController @@ -85,15 +85,14 @@ class GeoController extends BaseController
85 if ($info === false){ 85 if ($info === false){
86 return $this->error('非法请求'); 86 return $this->error('非法请求');
87 } 87 }
88 - if ($info['status'] != GeoWritings::STATUS_RUNNING){ 88 + if ($info['status'] == GeoWritings::STATUS_FINISH){
89 return $this->error('当前文章已确认,不可再次确认'); 89 return $this->error('当前文章已确认,不可再次确认');
90 } 90 }
91 $this->param['confirm_ip'] = $this->request->ip(); 91 $this->param['confirm_ip'] = $this->request->ip();
92 $this->param['confirm_at'] = date('Y-m-d H:i:s'); 92 $this->param['confirm_at'] = date('Y-m-d H:i:s');
93 $this->param['content_length'] = strlen($this->param['content']); 93 $this->param['content_length'] = strlen($this->param['content']);
94 - $this->param['status'] = 3; 94 + $this->param['status'] = GeoWritings::STATUS_FINISH;
95 $geoWritingsModel->edit($this->param,['uniqid' => $token]); 95 $geoWritingsModel->edit($this->param,['uniqid' => $token]);
96 - // FIXME 验证完成,保存数据,计算内容长度,处理内容中的资源, IP 确认时间 状态  
97 return true; 96 return true;
98 } 97 }
99 98
@@ -49,6 +49,7 @@ class GeoWritingsLogic extends BaseLogic @@ -49,6 +49,7 @@ class GeoWritingsLogic extends BaseLogic
49 */ 49 */
50 public function saveWriting(){ 50 public function saveWriting(){
51 try { 51 try {
  52 + $this->param['status'] = GeoWritings::STATUS_INIT;
52 if(isset($this->param['id']) &&!empty($this->param['id'])){ 53 if(isset($this->param['id']) &&!empty($this->param['id'])){
53 $id = $this->param['id']; 54 $id = $this->param['id'];
54 $this->model->edit($this->param,['id'=>$id]); 55 $this->model->edit($this->param,['id'=>$id]);