mode_finjkdAction.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. class mode_finjkdClassAction extends inputAction{
  3. protected function savebefore($table, $arr, $id, $addbo){
  4. $rows['type'] = '2';//一定要是2,不能去掉
  5. return array(
  6. 'rows'=>$rows
  7. );
  8. }
  9. protected function saveafter($table, $arr, $id, $addbo){
  10. }
  11. public function getlastAjax()
  12. {
  13. $rs = m('fininfom')->getone("`uid`='$this->adminid' and `type`<3 order by `optdt` desc",'paytype,cardid,openbank,fullname');
  14. if(!$rs)$rs='';
  15. $this->returnjson($rs);
  16. }
  17. //借款统计
  18. public function jktotalbeforeshow($table)
  19. {
  20. $kjk = $this->post('kjk','0');
  21. $key = $this->post('key');
  22. $atype = $this->post('atype');
  23. $where = '';
  24. if(!isempt($key))$where.=" and (`name` like '%$key%' or `ranking` like '%$key%' or `deptname` like '%$key%')";
  25. if($kjk=='1'){
  26. $str = m('fina')->getjkdwhere();
  27. $where.=" and `id` in($str)";
  28. }
  29. if($atype=='my'){
  30. $where='and id='.$this->adminid.'';
  31. }else{
  32. $where.= m('admin')->getcompanywhere(5);
  33. }
  34. $fields = 'id,name,deptname,ranking,workdate,state';
  35. return array('where'=>$where,'fields'=>$fields,'order'=>'`id`');
  36. }
  37. public function jktotalaftershow($table, $rows)
  38. {
  39. $zta = m('flow:userinfo');
  40. $uids = '0';
  41. foreach($rows as $k=>$rs){
  42. if($rs['state']==5)$rows[$k]['ishui']=1;
  43. $rows[$k]['state'] = $zta->getuserstate($rs['state']);
  44. $uids.=','.$rs['id'].'';
  45. }
  46. if($uids!='0')$rows = m('fina')->totalfkd($rows, $uids);
  47. return array(
  48. 'rows' => $rows
  49. );
  50. }
  51. }
粤ICP备19079148号