model = new Invoice(); } public function addz() { if (false === $this->request->isPost()) { return $this->view->fetch(); } $param = $this->request->param(); $file_id = \addons\antis\model\File::getId($param['row']['files']); $file = \addons\antis\model\File::where('id',$file_id)->find(); $data = [ 'name'=>$param['name'], 'files'=>$file['file_path'], 'price'=>$param['price'], 'num'=>$param['num'], 'enter'=>$param['enter'], 'contract_id'=>$param['contract_id'], 'customer_id'=>$param['customer_id'], 'createtime'=>time() ]; //halt($data); $this->model->save($data); $this->success(); } }