Beispiel #1
0
 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 clientlist_Action()
 {
     $baseId = intval($this->getInput['baseId']);
     $baseInfo = control_baseMoney::getBaseInfo($baseId);
     list(, $clientList) = control_userBase::getPlanUserHaveList($baseId);
     foreach ($clientList as $client) {
         $uids[] = $client[control_userBase::TABLE_USERID];
     }
     $clientMoreInfoList = control_user::getUserListByIds($uids);
     $this->modelDisplay(array('baseId' => $baseId, 'baseInfo' => $baseInfo, 'clientList' => $clientList, 'clientInfo' => $clientMoreInfoList));
 }
 public function projectInfo_Action()
 {
     $userId = $this->getInput['userId'];
     if ($userId) {
         $userInfo = control_user::getUserInfo($userId);
         if (!$userInfo) {
             showmsg(control_returnCode::FORM_INFO_EMPTY);
         }
     }
     list(, $userPlanList) = control_userBase::getUserPlanList($userInfo[control_user::TABLE_KEY]);
     foreach ($userPlanList as $plan) {
         $baseId[] = $plan[control_userBase::TABLE_KEY];
     }
     list(, $basePlanList) = control_baseMoney::getListByIds($baseId);
     $this->modelDisplay(array('userInfo' => $userInfo, 'userPlanList' => $userPlanList, 'basePlanList' => $basePlanList));
 }