function RepayForm() { $form = RepayForm::create($this, 'RepayForm')->disableSecurityToken(); //Populate fields the first time form is loaded $form->populateFields(); return $form; }
/** * 逾期还款操作 */ public function repayAction() { $data = $this->request->getPost(); empty($data['uid']) || empty($data['id']) || empty($data['date']) || empty($data['amount']) and $this->error('参数错误'); $data['status'] = 1; $data['date'] = strtotime($data['date']); $model = new RepayForm('repay'); if ($result = $model->validate($data)) { if ($model->repay()) { Loan::updateRepay($data['uid'], $data['amount'], $data['no'], $data['date']); $this->success('操作成功'); } else { $this->error('操作失败'); } } else { $this->error('验证失败'); } }