request->only([ 'page' => 1, 'size' => 10, 'title' => '', 'contacts' => '', 'mobile' => '', 'status' => '', ], 'post'); return CompanyLogic::List($param); } //添加企业 public function Add() { $param = $this->request->only(['title', 'contacts', 'mobile', 'remark' => '',], 'post'); $val = Validate::rule(Config::get('validate_rules.CompanyAdd')); if (!$val->check($param)) throw new ValidateException($val->getError()); return CompanyLogic::Add($param); } //读取企业详情 public function Read() { $id = $this->request->post('id/d', 0); return CompanyLogic::Read($id); } //编辑企业 public function Edit() { $param = $this->request->only(['id', 'title', 'contacts', 'mobile', 'remark' => '',], 'post'); $val = Validate::rule(array_merge(Config::get('validate_rules.CompanyAdd'), ['id' => 'require|number|gt:0'])); if (!$val->check($param)) throw new ValidateException($val->getError()); return CompanyLogic::Edit($param); } //企业启禁用 public function Change() { $param = $this->request->only(['id', 'status'], 'post'); $val = Validate::rule(Config::get('validate_rules.status')); if (!$val->check($param)) throw new ValidateException($val->getError()); return CompanyLogic::Change($param); } //删除企业 public function Delete() { $id = $this->request->post('id/d', 0); return CompanyLogic::Delete($id); } }