Ejemplo n.º 1
0
 public function editFinance($id = 0)
 {
     $model = new \Loan\Model\CompanyModel();
     if (IS_POST) {
         $this->_relaField(true);
         $model->create() or $this->error($model->getError());
         $model->save() !== false or $this->error($model->getError());
         $model->update_order_finance(I('id'));
         $this->success('编辑成功!', U('index?id=' . I('id')));
     } else {
         $info = $model->find($id) or $this->error('找不到此记录信息!');
         $this->_initForm($info);
         int_to_string($info, $this->_field_text_map);
         $this->assign('info', $info);
         $this->meta_title = '编辑' . $this->_node_name;
         $this->display();
     }
 }