作者 lyh

gx

@@ -176,13 +176,16 @@ class BaseLogic extends Logic @@ -176,13 +176,16 @@ class BaseLogic extends Logic
176 */ 176 */
177 function updateNotify($data) 177 function updateNotify($data)
178 { 178 {
  179 + $updateNotifyModel = new UpdateNotify();
  180 + $info = $updateNotifyModel->read(['project_id'=>$data['project_id'],'route'=>$data['route'],'status'=>0]);
  181 + if($info === false){
179 $param = [ 182 $param = [
180 'project_id'=>$data['project_id'], 183 'project_id'=>$data['project_id'],
181 'type'=>$data['type'], 184 'type'=>$data['type'],
182 'route'=>$data['route'], 185 'route'=>$data['route'],
183 - 'created_at'=>date('Y-m-d H:i:s'),  
184 - 'updated_at'=>date('Y-m-d H:i:s')  
185 ]; 186 ];
186 - return (new UpdateNotify())->insertGetId($param); 187 + $updateNotifyModel->add($param);
  188 + }
  189 + return $this->success();
187 } 190 }
188 } 191 }