public function setCash_Action() { if (app::v('checkallow', 'submit')) { if (!$this->getInput['clientMoney']) { showmsg(control_returnCode::PROJECT_MONEY_FAIL); } $user = control_user::getUserInfo($this->getInput['clientId']); if ($this->getInput['clientId'] && !$user) { showmsg(control_returnCode::REG_ERROR_NOTFOUND); } elseif ($this->getInput['clientId']) { $userBasePlan = control_userBase::getUserPlanByUserId($this->getInput['projectId'], $user[control_user::TABLE_KEY]); if (!$userBasePlan) { control_userBase::makeUserPlan(0, $this->getInput['projectId'], $user[control_user::TABLE_KEY]); } } switch ($this->getInput['cashType']) { case 'outcash_in': $cashDo = 'add'; break; case 'outcash_out': $cashDo = 'reduce'; break; case 'incash_in': $cashDo = 'add'; break; case 'incash_out': $cashDo = 'reduce'; break; } $projectId = $this->getInput['projectId']; switch ($this->getInput['doProject']) { case 'add': $projectId = control_baseMoney::makeBaseInfo(array(control_baseMoney::TABLE_KEYNAME => $this->getInput['projectName'], control_baseMoney::TABLE_BASEMONEY => $this->getInput['clientMoney'], control_baseMoney::TABLE_RUNMONEY => $this->getInput['clientMoney'], control_baseMoney::TABLE_CLIENTMONEY => $this->getInput['clientMoney'])); break; case 'edit': control_baseMoney::editBaseInfo(array(control_baseMoney::TABLE_KEYNAME => $this->getInput['projectName']), $projectId); break; case 'setcash': control_baseMoney::editCash($projectId, $this->getInput['clientMoney'], $cashDo); break; } switch ($this->getInput['cashType']) { case 'outcash_in': control_userBase::pushMoneyByUserId($this->getInput['clientMoney'], $projectId, $user[control_user::TABLE_KEY], $cashDo); break; case 'outcash_out': control_userBase::pushMoneyByUserId($this->getInput['clientMoney'], $projectId, $user[control_user::TABLE_KEY], $cashDo); break; } showmsg(control_returnCode::FORM_SUBMIT_TRUE); } else { list(, $list) = control_baseMoney::getList(1, 50); $this->defaultTemplate = 'admin/moneyCash'; $this->modelDisplay(array('baselist' => $list)); } }
public function list_Action() { list(, $projectList) = control_baseMoney::getList($this->getInput['page'], 20); $this->modelDisplay(array('projectList' => $projectList)); }