有个bug,编辑问题或者文章,个人动态并不会更新。

有个bug,编辑问题或者文章,个人动态并不会更新。

查看代码,发现是不同的表,doings表应该如何更新内容???

请先 登录 后评论

2 个回答

ing

/*查询对应doing数据 更新数据*/ $doing = DB::table('doings')->where('action','create_article')->where('user_id',$article->user_id)->where('source_id',$article_id)->where('source_type',get_class($article))->first();

$doings = Doing::find($doing->id); if(!$doings){ abort(404); }

$doings->subject = trim($request->input('title')); $doings->content = $request->input('summary');

$doings->save();

请先 登录 后评论
宋登峰 - 官方技术支持
擅长:tipask,php,服务器,网站建设

目前策略就是这样设置的,只有发布的时候才会记录动态,编辑不做记录  :)

请先 登录 后评论