getList($year, $month, $week); return $this->renderSuccess('', compact('list')); } /** * 新增结算 */ public function add() { $model = new BonusModel(); if ($this->request->isGet()) { $config = SettingModel::getItem('basic'); $detail = $model->getBonus(); if(!$detail) { return $this->renderError($model->getError() ?: '无法进行结算操作'); } $detail['total_rate'] = $config['total_rate']; $detail['bonus_type'] = $model->getBonusTypeAttr($config['bonus_type']); return $this->renderSuccess('', compact('detail')); } if ($model->add($this->postData())) { return $this->renderSuccess('操作成功'); } return $this->renderError($model->getError() ?: '操作失败'); } }