|
|
@@ -29,7 +29,7 @@ class NewsController extends AdminController
|
|
|
$q->orWhere('en_title','like',"%$title%");
|
|
|
}
|
|
|
})
|
|
|
- ->select(['id','image','cn_title','en_title','created_at'])
|
|
|
+ ->select(['id','image','cn_title','en_title','is_top','sort','created_at'])
|
|
|
->orderBy('id','desc')
|
|
|
->paginate(10);
|
|
|
|
|
|
@@ -65,10 +65,12 @@ class NewsController extends AdminController
|
|
|
$image = request()->input('image', '');//缩略图
|
|
|
$cn_content = request()->input('cn_content', '');//
|
|
|
$en_content = request()->input('en_content', '');//
|
|
|
+ $sort = request()->input('sort', 50);//排序
|
|
|
+ $is_top = request()->input('is_top', 0);//是否置顶
|
|
|
if(empty($cn_title) || empty($en_title) || empty($image)){
|
|
|
return $this->apiResponseError('缺少必要参数');
|
|
|
}
|
|
|
- $data = compact('cn_title','en_title','cn_content','en_content','image');
|
|
|
+ $data = compact('cn_title','en_title','cn_content','en_content','image','sort','is_top');
|
|
|
|
|
|
if(empty($id)){//不存在id就创建
|
|
|
|