public function actionDeleteDynamic() { $data = $this->post; if ($result = UserDynamic::getInstance()->deleteDynamic($data['id'])) { $this->renderAjax(['status' => 1, 'data' => $result, 'msg' => '删除成功']); } else { $this->renderAjax(['status' => 0, 'data' => [], 'msg' => '删除失败']); } }
public function actionDeleteDynamic() { $user_id = Cookie::getInstance()->getCookie('bhy_id')->value; if ($data = UserDynamic::getInstance()->editDynamic($user_id, $this->get['id'], ['status' => 0])) { $this->renderAjax(['status' => 1, 'data' => $data, 'msg' => '删除成功']); } else { $this->renderAjax(['status' => 0, 'data' => [], 'msg' => '删除失败']); } }