custfinaModel.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. //客户收付款单
  3. class flow_custfinaClassModel extends flowModel
  4. {
  5. public function initModel(){
  6. $this->statearrs = c('array')->strtoarray('未收款|red,已收款|green');
  7. $this->statearrf = c('array')->strtoarray('未付款|red,已付款|green');
  8. }
  9. public function flowrsreplace($rs)
  10. {
  11. $starrr = array('收','付');
  12. $rs['paystatus'] = $rs['ispay'];
  13. $ispay = '<font color=red>未'.$starrr[$rs['type']].'款</font>';
  14. if($rs['ispay']==1)$ispay = '<font color=green>已'.$starrr[$rs['type']].'款</font>';
  15. $rs['ispay'] = $ispay;
  16. $rs['type'] = ''.$starrr[$rs['type']].'款单';
  17. return $rs;
  18. }
  19. //操作菜单操作
  20. protected function flowoptmenu($ors, $arr)
  21. {
  22. //标识已付款处理
  23. if($ors['num']=='pay'){
  24. $ispay = 0;
  25. $paydt = arrvalue($arr,'fields_paydt', $this->rock->now);
  26. if(!isempt($paydt))$ispay = 1;
  27. $this->update("`ispay`='$ispay',`paydt`='$paydt'", $this->id);
  28. m('crm')->ractmoney($this->rs['htid']);
  29. }
  30. }
  31. protected function flowbillwhere($uid, $lx)
  32. {
  33. $month = $this->rock->post('month');
  34. $where = '';
  35. if($month!=''){
  36. $where.=" and `dt` like '$month%'";
  37. }
  38. return array(
  39. 'where' => $where,
  40. 'order' => '`optdt` desc'
  41. );
  42. }
  43. }
粤ICP备19079148号