custfinaModel.php 1.3 KB

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