PHP报错:
strpos() expects parameter 1 to be string, integer given
出错代码
public static function showArticle($id) { ArticleModel::where('id', '=', $id) ->update(['is_show', 0]); }
问题在于数组的格式写错了
->update(['is_show', 0]);
应该修改为
public static function showArticle($id) { ArticleModel::where('id', '=', $id) ->update(['is_show'=> 0]); }