This commit is contained in:
toom1996
2025-07-11 14:49:59 +08:00
parent b1159b17cb
commit 0a83e2dfc6
3 changed files with 6 additions and 6 deletions

View File

@ -15,9 +15,9 @@ class NewsService extends BaseService
* @param $id
* @return array
*/
public function view($id): array
public function view($id, $app_id): array
{
$query = AppNews::query()->where('id', $id)->where('is_delete', 0)->first()?->toArray();
$query = AppNews::query()->where('id', $id)->where('platform', $app_id)->where('is_delete', 0)->first()?->toArray();
if (!$query) {
return $this->getResponse()->setCode(404)->send();
@ -32,9 +32,9 @@ class NewsService extends BaseService
->toArray();
// 上一篇文章
$query['prevNews'] = AppNews::query()->where('id', '<', $id)->select(['title', 'id'])->where('platform', $query['platform'])->where('is_delete', 0)->orderBy('id', 'desc')->first();
$query['prevNews'] = AppNews::query()->where('id', '<', $id)->select(['title', 'id'])->where('platform', $app_id)->where('is_delete', 0)->orderBy('id', 'desc')->first();
// 下一篇文章
$query['nextNews'] = AppNews::query()->where('id', '>', $id)->select(['title', 'id'])->where('platform', $query['platform'])->where('is_delete', 0)->first();
$query['nextNews'] = AppNews::query()->where('id', '>', $id)->select(['title', 'id'])->where('platform', $app_id)->where('is_delete', 0)->first();
return $this->getResponse()->setData($query)->setCode(0)->send();
}

View File

@ -66,7 +66,7 @@
<label class="layui-form-label">模板</label>
<div class="layui-input-inline layui-input-wrap">
<input type="radio" name="template" value="2" title="模板2">
{{-- <input type="radio" name="sex" value="2" title="">--}}
<input type="radio" name="template" value="3" title="模板3">
{{-- <input type="radio" name="sex" value="nv" title="" checked>--}}
</div>
</div>

View File

@ -73,7 +73,7 @@
<label class="layui-form-label">模板</label>
<div class="layui-input-inline layui-input-wrap">
<input type="radio" name="template" value="2" title="模板2">
{{-- <input type="radio" name="sex" value="2" title="">--}}
<input type="radio" name="template" value="3" title="模板3">
{{-- <input type="radio" name="sex" value="nv" title="" checked>--}}
</div>
</div>