mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
feat: 完成三方平台发布管理
This commit is contained in:
@@ -154,8 +154,8 @@ class Post extends Common
|
||||
$list_post_platform = Nav::where('type', 12)->order('sort asc')->select();
|
||||
|
||||
foreach ($list_post_platform as $model_platform) {
|
||||
$platform_info = explode("\n",$model_platform->desc);
|
||||
$model_platform->home_url = $platform_info[0]?? '';
|
||||
$platform_info = explode("\n", $model_platform->desc);
|
||||
$model_platform->home_url = $platform_info[0] ?? '';
|
||||
$model_platform->account = $platform_info[1] ?? '';
|
||||
}
|
||||
|
||||
@@ -235,6 +235,26 @@ class Post extends Common
|
||||
return $this->success('保存成功', url('index', ['type' => $model_post->getData('type')]));
|
||||
}
|
||||
|
||||
public function setPostPlatformData()
|
||||
{
|
||||
$type = $this->request->param('type', 1);
|
||||
$value = $this->request->param('value', '');
|
||||
$post_id = $this->request->param('post_id', 0);
|
||||
$model_post = ModelPost::find($post_id);
|
||||
|
||||
if (empty($model_post)) {
|
||||
return json_message('文章不存在');
|
||||
}
|
||||
|
||||
$post_platform_data = $model_post->post_platform_data_array;
|
||||
$post_platform_data[$type] = $value;
|
||||
$model_post->post_platform_data = json_encode($post_platform_data);
|
||||
$model_post->post_platform_status = ',' . implode(',', array_keys($post_platform_data)) . ',';
|
||||
$model_post->save();
|
||||
|
||||
return htmx()->message('文章设置成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定资源.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user