/** *更新项目介绍 */ public function updateTeam() { //获取项目id $id = $this->request->get('id'); //获取公司id $company = Company::find($id); if (!$company) { return return_rest('0', '', '公司不存在'); } $content = $this->request->get('content'); //更新团队优势 团队介绍 $extend = CompanyExtend::where('company_id', $company->id)->first(); if (is_null($extend)) { return return_rest('0', '', '更新失败'); } $extend->story = $content; if ($extend->save()) { return return_rest('1', '', '更新成功'); } return return_rest('0', '', '更新失败'); }
public function delete($id) { $this->checkPageAction($this->page_id, Action::$Delete); $response = array('status' => false, 'msg' => 'Unable to find company information!'); if (Request::ajax() && Company::find($id) && Input::has('reason')) { $reason = Input::get('reason'); $company = Company::find($id); $company->company_status = $company->company_status == 'Active' ? 'Inactive' : 'Active'; if ($company->save()) { if ($company->company_status == 'Inactive') { $inactiveHistoryInfo = array('company_id' => $id, 'reason' => $reason, 'datetime' => Carbon::now()); $company->inactiveHistory()->insert($inactiveHistoryInfo); } $response['status'] = true; } return json_encode($response); } return json_encode($response); }