示例#1
0
 function settle_action() {
     $this->_view_user = new user;
     if (front::post('submit') &&$this->manage->vaild()) {
         $this->manage->filter($this->Exc);
         $this->manage->edit_before();
         $this->manage->save_before();
         $union_payarr = array();
         $union_payarr['expendamount'] = front::$post['settleexpendamount'] = round(floatval(front::$post['settleexpendamount']),2);
         $union_payarr['amount'] = front::$post['settleamount'] = round(front::$post['settleexpendamount']*front::$post['profitmargin']/100,2);
         $union_payarr['userid'] = front::$post['userid']=front::get('id');
         $union_payarr['inputer'] = front::$post['inputer']=$this->view->user['username'];
         $union_payarr['addtime'] = front::$post['addtime']=time();
         $union_payarr['ip'] = front::$post['ip']=front::ip();
         $union_payarr['payaccount'] = front::$post['payaccount'];
         $union_payarr['profitmargin'] = front::$post['profitmargin'];
         $union_pay = new union_pay();
         $insert = $union_pay->rec_insert($union_payarr);
         $unionarr = array();
         $unionarr['totalexpendamount']='[totalexpendamount+'.front::$post['settleexpendamount'].']';
         $unionarr['totalpayamount']='[totalpayamount+'.front::$post['settleamount'].']';
         $unionarr['lastpayamount']=front::$post['settleamount'];
         $unionarr['lastpaytime']=time();
         $unionarr['settleexpendamount']='[settleexpendamount-'.front::$post['settleexpendamount'].']';
         $this->_table->rec_update($unionarr,front::get('id'));
         $this->_view_user->rec_update(array('point'=>'[point-'.front::$post['settleexpendamount'].']'),front::get('id'));
         front::flash("{$this->tname}完成操作!");
         front::redirect(url::modify('act/list/table/'.$this->table));
     }
     $userunion = $this->_view_user->getrow(array('userid'=>front::get('id')));
     $this->_table1 = new union();
     $this->_view_table=$this->_table1->getrow(array('userid'=>front::get('id')));
     $this->_view_table=$this->_view_table+$userunion;
 }
示例#2
0
 function pay_action() {
     $union_pay = new union_pay();
     if(!front::get('page')) front::$get['page']=1;
     $limit=((front::$get['page']-1)*20).',20';
     $where="userid={$this->view->user['userid']}";
     $this->view->paylist = $union_pay->getrows($where,$limit,'1 desc');
     $this->view->record_count=$union_pay->record_count;
 }