Example #1
0
 public function setMemberId($_memberId, $isMust = 1)
 {
     $Members = new members();
     if ($_memberId) {
         $this->memberId = $_memberId ? (int) $_memberId : 0;
         if (!$Members->checkuser($this->memberId)) {
             throw new Exception(NO_MEMBER, 200);
         }
     } elseif ($isMust) {
         throw new Exception(NO_MEMBER_ID, 200);
     }
 }
Example #2
0
 /**
  *
  * 获取需要的条件
  */
 private function get_condition()
 {
     $Members = new members();
     if ($this->user['user_id'] || $this->input['member_id']) {
         $this->member_id = $this->input['member_id'] ? intval($this->input['member_id']) : ($this->user['user_id'] ? $this->user['user_id'] : 0);
         if (!$Members->checkuser($this->member_id)) {
             $this->errorOutput(NO_MEMBER);
         }
     } elseif (!$this->member_id) {
         $this->errorOutput(NO_MEMBER_ID);
     }
     if ($this->input['mark']) {
         $this->mark = trim($this->input['mark']);
         $memberMySet = new memberMySet();
         if (!$memberMySet->count(array('mark' => $this->mark))) {
             $this->errorOutput(MARK_ERROR);
         }
     } else {
         $this->errorOutput(NO_MARK_ERROR);
     }
     if ($this->input['total']) {
         $this->total = trim($this->input['total']);
         if (!is_numeric($this->total)) {
             $this->errorOutput(TOTAL_ERROR);
         }
         $this->total = (int) $this->total;
     }
     if ($this->input['math']) {
         if (intval($this->input['math']) == 1) {
             $this->math[total] = '+';
         } elseif (intval($this->input['math']) == 2) {
             $this->math[total] = '-';
         }
     }
     if ($this->input['totalsum']) {
         $this->totalsum = trim($this->input['totalsum']);
         if (!is_numeric($this->totalsum)) {
             $this->errorOutput(TOTAL_ERROR);
         }
         $this->totalsum = (int) $this->totalsum;
     }
     if (intval($this->input['summath']) == 1) {
         $this->math[totalsum] = '+';
     } elseif (intval($this->input['summath']) == 2) {
         $this->math[totalsum] = '-';
     }
 }