This commit is contained in:
mkm 2023-06-09 09:49:23 +08:00
parent a25798316c
commit 78986e3900

View File

@ -52,11 +52,8 @@ class Project extends Base
*/ */
public function publish(Request $request) public function publish(Request $request)
{ {
$data = $request->post(); $res=Db::name('Projects')->where('id', $request->post('id'))->update(['state' => $request->post('state')]);
$find = ProjectModel::find($data['id']); if ($res) {
$find['state'] = $data['state'];
$find->save();
if ($find) {
return $this->json(200, '操作成功'); return $this->json(200, '操作成功');
} else { } else {
return $this->json(500, '操作失败'); return $this->json(500, '操作失败');