update
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user